Changeset 42176 for branches/eam_branches/ipp-20220316
- Timestamp:
- Apr 27, 2022, 6:45:48 AM (4 years ago)
- Location:
- branches/eam_branches/ipp-20220316/fpcamera/src
- Files:
-
- 5 edited
-
Makefile.am (modified) (1 diff)
-
fpcamera.c (modified) (1 diff)
-
fpcamera.h (modified) (4 diffs)
-
fpcameraErrorCodes.h (modified) (1 diff)
-
fpcameraVersion.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/fpcamera/src/Makefile.am
r42175 r42176 1 1 2 bin_PROGRAMS = psastro2 bin_PROGRAMS = fpcamera 3 3 4 4 noinst_HEADERS = fpcamera.h fpcameraErrorCodes.h -
branches/eam_branches/ipp-20220316/fpcamera/src/fpcamera.c
r42175 r42176 61 61 psLogMsg("fpcamera", 3, "complete fpcamera run: %f sec\n", psTimerMark ("complete")); 62 62 63 fpcameraCleanup(config );63 fpcameraCleanup(config, stats); 64 64 exit(PS_EXIT_SUCCESS); 65 65 } -
branches/eam_branches/ipp-20220316/fpcamera/src/fpcamera.h
r42175 r42176 1 /** @file psastro.h1 /** @file fpcamera.h 2 2 * 3 3 * @brief This file defines the library functions available to external … … 7 7 * psphot functions. 8 8 * 9 * @ingroup psastro9 * @ingroup fpcamera 10 10 * 11 11 * @author IfA … … 15 15 */ 16 16 17 # ifndef PSASTRO_H18 # define PSASTRO_H17 # ifndef FPCAMERA_H 18 # define FPCAMERA_H 19 19 20 # include "psastroErrorCodes.h" 20 #include <stdio.h> 21 #include <string.h> 22 #include <pslib.h> 23 #include <psmodules.h> 24 #include <ppStats.h> 25 #include "fpcameraErrorCodes.h" 21 26 22 /// @addtogroup psastro27 /// @addtogroup fpcamera 23 28 /// @{ 24 29 25 # define PSASTRO_RECIPE "PSASTRO" ///< Name of the recipe to use30 # define FPCAMERA_RECIPE "FPCAMERA" ///< Name of the recipe to use 26 31 27 32 # define psMemCopy(A)(psMemIncrRefCounter((A))) … … 30 35 # define SIGN(X) (((X) == 0) ? 0 : ((fabs((double)(X))) / (X))) 31 36 32 #if 0 33 /** 34 * this structure represents a fit to the logN / logS curve for a set of stars 35 * logN = offset + slope * logS 36 */ 37 typedef struct { 38 double mMin; ///< minimum magnitude bin with data 39 double mMax; ///< maximum magnitude bin with data 40 double offset; ///< fitted line offset 41 double slope; ///< fitted line slope 42 double mPeak; ///< mag of peak bin 43 int nPeak; ///< # of stars in peak bin 44 int sPeak; ///< sum of stars to peak bin 45 } pmLumFunc; 46 #endif 37 pmConfig *fpcameraArguments (int argc, char **argv); 38 bool fpcameraParseCamera (pmConfig *config); 39 bool fpcameraDataLoad (pmConfig *config); 40 bool fpcameraAnalysis (pmConfig *config, psMetadata *stats); 41 bool fpcameraDataSave (pmConfig *config, psMetadata *stats); 47 42 48 /** 49 * this structure defines the parameters to describe a ghost 50 */ 51 typedef struct { 52 psPlane *srcFP; ///< location in FPA coords of the source star 53 psPlane *FP; ///< location in FPA coords of the ghost center 54 psPlane *chip; ///< location in chip coords of the ghost center 55 double Mag; ///< instrumental magnitude of source star 56 psEllipseAxes inner; ///< inner elliptical annulus boundary 57 psEllipseAxes outer; ///< outer elliptical annulus boundary 58 } psastroGhost; 43 void fpcameraCleanup (pmConfig *config, psMetadata *stats); 59 44 60 psastroGhost *psastroGhostAlloc (void);61 bool psastroLoadGhosts (pmConfig *config);45 bool fpcameraDefineFiles (pmConfig *config, pmFPAfile *input); 46 bool fpcameraDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType); 62 47 63 bool psastroDataSave (pmConfig *config, psMetadata *stats); 64 bool psastroDefineFiles (pmConfig *config, pmFPAfile *input); 65 bool psastroDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType); 66 bool psastroAnalysis (pmConfig *config, psMetadata *stats); 67 68 bool psastroConvertFPA (pmConfig *config, pmFPA *fpa, psMetadata *recipe); 69 bool psastroConvertReadout (pmConfig *config, pmFPAview *view, pmReadout *readout, psMetadata *recipe); 70 bool psastroCorrectKH (pmConfig *config, pmFPAview *view, pmReadout *readout, psMetadata *recipe, psArray *inStars); 71 72 psArray *pmSourceToAstromObj (psArray *sources, float MagOffset); 73 bool psastroAstromGuess (int *nStars, pmConfig *config); 74 bool psastroAstromGuessCheck (pmConfig *config); 75 bool psastroMaskUpdates (pmConfig *config, psMetadata *stats); 76 77 bool psastroLoadGlints (pmConfig *config); 78 bool psastroChooseGlintStars (pmConfig *config, psArray *refs, const char *source); 79 80 bool psastroLoadCrosstalk (pmConfig *config); 81 82 psArray *psastroLoadRefstars (pmConfig *config, const char *source); 83 bool psastroChipAstrom (pmConfig *config); 84 bool psastroOneChip (pmFPA *fpa, pmChip *chip, psArray *refset, psArray *rawset, psMetadata *recipe, psMetadata *updates); 85 bool psastroOneChipGrid (pmFPA *fpa, pmChip *chip, psArray *refset, psArray *rawset, psMetadata *recipe, psMetadata *updates); 86 bool psastroOneChipFit (pmFPA *fpa, pmChip *chip, pmReadout *readout, psArray *refset, psArray *rawset, psMetadata *recipe, psMetadata *updates); 87 bool psastroChooseRefstars (pmConfig *config, psArray *refs, const char *source, bool saveExistingMatchedRefs); 88 bool psastroRefstarSubset (pmReadout *readout); 89 pmLumFunc *psastroLuminosityFunction (psArray *stars, pmLumFunc *rawFunc); 90 bool psastroLuminosityFunctionPlot(psVector *lnMag, psVector *Mag, pmLumFunc *lumFunc, pmLumFunc *rawFunc); 91 psArray *psastroRemoveClumps (psArray *input, int scale); 92 psArray *psastroRemoveClumpsIterate (psArray *input, int scale, int nIter); 93 bool psastroRemoveClumpsRawstars (pmConfig *config); 94 95 bool psastroChipFailureHeader (psMetadata *updates); 96 97 98 // utility functions: 99 bool psastroUpdateChipToFPA (pmFPA *fpa, pmChip *chip); 100 bool psastroWriteStars (char *filename, psArray *sources); 101 bool psastroWriteTransform (psPlaneTransform *map); 102 103 // mosaic fitting functions 104 bool psastroMosaicDistortion (pmFPA *fpa, psMetadata *recipe, int pass); 105 psPlaneTransform *psastroMosaicFitRotAndScale (pmFPA *fpa); 106 bool psastroMosaicApplyRotAndScale (pmFPA *fpa, psPlaneTransform *TPtoFP); 107 bool psastroMosaicDistortionFromGradients (pmFPA *fpa, psMetadata *recipe); 108 bool psastroMosaicCorrectDistortion (pmFPA *fpa, psPlaneTransform *TPtoFP); 109 bool psastroMosaicCommonScale (pmFPA *fpa, psMetadata *recipe); 110 bool psastroMosaicAstrom (pmConfig *config, psMetadata *stats); 111 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *stats, psMetadata *recipe, int iteration); 112 bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe, int iteration); 113 bool psastroMosaicSetAstrom (pmFPA *fpa); 114 bool psastroMosaicHeaders (pmConfig *config); 115 bool psastroMosaicRescaleChips (pmFPA *fpa); 116 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, int iteration); 48 bool fpcameraLoadRefstars (pmFPAfile *input, pmConfig *config); 49 bool fpcameraReadAstrometry (pmFPAfile *input, pmConfig *config); 117 50 118 51 // Return version strings. 119 psString psastroVersion(void);120 psString psastroSource(void);121 psString psastroVersionLong(void);122 bool psastroVersionHeader(psMetadata *header);123 bool psastroVersionHeaderFull(psMetadata *header);124 void psastroVersionPrint(void);52 psString fpcameraVersion(void); 53 psString fpcameraSource(void); 54 psString fpcameraVersionLong(void); 55 bool fpcameraVersionHeader(psMetadata *header); 56 bool fpcameraVersionHeaderFull(psMetadata *header); 57 void fpcameraVersionPrint(void); 125 58 126 // demo plots 127 bool psastroPlotRawstars (psArray *rawstars, pmFPA *fpa, pmChip *chip, psMetadata *recipe); 128 bool psastroPlotRefstars (psArray *refstars, psMetadata *recipe); 129 bool psastroPlotOneChipFit (psArray *rawstars, psArray *refstars, psArray *match, psMetadata *recipe); 59 psArray *fpcameraReadGetstarCatalog (psFits *fits); 60 psArray *fpcameraReadGetstar_PS1_DEV_0 (psFits *fits); 130 61 131 bool psastroDumpRawstars (psArray *rawstars, pmFPA *fpa, pmChip *chip); 132 bool psastroDumpRefstars (psArray *refstars, char *filename); 133 bool psastroDumpMatches (pmFPA *fpa, char *filename); 134 bool psastroDumpStars (psArray *stars, char *filename); 135 bool psastroDumpMatchedStars (char *filename, psArray *rawstars, psArray *refstars, psArray *match); 136 bool psastroDumpGradients (psArray *gradients, char *filename); 62 bool fpcameraMetadataStats (pmConfig *config, psMetadata *stats); 137 63 138 bool psastroMosaicSetAstrom_tmp (pmFPA *fpa); 139 int psastroSortByMag (const void *a, const void *b); 140 141 bool psastroFixChips (pmConfig *config, psMetadata *recipe); 142 bool psastroFixChipsTest (pmConfig *config, psMetadata *recipe); 143 bool psastroUseModel (pmConfig *config, psMetadata *recipe); 144 bool psastroDumpCorners (char *filenameU, char *filenameD, pmFPA *fpa); 145 146 char *psastroSetMagLimit (float *minMag, float *maxRho, pmConfig *config, const char *source); 147 148 psArray *psastroReadGetstarCatalog (psFits *fits); 149 psArray *psastroReadGetstar_PS1_DEV_0 (psFits *fits); 150 151 bool psastroAstromGuessSetChip (pmFPA *fpa, pmChip *chip, const pmFPAview *view, double pixelScale, bool bilevelAstrometry); 152 bool psastroAstromGuessSetFPA (pmFPA *fpa, bool *bilevelAstrometry); 153 bool psastroMetadataStats (pmConfig *config, psMetadata *stats); 154 155 bool psastroZeroPoint (pmConfig *config); 156 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime, float refminMag, float refmaxMag); 157 bool psastroZeroPointAnalysis (psMetadata *header, psVector *dMag, float zeropt, psMetadata *recipe); 158 bool psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, double *glintMaxMag, pmFPA *fpa, psMetadata *recipe); 159 bool psastroZeroPointRefMagLimitFromRecipe (float *refminMag, float *refmaxMag, pmFPA *fpa, psMetadata *recipe); 160 161 psStats *psastroStatsPercentile (psVector *myVector, psMetadata *recipe); 162 float psastroStatsPercentileValue (psHistogram *histogram, psHistogram *cumulative, psVector *myVector, float flimit); 163 164 // masking functions 165 pmCell *pmCellInChip (pmChip *chip, float x, float y); 166 bool pmCellCoordsForChip (float *xCell, float *yCell, pmCell *cell, float xChip, float yChip); 167 bool pmChipCoordsForCell (float *xChip, float *yChip, pmCell *cell, float xCell, float yCell); 168 169 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY); 170 bool psastroMaskEllipse (psImage *mask, psImageMaskType value, float x0, float y0, psEllipseAxes axes); 171 bool psastroMaskEllipticalAnnulus (psImage *mask, psImageMaskType value, float x0, float y0, psEllipseAxes eInner, psEllipseAxes eOuter); 172 173 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta); 174 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW); 175 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords); 176 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1); 177 178 pmChip *psastroFindChip (double *xChip, double *yChip, pmFPA *fpa, double xFPA, double yFPA); 179 bool psastroChipBounds (pmFPA *fpa); 180 bool psastroFindChipInXrange (pmFPA *fpa, int nChip, double xFPA, double yFPA); 181 bool psastroFindChipInYrange (pmFPA *fpa, int nChip, double xFPA, double yFPA); 182 bool psastroFindChipYedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip); 183 bool psastroFindChipXedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip); 184 bool psastroFPAtoChip (double *xChip, double *yChip, pmFPA *fpa, int nChip, double xFPA, double yFPA); 185 186 //bool psastroMaskStats(pmConfig *config, psMetadata *stats); 187 188 // psastroExtract functions 189 bool psastroExtractAnalysis (pmConfig *config); 190 bool psastroExtractStars (pmConfig *config); 191 bool psastroExtractGhosts (pmConfig *config); 192 193 psImage *psastroExtractStar (psImage *input, double x, double y, double dX, double dY); 194 bool psastroExtractParseCamera (pmConfig *config); 195 bool psastroExtractDataLoad (pmConfig *config); 196 pmConfig *psastroExtractArguments (int argc, char **argv); 197 bool psastroExtractFreeChipBounds(void); 198 199 bool psastroGalaxyShapeErrors (psMetadata *recipe, pmReadout *readout); 64 pmChip *fpcameraFindChip (double *xChip, double *yChip, pmFPA *fpa, double xFPA, double yFPA); 65 bool fpcameraChipBounds (pmFPA *fpa); 66 bool fpcameraFindChipInXrange (pmFPA *fpa, int nChip, double xFPA, double yFPA); 67 bool fpcameraFindChipInYrange (pmFPA *fpa, int nChip, double xFPA, double yFPA); 68 bool fpcameraFindChipYedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip); 69 bool fpcameraFindChipXedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip); 70 bool fpcameraFPAtoChip (double *xChip, double *yChip, pmFPA *fpa, int nChip, double xFPA, double yFPA); 200 71 201 72 ///@} 202 # endif /* PSASTRO_H */73 # endif /* FPCAMERA_H */ -
branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraErrorCodes.h
r42175 r42176 21 21 */ 22 22 typedef enum { 23 FPCAMERA_ERR_BASE = 8000,23 FPCAMERA_ERR_BASE = 4500, 24 24 FPCAMERA_ERR_UNKNOWN, 25 25 FPCAMERA_ERR_NOT_IMPLEMENTED, -
branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraVersion.c
r42175 r42176 8 8 */ 9 9 10 #include "fpcamera Internal.h"10 #include "fpcamera.h" 11 11 #include "fpcameraVersionDefinitions.h" 12 12
Note:
See TracChangeset
for help on using the changeset viewer.
