Version 2 Update

18 views
Skip to first unread message

joshu...@gmail.com

unread,
Jun 8, 2008, 11:21:10 PM6/8/08
to Area Diffraction Machine, sam...@slac.stanford.edu, bron...@berkeley.edu, me...@slac.stanford.edu, sarah....@gmail.com
It has been too long since I gave an update on the Area Diffraction
Machine, so here it goes. I have a relatively up to date software
manual for the program which is now readily available as a pdf from
the Google Code page. There are some things I need to update in the
manual (mainly having to do with version 2 features) that I will work
on, but it is pretty complete. If you guys find any typos, errors, or
have any suggestions about it, please let me know.

The idea for a while has been to create a version 2 of the program
with new features. I have added many new features into the program and
a beta of version 2 is available on the home page. I have a change log
describing all of the features at
http://areadiffractionmachine.googlecode.com/svn/trunk/source/ChangeLog.txt.
This file will be the most up to date way to see what has changed. I
will describe below the major additions:

* I have somewhat added support for the bruker file format. I still
have several questions about the bruker format that I haven't had
answered, so the implementation is not complete. First, I can't
figured out what file extension bruker data should have. The program
currently can't read in overloaded pixels at the bottom of the bruker
file. Also, I am not sure if my program will properly read in 32 bit
bruker data. I discuss all of my concerns about my implementation at
http://groups.google.com/group/area-diffraction-machine/browse_thread/thread/8f2a3b2f12a5f1c0
and hopefully somebody can help me out.

* the code now uses my geometric transform equations (derived in the
manual) instead of Abhik's formulas. They seem to be doing the right
thing.

* I modified the caking and integrating algorithm so that they would
set all intensity integration data or cake data values that are less
than 0 to equal exactly 0. This was done so that there wouldn't be any
ambiguity since cake and intensity values are sometimes given negative
values to signify other things happening in the data (like pixel masks
or no values put into a bin).

* You can now cake in 2theta.

* The program will ignores any peaks found inside polygon masks. Also,
peaks are no longer displayed on top of polygon masks in the
diffraction and cake displays.

* I improved the formatting of peak list files. The peak list files
are now space separated instead of tab separated which makes the
output look nicer. The header is also more verbose.

* There is now a "Save Last Fit" button that can be used to save all
of the information about the previous calibration.

* The intensity integration will display minor tic marks on the y axis
when displaying a log scale.

* There is now a "Preferences" menu that can be opened from the "File"
menu. It can be used to specify the default folder to select files and
folders from and it can be a real time saver when opening files from
the same place many times.

* This is my favorite; there is a new cute option called "Set As
Initialization" which can be used to save a recorded macro so that it
is run each time the program opens. You set this by recording a macro
like usual, but then pushing the "Set As Initialization" option
instead of the "Stop Record Macro". The saved macro file will be run
whenever the program opens. This can be used to set various check
boxes, colors, and user inputs to nice default values.

* There is a new Abort button which will pop up as a macro is run and
can be used to stop a macro while it is running. It is sometimes a
little difficult to push, especially when the program gets frozen up
running long calculations like integrating, but if you are diligent
and push it a couple of times, it will eventually stop the macro.

* Macros will now create folders if necessary in order to save files
to folders that don't yet exist. This is nice because the program
won't raise an annoying warning message when a folder doesn't exist.

* The size of the inputs in the GUI have been increased so that longer
numbers can be read easier.

