24 "Usage: breflect [options] file.hkl file.hkl",
25 "-------------------------------------------",
26 "Edits and analyzes structure factor files.",
29 "-fom 0,1.0,0.0 Rescale FOM to min and max and apply cutoff.",
30 "-weigh Weigh the amplitudes with the FOM.",
31 "-translate 1.5,-5.2,3 Translation in pixel coordinates.",
32 "-analyze Analyze structure factors.",
33 "-mirror Mirror = invert Friedel symmetry.",
34 "-normalize Normalize to average amplitude.",
35 "-scale file.hkl Scale SF with profile from input SF.",
36 "-combine file.hkl Combine SF with profile scaling with input SF.",
37 "-symmetry 1 Check symmetry for this space group.",
38 "-Symmetry 1 Apply symmetry for this space group.",
41 "-verbose 7 Verbosity of output.",
42 "-datatype u Force writing of a new data type.",
43 "-sampling 2,3.5,1 Sampling (angstrom/voxel, a single value sets all three).",
44 "-resolution 6.5,150 High and low resolution in A (default maximum in data).",
45 "-unitcell 96,96,100,90,90,90 Unit cell parameters.",
46 "-free 15 % flagged for R-free calculations (default 10%).",
51 int main(
int argc,
char **argv)
58 float hires(0), lores(0);
65 float fommin(0), fommax(0);
75 for ( curropt = option; curropt; curropt = curropt->
next ) {
76 if ( curropt->
tag ==
"datatype" )
78 if ( curropt->
tag ==
"sampling" )
80 if ( curropt->
tag ==
"translate" ) {
82 if ( shift.
length() < 0.1 )
83 cerr <<
"-translate: Three values must be specified!" << endl;
85 if ( curropt->
tag ==
"analyze" )
87 if ( curropt->
tag ==
"resolution" )
88 if ( curropt->
values(hires, lores) < 1 )
89 cerr <<
"-resolution: A resolution limit must be specified!" << endl;
90 if ( curropt->
tag ==
"fom" )
91 if ( curropt->
values(fommin, fommax, fomcut) > 0 )
92 if ( fommax <= 0 ) fommax = -1;
93 if ( curropt->
tag ==
"symmetry" )
95 cerr <<
"-symmetry: A space group must be specified!" << endl;
96 if ( curropt->
tag ==
"Symmetry" ) {
98 cerr <<
"-Symmetry: A space group must be specified!" << endl;
101 if ( curropt->
tag ==
"unitcell" )
103 if ( curropt->
tag ==
"mirror" )
105 if ( curropt->
tag ==
"normalize" )
107 if ( curropt->
tag ==
"weigh" )
109 if ( curropt->
tag ==
"free" )
110 if ( ( pfree = curropt->
value.
real() ) < 0.0001 )
111 cerr <<
"-free: %% reflections flagged must be specified" << endl;
112 if ( curropt->
tag ==
"scale" )
114 if ( curropt->
tag ==
"combine" )
125 cerr <<
"Error: File not read!" << endl;
138 cout <<
"Resolution: " << hires << endl;
139 cout <<
"Sampling: " << p->
sampling() << endl;
140 cout <<
"Space group: " << p->
space_group() << endl;
141 cout <<
"Unit cell dimensions: " <<
142 uc.
a() <<
" " << uc.
b() <<
" " << uc.
c() << endl;
143 cout <<
"Unit cell angles: " <<
152 if ( fommax > 0 ) p->
FOM_adjust(fommin, fommax, fomcut);
177 cout <<
"Origin at: " << dx[0] <<
" " << dx[1] <<
" " << dx[2] << endl;
183 if ( combinefile.
length() )
187 if ( optind < argc ) {
void change_type(char letter)
Get the data type indicated by a single letter code.
int phase_shift(Vector3< double > shift)
Phase shifts a set of reflections.
unsigned long values(T1 &v1, T2 &v2)
double * img_check_space_group(Bimage *p, double resolution)
Checks the crystal space group symmetry and the shift to a symmetry axis.
Header file for general utilities.
Vector3< double > sampling()
CompoundType compound_type()
void unit_cell(UnitCell u)
double * img_apply_space_group(Bimage *p, double resolution)
Applies the necessary shift to superimpose the origin on a symmetry axis.
Bstring get_cmd_line(int argc, char **argv)
Returns the command line as a string.
int main(int argc, char **argv)
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
int img_sfscale(Bimage *p, Bstring &hklname)
Scales the input reflections with a second set.
Header file for image utilities.
Utilities for timing functions.
General image parameter class.
int img_mirror_reflections(Bimage *p)
Mirrors a set of reflections by negating the phases.
Bimage * read_img(const char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
A class for a command line input option.
unsigned long img_select_reflections(Bimage *p, double hires, double lores, double cone, int weigh, double fomcut)
Selects reflections for output.
General FFT for n-dimensional data.
unsigned int space_group()
int img_fft(Bimage *p)
Fast Fourier transforms an image.
int img_multiply_by_fom(Bimage *p)
Weighs a set of reflections by its figure-of-merit.
DataType
Base data type specifier.
int img_normalize_reflections(Bimage *p)
Normalizes a set of reflections encoded as a complex image.
int write_img(const char *filename, Bimage *p)
General driver function to write multiple image formats This is the only image writing function that ...
Vector3< double > vector3()
Header file for symmetry functions.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Header file for 2D and 3D image I/O.
Header file for option handlers.
int img_sfmerge(Bimage *p, Bstring &hklname)
Merges the input reflections with a second set.
int bexit(int value)
Exit function for cleanup and debugging.
Routines to manipulate reflection files.
double timer_start()
Starts timer and prints the time.
int FOM_adjust(double fommin, double fommax, double fomcut)
Adjust the figure-of-merit values to a new range.
int img_sfanalyze(Bimage *p)
Analyzes the FOM's of a set of reflections encoded as a complex image.