Cleaned up ANSTO code to merge with sinqdev.sics

This is our new RELEASE-4_0 branch which was taken from ansto/93d9a7c
Conflicts:
	.gitignore
	SICSmain.c
	asynnet.c
	confvirtualmot.c
	counter.c
	devexec.c
	drive.c
	event.h
	exebuf.c
	exeman.c
	histmem.c
	interface.h
	motor.c
	motorlist.c
	motorsec.c
	multicounter.c
	napi.c
	napi.h
	napi4.c
	network.c
	nwatch.c
	nxscript.c
	nxxml.c
	nxxml.h
	ofac.c
	reflist.c
	scan.c
	sicshipadaba.c
	sicsobj.c
	site_ansto/docs/Copyright.txt
	site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl
	site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl
	statusfile.c
	tasdrive.c
	tasub.c
	tasub.h
	tasublib.c
	tasublib.h
This commit is contained in:
Ferdi Franceschini
2015-04-23 20:49:26 +10:00
parent c650788a2c
commit 10d29d597c
1336 changed files with 9430 additions and 226646 deletions

View File

@@ -22,9 +22,6 @@
#define KICONST 1
#define KFCONST 2
#define ELASTIC 3
/*========================== defines for focusfn ====================*/
#define ENERGY_FN 1
#define THETA_FN 2
/*
* in elastic mode A5, A5 will be disregarded and ki = kf at all times
*/
@@ -45,8 +42,8 @@
typedef struct {
double dd; /* lattice spacing */
int ss; /* scattering sense */
double HB1, HB2, HB3; /* horizontal curvature parameters */
double VB1, VB2; /* vertical curvature parameters */
double HB1, HB2; /* horizontal curvature parameters */
double VB1, VB2; /* vertical curvature parameters */
} maCrystal, *pmaCrystal;
/**
* the machine parameters of a triple axis spectrometer
@@ -112,14 +109,14 @@ int maCalcTwoTheta(maCrystal data, double k, double *two_theta);
* @param two_theta The tow theta value for which to calculate the curvature.
* @return A new value for the curvature.
*/
double maCalcVerticalCurvature(maCrystal data, double two_theta, double energy, int focusfn);
double maCalcVerticalCurvature(maCrystal data, double two_theta);
/**
* calculate the value for the horizontal curvature
* @param data The input crystal parameters
* @param two_theta The tow theta value for which to calculate the curvature.
* @return A new value for the curvature.
*/
double maCalcHorizontalCurvature(maCrystal data, double two_theta, double energy, int focusfn);
double maCalcHorizontalCurvature(maCrystal data, double two_theta);
/**
* calculate the value of the K vector from the angle
* @param data The crystals constants
@@ -189,21 +186,33 @@ MATRIX calcTasUBFromTwoReflections(lattice cell, tasReflection r1,
*/
MATRIX calcTestNormal(double sgu, double sgl);
/**
* calculate a test UB
* @param cell The lattice constant of the crystal
* calculate a test UB from angles
* @param cell The B lattice constants
* @param om A theoretical om for the crystal
* @param sgu A theoretical plane tilt on upper
* @param sgl A theoretical plane tilt on lower
* @return a UB matix on sucess, or NULL on failure. This can only happen
* @return a UB matrix on sucess, or NULL on failure. This can only happen
* when out of memory or with a bad cell
*/
MATRIX calcTestUB(lattice cell, double om, double sgu, double sgl);
/**
* calculate a test UB
* @param B The B matrix as calculated from the cell constants
* @param om A theoretical om for the crystal
* @param sgu A theoretical plane tilt on upper
* @param sgl A theoretical plane tilt on lower
* @return a UB matrix on sucess, or NULL on failure. This can only happen
* when out of memory or with a bad cell
*/
MATRIX calcUBFromAngles(MATRIX B, double om, double sgu, double sgl);
/**
* calcluate the normal to the plane describe by the two reflections r1, r2
* @param r1 first reflection
* @param r2 second reflection
* @return a plane normal on success, NULL else
*/
MATRIX calcPlaneNormal(tasReflection r1, tasReflection r2);
/**
* calcluate the normal to the plane describe by the two reflections r1, r2