Jiffies: Difference between revisions

From XDSwiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Here are two one-liners for your .cshrc (FIXME: or should these lines go into .login or .profile?) :
Here is a one-liner for your .cshrc :


  alias sortlattices "egrep '^   ..       [aomhtc]' IDXREF.LP | sort -k3n | head -12"
  alias scalefactors "egrep '^ ..... ..[0-9] ...... ........ .... ...... ....... ..... ........ ........' INTEGRATE.LP"
alias scalefactors "egrep ' ....   0 ...... .......   .. .....   ....   ... ...... ......' INTEGRATE.LP"


FIXME: what are these lines in bash syntax?
In sh/bash/ksh/zsh syntax the latter would be:


For the not-so-Unix-proficient-ones: ''sortlattices'' runs on IDXREF.LP the following commands:
alias scalefactors="egrep '^ ..... ..[0-9] ...... ........ .... ...... ....... ..... ........ ........' INTEGRATE.LP"
# grep (for finding lines that are non-blank at two positions and have one out of the characters 'aomtc' later in the line)
 
# sorts these lines on the third column, numerically, ascending
which could go into ~/.bashrc (or should it go into .login or .profile?)  
# and prints the first 12 of these to the terminal
 
----


''scalefactors'' finds those lines in INTEGRATE.LP which match a certain pattern of blanks and non-blanks. These are just the lines printed during the INTEGRATE step for each frame. It is very useful (e.g. to find shutter problems, or to "see" the crystal die from radiation damage) to run  
''scalefactors'' finds those lines in INTEGRATE.LP which match a certain pattern of blanks and non-blanks. These are just the lines printed during the INTEGRATE step for each frame. It is very useful (e.g. to find shutter problems, or to "see" the crystal die from radiation damage) to run  
  scalefactors > frames.scales
  scalefactors > frames.scales
and to plot the scale factors and mosaicity and beam divergence of each frame in gnuplot.
and to plot the scale factors, mosaicity and beam divergence of each frame in gnuplot.


This can be done by
This can be done by
Line 28: Line 28:


If you do have bad outliers (e.g. shutter didn't open), and decide that you for now simply want to remove those frames, then you could rename the frames (just append ".bad" to the name), and re-run XDS from the INTEGRATE step.
If you do have bad outliers (e.g. shutter didn't open), and decide that you for now simply want to remove those frames, then you could rename the frames (just append ".bad" to the name), and re-run XDS from the INTEGRATE step.
* Please note that mosaicity is the unrefined mosaicity. The refined mosaicity values for each integrated batch (nine values for different regions on the detector) can be found in the lines containing the string "SIGMAR (degrees)".


If you simply want the plots and glue them into your lab book, just run
----


If you simply want the plots and glue them into your lab book, just run (assuming "ms688_2" is the name of your dataset!):
#!/bin/csh -f
setenv DATASET ms688_2
scalefactors > $DATASET.scales
ln -s $DATASET.scales $DATASET.mosaicity
ln -s $DATASET.scales $DATASET.divergence
  gnuplot<<EOF
  gnuplot<<EOF
  set term png
  set term png
  set grid
  set grid
  set out 'scale.png'
  set out 'scale.png'
  plot "frames.scales" using 1:3
  plot "$DATASET.scales" using 1:3
  set out 'divergence.png'
  set out 'divergence.png'
  plot "frames.scales" using 1:9
  plot "$DATASET.divergence" using 1:9
  set out 'mosaicity.png'
  set out 'mosaicity.png'
  plot "frames.scales" using 1:10
  plot "$DATASET.mosaicity" using 1:10
  EOF
  EOF
rm -f $DATASET.{scales,mosaicity,divergence}
to get
[[Image:scale.gif]]
[[Image:divergence.gif]]
[[Image:mosaicity.gif]]

Latest revision as of 14:47, 3 July 2019

Here is a one-liner for your .cshrc :

alias scalefactors "egrep '^ ..... ..[0-9] ...... ........ .... ...... ....... ..... ........ ........' INTEGRATE.LP"

In sh/bash/ksh/zsh syntax the latter would be:

alias scalefactors="egrep '^ ..... ..[0-9] ...... ........ .... ...... ....... ..... ........ ........' INTEGRATE.LP"

which could go into ~/.bashrc (or should it go into .login or .profile?)


scalefactors finds those lines in INTEGRATE.LP which match a certain pattern of blanks and non-blanks. These are just the lines printed during the INTEGRATE step for each frame. It is very useful (e.g. to find shutter problems, or to "see" the crystal die from radiation damage) to run

scalefactors > frames.scales

and to plot the scale factors, mosaicity and beam divergence of each frame in gnuplot.

This can be done by

> gnuplot
plot "frames.scales" using 1:3

or

> gnuplot
plot "frames.scales" using 1:9

or

> gnuplot
plot "frames.scales" using 1:10

It is useful to run gnuplot this way, because you can move the mouse over an outlier and see its coordinates (x=frame number) in the lower left corner of the plot window.

If you do have bad outliers (e.g. shutter didn't open), and decide that you for now simply want to remove those frames, then you could rename the frames (just append ".bad" to the name), and re-run XDS from the INTEGRATE step.

  • Please note that mosaicity is the unrefined mosaicity. The refined mosaicity values for each integrated batch (nine values for different regions on the detector) can be found in the lines containing the string "SIGMAR (degrees)".

If you simply want the plots and glue them into your lab book, just run (assuming "ms688_2" is the name of your dataset!):

#!/bin/csh -f
setenv DATASET ms688_2

scalefactors > $DATASET.scales
ln -s $DATASET.scales $DATASET.mosaicity
ln -s $DATASET.scales $DATASET.divergence

gnuplot<<EOF
set term png
set grid
set out 'scale.png'
plot "$DATASET.scales" using 1:3
set out 'divergence.png'
plot "$DATASET.divergence" using 1:9
set out 'mosaicity.png'
plot "$DATASET.mosaicity" using 1:10
EOF

rm -f $DATASET.{scales,mosaicity,divergence}

to get Scale.gif Divergence.gif Mosaicity.gif