#ifndef GLOBALS_H #define GLOBALS_H #include #include #include #include "PerformanceData.h" #include using namespace std; typedef float rtsFloat; struct SpecPair { double nu; double A; }; struct Material { vector nu; vector > eta; bool validN; bool validK; string name; }; enum SpecType {AbsorbanceSpecType, IntensitySpecType}; enum OpticsType {TransmissionOpticsType, ReflectionOpticsType}; extern PerformanceData PD; extern vector > RefSpectrum; extern int currentSpec; extern vector SimSpectrum; //IO Functions vector LoadSpectrum(string filename); vector SetReferenceSpectrum(char* text); void SaveState(); void LoadState(); void SetDefaults(); void SaveSimulation(string fileName); //void SaveK(string fileName); void SaveMaterial(string fileName); //void LoadMaterial(string fileNameK, string fileNameN, string materialName); void LoadMaterial(string fileName, string materialName); //Display Functions void FitDisplay(); //Update Functions void UpdateDisplay(); void SimulateSpectrum(); void cudaKramersKronig(double* cpuN, double* cpuK, int nVals, double nuStart, double nuEnd, double nOffset); void cudaComputeSpectrum(double* cpuI, double* cpuB, double* alpha, int Nl, int nLambda, double oThetaI, double oThetaO, double cThetaI, double cThetaO, int nSamples); //Window Parameters extern double nuMin; //wavenumbers extern double nuMax; extern double aMin; //absorbance extern double aMax; extern double dNu; extern double nMag; //largest magnitude for n extern double kMax; //highest extinction coefficient extern bool dispRefSpec; extern bool dispSimSpec; extern bool dispSimK; extern bool dispMatK; extern bool dispSimN; extern bool dispMatN; extern SpecType dispSimType; extern bool dispNormalize; extern double dispNormFactor; extern double dispScaleK; extern double dispScaleN; //material parameters extern double radius; extern double baseIR; extern double cA; extern vector EtaK; extern vector EtaN; extern bool applyMaterial; extern vector MaterialList; extern int currentMaterial; void ChangeAbsorbance(); void SetMaterial(); //source parameters extern vector SourceSpectrum; extern vector SourceResampled; void ResampleSource(); //resample a source profile to match the sample points of the current material extern bool useSourceSpectrum; //optical parameters extern double cNAi; extern double cNAo; extern double oNAi; extern double oNAo; extern OpticsType opticsMode; extern bool pointDetector; extern int objectiveSamples; //fitting parameters extern double minMSE; extern int maxFitIter; void EstimateMaterial(); extern double scaleI0; extern double refSlope; //distortion maps double ComputeDistortion(); void DistortionMap(float* distortionMap, int nSteps); #endif