- Adapted indenation to new agreed upon system

- Added support for second generation scriptcontext based counter
This commit is contained in:
koennecke
2009-02-13 09:00:03 +00:00
parent a3dcad2bfa
commit 91d4af0541
405 changed files with 88101 additions and 88173 deletions

View File

@ -34,29 +34,31 @@
functions for any further work. A lot of information about the detector
is required for this transformation which is held in the datastruture
as defined below
----------------------------------------------------------------------*/
----------------------------------------------------------------------*/
typedef struct{
double xScale; /* scale factor pixel --> mm for x */
double yScale; /* scale factor pixel --> mm for y */
double distance; /* distance sample detector in mm */
double gamma; /* gamma == two theta position of the detector */
double nu; /* tilt angle of the detector */
int xZero; /* x pixel coordinate of the zero point of the detector */
int yZero; /* y pixel coordinate of the zero point of the detector */
typedef struct {
double xScale; /* scale factor pixel --> mm for x */
double yScale; /* scale factor pixel --> mm for y */
double distance; /* distance sample detector in mm */
double gamma; /* gamma == two theta position of the detector */
double nu; /* tilt angle of the detector */
int xZero; /* x pixel coordinate of the zero point of the detector */
int yZero; /* y pixel coordinate of the zero point of the detector */
} psdDescription;
/**
* det2pol converts the pixel coordinates x and y on the detector described
* by psd to polar coordinates gamma and nu.
*/
void det2pol(psdDescription *psd, int x, int y, double *gamma, double *nu);
void det2pol(psdDescription * psd, int x, int y, double *gamma,
double *nu);
/**
* pol2det converts the polar coordinates gamma and nu to detector coordinates
* x and y on the detector described psd
*/
void pol2det(psdDescription *psd, double gamma, double nu, int *x, int *y);
void pol2det(psdDescription * psd, double gamma, double nu, int *x,
int *y);
/*------------------------------------------------------------------------
calculation of four circle diffractometer angles stt, om, chi and phi
@ -75,26 +77,26 @@ void pol2det(psdDescription *psd, double gamma, double nu, int *x, int *y);
* were invalid. The m version acts upon a matrix.
*/
int z1ToBisecting(double lambda, double z1[3], double *stt, double *om,
double *chi, double *phi);
double *chi, double *phi);
int z1mToBisecting(double lambda, MATRIX z1, double *stt, double *om,
double *chi, double *phi);
double *chi, double *phi);
/**
* calculates diffraction angles to put z1 into a detector with a given
* offset in omega against the bisecting position. Useful for tweaking
* if omega is restricted.
*/
int z1ToAnglesWithOffset(double lambda, MATRIX z1,double omOffset,
double *stt, double *om,
int z1ToAnglesWithOffset(double lambda, MATRIX z1, double omOffset,
double *stt, double *om,
double *chi, double *phi);
/**
* calculates a PSI for a given offset in omega from the bisecting
* position. This can be useful for tweaking reflections to be
* measurable at omega restricted diffractometers.
*/
int psiForOmegaOffset(MATRIX z1, double omOffset,
double chi, double phi, double *psi);
*/
int psiForOmegaOffset(MATRIX z1, double omOffset,
double chi, double phi, double *psi);
/**
* calculate new setting angles for a psi rotation. Input are the angles
@ -110,8 +112,8 @@ void rotatePsi(double om, double chi, double phi, double psi,
* a bissecting position, however it is required that the angles describe a
* reflection measured in the horizontal plane.
*/
void z1FromAngles(double lambda, double stt, double om,
double chi, double phi, double z1[3]);
void z1FromAngles(double lambda, double stt, double om,
double chi, double phi, double z1[3]);
/*-----------------------------------------------------------------------
Normal beam calculations. Here the diffraction vector is expressed as
polar angles gamma and nu and omega.
@ -121,24 +123,25 @@ void z1FromAngles(double lambda, double stt, double om,
* circle angles twotheta, omega, chi and phi.
*/
int bisToNormalBeam(double twotheta, double omega, double chi, double phi,
double *omeganb, double *gamma, double *nu);
double *omeganb, double *gamma, double *nu);
/**
* calculate normal beam angles from z1
*/
int z1mToNormalBeam(double lambda, MATRIX z1, double *gamma, double *om, double *nu);
int z1mToNormalBeam(double lambda, MATRIX z1, double *gamma, double *om,
double *nu);
/**
* calculate the vector z1 from the normal beam angles omega, gamma and nu.
* chi and phi either do not exist or are 0.
*/
void z1FromNormalBeam(double lambda, double omega, double gamma,
double nu, double z1[3]);
void z1FromNormalBeam(double lambda, double omega, double gamma,
double nu, double z1[3]);
/**
* calculate z1 from four circle angles plus gamma, nu
*/
void z1FromAllAngles(double lambda, double omega, double gamma,
double nu, double chi, double phi, double z1[3]);
void z1FromAllAngles(double lambda, double omega, double gamma,
double nu, double chi, double phi, double z1[3]);
/*------------------------------------------------------------------------
Utility
-------------------------------------------------------------------------*/
@ -186,17 +189,9 @@ int calcTheta(double lambda, MATRIX z1, double *d, double *theta);
* @param userData A user specified pointer to some data which may be needed
* in testing the range.
* @return 0 on failure, 1 on success.
*/
typedef int (*inRange)(void *userData, double dSet[4], int mask[4]);
int findAllowedBisecting(double lambda, MATRIX z1, double fSet[4],
inRange testFunc, void *userData);
#endif
*/
typedef int (*inRange) (void *userData, double dSet[4], int mask[4]);
int findAllowedBisecting(double lambda, MATRIX z1, double fSet[4],
inRange testFunc, void *userData);
#endif