IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 27, 2022, 6:45:48 AM (4 years ago)
Author:
eugene
Message:

working on compilation

Location:
branches/eam_branches/ipp-20220316/fpcamera/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20220316/fpcamera/src/Makefile.am

    r42175 r42176  
    11
    2 bin_PROGRAMS = psastro
     2bin_PROGRAMS = fpcamera
    33
    44noinst_HEADERS = fpcamera.h fpcameraErrorCodes.h
  • branches/eam_branches/ipp-20220316/fpcamera/src/fpcamera.c

    r42175 r42176  
    6161    psLogMsg("fpcamera", 3, "complete fpcamera run: %f sec\n", psTimerMark ("complete"));
    6262
    63     fpcameraCleanup(config);
     63    fpcameraCleanup(config, stats);
    6464    exit(PS_EXIT_SUCCESS);
    6565}
  • branches/eam_branches/ipp-20220316/fpcamera/src/fpcamera.h

    r42175 r42176  
    1 /** @file psastro.h
     1/** @file fpcamera.h
    22 *
    33 *  @brief This file defines the library functions available to external
     
    77 *  psphot functions.
    88 *
    9  *  @ingroup psastro
     9 *  @ingroup fpcamera
    1010 *
    1111 *  @author IfA
     
    1515 */
    1616
    17 # ifndef PSASTRO_H
    18 # define PSASTRO_H
     17# ifndef FPCAMERA_H
     18# define FPCAMERA_H
    1919
    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"
    2126
    22 /// @addtogroup psastro
     27/// @addtogroup fpcamera
    2328/// @{
    2429
    25 # define PSASTRO_RECIPE "PSASTRO" ///< Name of the recipe to use
     30# define FPCAMERA_RECIPE "FPCAMERA" ///< Name of the recipe to use
    2631
    2732# define psMemCopy(A)(psMemIncrRefCounter((A)))
     
    3035# define SIGN(X)  (((X) == 0) ? 0 : ((fabs((double)(X))) / (X)))
    3136
    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
     37pmConfig         *fpcameraArguments (int argc, char **argv);
     38bool              fpcameraParseCamera (pmConfig *config);
     39bool              fpcameraDataLoad (pmConfig *config);
     40bool              fpcameraAnalysis (pmConfig *config, psMetadata *stats);
     41bool              fpcameraDataSave (pmConfig *config, psMetadata *stats);
    4742
    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;
     43void              fpcameraCleanup (pmConfig *config, psMetadata *stats);
    5944
    60 psastroGhost     *psastroGhostAlloc (void);
    61 bool              psastroLoadGhosts (pmConfig *config);
     45bool              fpcameraDefineFiles (pmConfig *config, pmFPAfile *input);
     46bool              fpcameraDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType);
    6247
    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);
     48bool              fpcameraLoadRefstars (pmFPAfile *input, pmConfig *config);
     49bool              fpcameraReadAstrometry (pmFPAfile *input, pmConfig *config);
    11750
    11851// 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);
     52psString          fpcameraVersion(void);
     53psString          fpcameraSource(void);
     54psString          fpcameraVersionLong(void);
     55bool              fpcameraVersionHeader(psMetadata *header);
     56bool              fpcameraVersionHeaderFull(psMetadata *header);
     57void              fpcameraVersionPrint(void);
    12558
    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);
     59psArray          *fpcameraReadGetstarCatalog (psFits *fits);
     60psArray          *fpcameraReadGetstar_PS1_DEV_0 (psFits *fits);
    13061
    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);
     62bool              fpcameraMetadataStats (pmConfig *config, psMetadata *stats);
    13763
    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);
     64pmChip           *fpcameraFindChip (double *xChip, double *yChip, pmFPA *fpa, double xFPA, double yFPA);
     65bool              fpcameraChipBounds (pmFPA *fpa);
     66bool              fpcameraFindChipInXrange (pmFPA *fpa, int nChip, double xFPA, double yFPA);
     67bool              fpcameraFindChipInYrange (pmFPA *fpa, int nChip, double xFPA, double yFPA);
     68bool              fpcameraFindChipYedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip);
     69bool              fpcameraFindChipXedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip);
     70bool              fpcameraFPAtoChip (double *xChip, double *yChip, pmFPA *fpa, int nChip, double xFPA, double yFPA);
    20071
    20172///@}
    202 # endif /* PSASTRO_H */
     73# endif /* FPCAMERA_H */
  • branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraErrorCodes.h

    r42175 r42176  
    2121 */
    2222typedef enum {
    23     FPCAMERA_ERR_BASE = 8000,
     23    FPCAMERA_ERR_BASE = 4500,
    2424    FPCAMERA_ERR_UNKNOWN,
    2525    FPCAMERA_ERR_NOT_IMPLEMENTED,
  • branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraVersion.c

    r42175 r42176  
    88 */
    99
    10 #include "fpcameraInternal.h"
     10#include "fpcamera.h"
    1111#include "fpcameraVersionDefinitions.h"
    1212
Note: See TracChangeset for help on using the changeset viewer.