00001
00002
00003
00004
00005
00006
00007
00008 #ifndef MAPDEPTHMATRIX_H_
00009 #define MAPDEPTHMATRIX_H_
00010
00011 #include <complex.h>
00012 #include "objectfits.h"
00013 #include "matrix.h"
00014
00032 typedef struct {
00033 double complex *data;
00034 int nX;
00035 int nY;
00036 int nZ;
00037 int nT;
00038 int nV;
00039 MatrixType mtype;
00040 int shift;
00041 BOOLEAN invariant;
00042 } MAP_DEPTH_MATRIX;
00043
00048 enum DataSpace {REAL_SPACE, WAVE_SPACE};
00049
00050 #endif
00051
00052 MAP_DEPTH_MATRIX newMapDepthMatrix(int x, int y, int z, int t, int shift);
00053 MAP_DEPTH_MATRIX newMapDepthMatrixV(int x, int y, int z, int t, int v, int shift);
00054
00055 void destroyMapDepthMatrix(MAP_DEPTH_MATRIX td);
00056
00057 BOOLEAN isEmptyMapDepthMatrix(const MAP_DEPTH_MATRIX *td);
00058
00059 MATRIX extractMapDepth(int kx, int ky, MAP_DEPTH_MATRIX td);
00060
00061 void insertMapDepth(int kx, int ky, MATRIX m, MAP_DEPTH_MATRIX *td);
00062
00063 MATRIX extractXYPlaneFromMapDepthMatrix(int map, int depth, MAP_DEPTH_MATRIX td);
00064 MATRIX extractXYPlaneFromMapDepthMatrixV(int map, int depth, int v, MAP_DEPTH_MATRIX td);
00065
00066 void insertXYPlaneIntoMapDepthMatrix(MATRIX xyPlane, int map, int depth, MAP_DEPTH_MATRIX *td);
00067 void insertXYPlaneIntoMapDepthMatrixV(MATRIX xyPlane, int map, int depth, int v, MAP_DEPTH_MATRIX *td);
00068
00069 MATRIX extractXYPlaneColMajorMapDepthMatrix(int map, int depth, const MAP_DEPTH_MATRIX *td);
00070 MATRIX extractXYPlaneColMajorMapDepthMatrixV(int map, int depth, int v, const MAP_DEPTH_MATRIX *tdptr);
00071 void insertXYPlaneColMajorMapDepthMatrix(MATRIX xyPlane, int map, int depth, MAP_DEPTH_MATRIX *tdptr);
00072 void insertXYPlaneColMajorMapDepthMatrixV(MATRIX xyPlane, int map, int depth, int v, MAP_DEPTH_MATRIX *tdptr);
00073
00074 MAP_DEPTH_MATRIX readMapDepthMatrix(char *basedir, char *filenames[], int nFiles, int useFT);
00075 MAP_DEPTH_MATRIX readMapDepthMatrixKernel(char *basedir, char *filenames[], int nFiles, int useFT);
00076 MAP_DEPTH_MATRIX readMapDepthMatrixV(char *basedir, char *filenames[], int nFiles, int vdim, int useFT);
00077 MAP_DEPTH_MATRIX readMapDepthMatrixFromOneFile(char *filename, int useFT);
00078 MAP_DEPTH_MATRIX readMapDepthMatrixFromOneFileS(char *filename, int useFT, BOOLEAN shiftOnInput, BOOLEAN shiftOnOutput);
00079 MAP_DEPTH_MATRIX readMapDepthMatrixForTarget(char *filename, int useFT);
00080
00081 void writeMapDepthMatrix(char *filenames[], int nFiles, MAP_DEPTH_MATRIX tdm,
00082 int useFT, FITSParameters headerParameters);
00083
00084 void writeDepthMapMatrix(char *filenames[], int nFiles, MAP_DEPTH_MATRIX tdm, int useFT, double lambda);
00085
00086 void writeAvgKernelMatrix(char *filenames[], int nFiles, MAP_DEPTH_MATRIX tdm, int useFT, double lambda);
00087
00088 void writeMapDepthMatrixToOneFile(char *filename, MAP_DEPTH_MATRIX tdm,
00089 int useFT, FITSParameters headerParameters);
00090
00091 MAP_DEPTH_MATRIX inverseMapDepth(MAP_DEPTH_MATRIX tdm);
00092
00093 MAP_DEPTH_MATRIX convertMapDepth(const MAP_DEPTH_MATRIX *tdm, enum matrixOrder order);
00094 MAP_DEPTH_MATRIX convertMapDepthSpace(const MAP_DEPTH_MATRIX *tdm, enum DataSpace toSpace);
00095
00096 void TdmMultiplyScalarTakeConjugate(MAP_DEPTH_MATRIX *tdmPtr, double scalar);
00097 void TdmMultiplyScalar(MAP_DEPTH_MATRIX *tdmPtr, double scalar);
00098
00099 void MdmMultiplyMatrix(MAP_DEPTH_MATRIX *tdmPtr, MATRIX theta);
00100
00101 void ZeroK0(MAP_DEPTH_MATRIX *tdmPtr);
00102
00103 MAP_DEPTH_MATRIX TdmCopy(MAP_DEPTH_MATRIX tdm);
00104
00105 void pack(const MAP_DEPTH_MATRIX *w_n, MATRIX *x, const MAP_DEPTH_MATRIX *mask);
00106 void unpack(MATRIX *x, const MAP_DEPTH_MATRIX *mask, MAP_DEPTH_MATRIX *w);
00107
00108 MATRIX TdmFlatten(MAP_DEPTH_MATRIX tdm);
00109 void TdmRebuild(MATRIX m, MAP_DEPTH_MATRIX *tdm);
00110
00111 MAP_DEPTH_MATRIX XYTransposeMapDepthMatrix(const MAP_DEPTH_MATRIX *K);