The only other thing that we have been clamoring for to put in version
2 is to fix the Q intensity integration. Basically, when doing a Q
integration, we want to make sure that what we report is the total
intensity around the diffraction ring and not the average intensity
(or at least something that is proportional to this). So far, I
haven't done anything about this. But I discussed it with my physics
professor and he had a good suggestion. The difficulty in reporting
total intensity is that we do not always have all the pixel data for a
given Q value (because some of the ring might be in a pixel mask or
outside of the detector. My professor's idea was to calculate the
total intensity as

Total intensity ~ average intensity * R

where R is the physical distance on an imagined untitled detector from
the center of the detector to the Q ring and the average can be
calculated from only those pixels around the ring that are in the data
and not in a mask. Remember that R is calculated by R=D*tan(2theta).
Of course, this formula doesn't get the constant of proportionality
right, but it should work anyway for comparing relative intensities,
which is all that is really necessary. I think that this formula
should do the right thing. If you guys agree, it will be easy for me
to code up.

Finally, we need to get some more standard Q values to put in the
program. Do you guys have any that I can add?

I think that we are really close to finishing all the features that
version 2 should have. We will then have to more thoroughly test the
program. I am happy to hear any feedback, suggestions, bug reports, or
requests at this point.

Apurva

unread,
Jun 9, 2008, 1:12:48 PM6/9/08
to joshu...@gmail.com, Area Diffraction Machine, sam...@slac.stanford.edu, bron...@berkeley.edu, sarah....@gmail.com
Josh,

This is great. Can't wait to download the new version.

I like the fix your physics professor suggested for Q integration fix.

One more thing that has to be fixed is that integration is averaged to
"unit chi", so that if the detector catches only a limited amount of chi
(and depending on the shape the amount of chi will vary as a function of
Q), of if a part of the ring is masked the q integrated data is still
represents complete chi space.

Can't write longer - have to rush down to a beamline.

BTW, when are you coming to Stanford?

cheers

Apurva

--
***********************************************************************
Apurva Mehta
SSRL/SLAC
Stanford University
Bldg. 137, MS 69, 2575 Sand Hill Rd.
Menlo Park, CA 94025-7015
(650) 926 4791, (650) 926 4100 - FAX
***********************************************************************

Joshua Lande

unread,
Jun 10, 2008, 2:06:52 AM6/10/08
to Apurva, Area Diffraction Machine, Sam Webb, David Bronfenbrenner
I am coming to Stanford next week and I will be working on GLAST at
KIPAC!

Currently, when the program does a chi integration, it calculates the
average intensity in each chi range. So, I calculate the sum intensity
for all pixels with chi in some range and divided this by the number
of pixels. If this is not the right thing, can you explain a little
more physically what you think we should be plotting. If this is too
cumbersome to do by email, I can come by and talk this over when I get
to Stanford.

Josh

Apurva

unread,
Jun 12, 2008, 1:26:28 PM6/12/08
to Joshua Lande, Area Diffraction Machine, Sam Webb, David Bronfenbrenner
Josh,

I am not sure I completely understand what you do currently. It seems
right - at least what we want ADM to do. But just to confirm - look at
the attached image - red and green are two diffraction rings and blue is
the detector. When ADM does a Q/2th integration the relative
intensities of integrated red and green peaks in case A and B should
come out be the same.

Will they be in the way you are integrating now?

(I hope my figure makes sense - otherwise lets talk when you come here.)

cheers

Apurva

--

Snap2.jpg

Apurva

unread,
Jun 12, 2008, 1:33:35 PM6/12/08
to Joshua Lande, Area Diffraction Machine, Sam Webb, David Bronfenbrenner
Oh, forgot to say that same thing should happen when some parts of a
ring are masked out. For example, in the attached figure again the
relative ratios of the integrated intensities of red and green ring
should be the sample (black rectangle is the mask.)

--

Snap3.jpg

Apurva

unread,
Jun 12, 2008, 4:08:36 PM6/12/08
to Joshua Lande, Area Diffraction Machine, Sam Webb, David Bronfenbrenner
Josh,

I did check a few things on the newest beta version (217). I haven't
yet tested the macro mode. Either David or I will do it soon. But
other most things work very well. (calibration, calibration with
masking, caking, integration etc.) The only thing I had trouble with
was scrolling in a zoomed cake window - gave me a bunch of errors.

Also, is it possible to add a mask in a cake window (as well as in the
main window)?

thanks

(The program is looking better and better....)

Apurva

--

David Bronfenbrenner

unread,
Jun 12, 2008, 5:38:50 PM6/12/08
to Apurva, Joshua Lande, Area Diffraction Machine, Sam Webb
I have tested the macro portion and it seems to be working fine. It does
create folders if they are not there which is great. Good luck with the
move out here.

Dave

Joshua Lande

unread,
Jun 12, 2008, 6:09:54 PM6/12/08
to David Bronfenbrenner, Apurva, Area Diffraction Machine, Sam Webb
Thanks for your kind words apurva.

David, have you tried the 'Set as Initialization' option? Or the
preferences page?

Apurva, I will work on the integration algorithm soon. I will also fix
the cake scrolling bug.

Right now, you can't add or remove masks with the cake window. The
reason I didn't do this was because it would be particularly difficult
to convert a polygon mask in Q-chi space into a polygon mask in x-y
space to store it. I could have possibly gotten around this by storing
two types of masks, some in Q-chi space and some in x-y space. But I
couldn't think of a way to do this which wouldn't have been very
difficult write. Do you foresee people really wanting this feature.
Because if so, I will think about it some more and see if I can find
an easy way to add it. But otherwise, I would rather not worry about it.

By the way, I don't know if you guys realized this, but when I sent
out the version 2 update, I added area-diffrac...@googlegroups.com
as an email to the CC field and Google has been smart enough to
archive our discussion on the mailing list. You can find it at (http://groups.google.com/group/area-diffraction-machine/browse_thread/thread/82b0e047b51d22ed
). This is nice. In the future, we should keep doing this so that we
can archive our discussion of the program on the mailing list without
having to bother with the web interface or anything obnoxious like that.

Thanks again for the feed back.

Josh

David Bronfenbrenner

unread,
Jun 12, 2008, 6:15:16 PM6/12/08
to Joshua Lande, Apurva, Area Diffraction Machine, Sam Webb
I have tried the initialization option and played with the preferences
page. It all works very well.

I had noticed the google groups and hope that it is useful to someone
sometime.

Dave

Apurva

unread,
Jun 12, 2008, 11:07:29 PM6/12/08
to Joshua Lande, David Bronfenbrenner, Area Diffraction Machine, Sam Webb
Josh,

If masking in cake window is cumbersome leave it. The other masking
does the job - it just takes a little longer if one is trying to mask
out a ring.

cheers

Apurva

--

Reply all
Reply to author
Forward
0 new messages