00001
00002
00003
00004
00005
00006
00007
00008 #ifndef MODEL_H_
00009 #define MODEL_H_
00010
00011 #include "MapDepthMatrix.h"
00012 #include "FITSParameters.h"
00013 #include "BaseDirectory.h"
00014
00018 typedef struct {
00019 MAP_DEPTH_MATRIX w;
00020 MAP_DEPTH_MATRIX q;
00021 MAP_DEPTH_MATRIX AvgKern;
00022 MAP_DEPTH_MATRIX noise;
00023 MAP_DEPTH_MATRIX dTilde;
00024 MAP_DEPTH_MATRIX bFull;
00025 MATRIX kxGridValues;
00026 MATRIX kyGridValues;
00027 bool kxkyDone;
00028 MATRIX lambdaGridValues;
00029
00030 bool convergence;
00031 bool noMaps;
00032
00033 bool xt;
00034
00035 MATRIX bVECTORS;
00036 MATRIX A1d;
00037 MATRIX Cov1d;
00038
00039 Float mu;
00040 Float sigma;
00041 Float nu;
00042 FITSParameters parms;
00043 } Model;
00044
00045 void initializeModel(Model *model, int X, int Y, int M, int Z);
00046
00047 void initializeOutputModel(Model *model, MAP_DEPTH_MATRIX kernelTdm);
00048
00049 void initializeForwardOutputModel(Model *model, MAP_DEPTH_MATRIX kernelTdm);
00050
00051 void initializeCalcQOutputModel(Model *model, MAP_DEPTH_MATRIX w);
00052
00053 void useNoMaps(Model *model);
00054
00055 void setParameters(Model *model, Float mu, Float sigma);
00056
00057 void setParameters2(Model *model, Float *values, int nValues);
00058
00059 void clearParameters(Model *model);
00060
00061 void saveW(Model *model, MATRIX w, int kx, int ky);
00062
00063 void saveB(Model *model, MATRIX b, int nStep);
00064
00065 void saveGridValues(Model *m, int r, int c, Float kx, Float ky, Float lambda);
00066
00067 void calculateQValues(Model *model, MAP_DEPTH_MATRIX tau, bool DValueShift);
00068
00069 void calculateDerivedValues(Model *model, MAP_DEPTH_MATRIX K, MAP_DEPTH_MATRIX tau, MAP_DEPTH_MATRIX Lambda,
00070 bool DValueShift);
00071
00072 void calculateDerivedValuesNoQ(Model *model, MAP_DEPTH_MATRIX K, MAP_DEPTH_MATRIX Lambda,
00073 bool DValueShift);
00074
00075 void writeQ(Model *model, BaseDirectory *baseName);
00076
00077 void writeW(Model *model, BaseDirectory *baseName);
00078
00079 void writeAvgKern(Model *model, BaseDirectory *baseName);
00080
00081 void writeBVectors1d(Model *model, BaseDirectory *baseName);
00082
00083 void writeAVectors1d(Model *model, BaseDirectory *baseName, Float lambda);
00084
00085 void writeCovVectors1d(Model *model, BaseDirectory *baseName, Float lambda);
00086
00087 void writeNoise(Model *model, BaseDirectory *baseName);
00088
00089 void writeDTildaValues3d(Model *model, BaseDirectory *baseName, bool useFT);
00090
00091 void writeAvgKernValues3d(Model *model, BaseDirectory *baseName);
00092
00093 void writeGridValues3d(Model *model, BaseDirectory *baseName);
00094
00095 void writeBVectors3d(Model *model, BaseDirectory *baseName);
00096
00097 void freeModel(Model *model);
00098
00099 #endif