 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
35 vector<double> bx(2,0), by(2,0);
39 for ( i = 0, sf = mg->
sf; sf; sf = sf->
next, i++ ) {
51 cerr <<
"Error: Too few structure factors to calculate unit cell vectors!" << endl;
82 if ( resolution < 2*mg->pixel_size[0] )
85 double hkl_lim = real_size[0]/resolution;
86 if ( real_size[1] > real_size[0] ) hkl_lim = real_size[1]/resolution;
87 double hkl_lim2 = hkl_lim*hkl_lim + 0.001;
90 cout <<
"Generating reflections to " << resolution <<
" Å" << endl;
92 long n(0), h, k, l, hmin,
kmin, lmin, hmax,
kmax, lmax;
93 double h2, k2, l2, hlen, klen;
98 hmax = (long) (hkl_lim/hlen);
102 kmax = (long) (hkl_lim/klen);
111 cout <<
"real_size=" << real_size << endl;
112 cout <<
"hvec=" << mg->
hvec << endl;
113 cout <<
"kvec=" << mg->
kvec << endl;
114 cout <<
"hmax=" << hmax <<
" kmax=" <<
kmax << endl;
115 cout <<
"mg->origin=" << mg->
origin << endl;
118 for ( l=lmin; l<=lmax; l++ ) {
123 for ( h=hmin; h<=hmax; h++ ) {
126 if ( h2 + k2 + l2 <= hkl_lim2 ) {
131 if ( !mg->
sf ) mg->
sf = sf;
164 for ( sf = sflist; sf; sf = sf->
next )
166 for ( i=0; i<datasize; i++ )
167 if ( (*pmask)[i] < 1 ) p->
set(i, 0);
169 for ( sf = sflist; sf; sf = sf->
next ) {
173 for ( i=0; i<datasize; i++ )
174 if ( (*pmask)[i] < 1 ) p->
set(i, cv);;
Header file for matrix functions.
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
void set(long j, double v)
Sets a single value at the given index.
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
int multiply_in_place(vector< double > &vec)
Class for complex numbers.
Vector3< long > size() const
Header file for functions to process crystallographic data.
long kmax(long i, long km, long m)
General image parameter class.
CompoundType compound_type()
Utilities for timing functions.
double LU_decomposition()
Matrix inversion by LU decomposition.
int mg_unitcell_vectors(Bmicrograph *mg)
Calculates the unit cell vectors for a 2D crystal.
Vector3< T1 > vector3_set_PBC(Vector3< T1 > coord, Vector3< T2 > box)
Header file for general utilities.
int img_mask_reflections(Bimage *p, Bstrucfac *sflist, double radius)
Masks the image using the list of reflections.
Generalized matrix class.
Header file for micrograph processing.
Header file for generalized linked list functions.
long mg_generate_reflections(Bmicrograph *mg, Vector3< double > real_size, double resolution)
Generates reflections given the unit cell vectors.
Vector3< double > pixel_size
long kmin(long i, long hk)
int sphere(Vector3< double > center, double radius, double width=0, int fill_type=0, double fill=0)
Fills a sphere within an image with a uniform value.