IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 1, 2012, 2:48:41 PM (14 years ago)
Author:
eugene
Message:

updates to relphot to support ubercal, distributed dvo; some optmimization (eg, image matching to area); cleanup names of static helper arrays in ImageOps, MosaicOps; cleanup rules for -reset options (relphot does not reset astrom bits); add flat-field correction; determine ubercal distance for images; better plot ranges; bcatalog limit density selecting objects by number of measurements; allow relphot to update the output catalog schema (catformat); make relphot -averages and relphot -update-objects equivalent in how low-quality objects are handled; record stage at which average is determined

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relphot/include/relphot.h

    r31668 r33651  
    77# define GRID_V2
    88# define NO_IMAGE -100
     9
     10// choose off_t or int depending on full-scale relphot analysis resources
     11// # define IDX_T off_t
     12# define IDX_T int
     13
     14typedef enum {
     15    MODE_NONE   = 0,
     16    MODE_LOAD   = 1,
     17    MODE_UPDATE = 2,
     18    MODE_UPDATE_OBJECTS = 3,
     19} ModeType;
    920
    1021typedef struct {
     
    1829  short Xm;
    1930  float secz;
    20   char flags;
     31  float ubercalDist;
     32  unsigned int flags;
    2133  Coords coords;
    2234} Mosaic;
     
    3042  double min;
    3143  double max;
     44  double Upper80;
     45  double Lower20;
    3246  double total;
    3347  int    Nmeas;
    3448} StatType;
    3549
     50typedef struct {
     51  AverageTiny *average;       // array of (minimal) average data
     52  MeasureTiny *measure;       // array of (minimal) measure data
     53  SecFilt     *secfilt;       // array of secfilt data (matched to average by Nsecfilt)
     54  off_t       Naverage;
     55  off_t       Nmeasure;
     56} BrightCatalog;
     57
     58typedef struct {
     59  float Mcal;
     60  float dMcal;
     61  unsigned int imageID;
     62  unsigned int photom_map_id;
     63  unsigned int flags;
     64  unsigned int tzero;
     65  unsigned char trate;
     66} ImageSubset;
     67
     68typedef struct {
     69  Catalog *catalog;           // array of catalogs generated
     70  int NCATALOG;               // number of catalogs allocated
     71  int Ncatalog;               // number of catalogs generated
     72  int Nsecfilt;               // number of catalogs generated
     73  off_t *NAVERAGE;            // allocated Averages per catalog
     74  off_t *NMEASURE;            // allocated Measures per catalog
     75  int   *index;               // lookup table catID -> catalog[i]
     76  int   *catIDs;              // lookup table catID <- catalog[i]
     77  int    maxID;               // max catID value to date
     78} CatalogSplitter;
     79
    3680/* global variables set in parameter file */
    37 char   ImageCat[256];
    38 char   ImageTemplate[256];
    39 char   CatTemplate[256];
    40 char   GSCFILE[256];
    41 char   CATDIR[256];
     81# define MAX_PATH_LENGTH 1024
     82char   ImageCat[MAX_PATH_LENGTH];
     83char   ImageTemplate[MAX_PATH_LENGTH];
     84char   CatTemplate[MAX_PATH_LENGTH];
     85char   GSCFILE[MAX_PATH_LENGTH];
     86char  *CATDIR;
    4287char   CATMODE[16];    /* raw, mef, split, mysql */
    4388char   CATFORMAT[16];  /* internal, elixir, loneos, panstarrs */
    44 char   CameraConfig[256];
    45 char   SKY_TABLE[256];
     89char   CameraConfig[MAX_PATH_LENGTH];
     90char   CAMERA[64];    /* eg, gpc1 */
     91char   SKY_TABLE[MAX_PATH_LENGTH];
    4692int    SKY_DEPTH;  /** XXX EAM : depth of catalog tables, fix usage */
     93
     94int          HOST_ID;
     95char        *HOSTDIR;
     96char        *IMAGES;
     97char        *BCATALOG;
     98ModeType     MODE;
    4799
    48100double MAG_LIM;
     
    54106double MIN_ERROR;
    55107double IMFIT_SYS_SIGMA_LIM;
     108double CLOUD_TOLERANCE;
     109
     110int    PARALLEL;
     111int    PARALLEL_MANUAL;
     112int    PARALLEL_SERIAL;
    56113
    57114int    VERBOSE;
     
    79136int    FREEZE_MOSAICS;
    80137int    USE_GRID;
     138int    KEEP_UBERCAL;
    81139char  *OUTROOT;
     140char  *UPDATE_CATFORMAT;
    82141int    PLOTDELAY;
    83142int    UpdateAverages;
     143
     144char  *PhotcodeList;
    84145
    85146int    RELPHOT_GRID_X;
     
    101162double AreaXmin, AreaXmax, AreaYmin, AreaYmax;
    102163
    103 int ImagSelect, ImagMin, ImagMax;
     164int ImagSelect;
     165double ImagMin, ImagMax;
    104166
    105167int DophotSelect, DophotValue;
     
    112174
    113175SkyRegion UserPatch;
    114 int UserPatchSelect;
     176char *UserCatalog;
    115177
    116178int USE_BASIC_CHECK;
     
    131193off_t        *SelectRefMosaic     PROTO((Mosaic **refmosaic, off_t *Nimage));
    132194int           args                PROTO((int argc, char **argv));
     195int           args_client         PROTO((int argc, char **argv));
    133196int           bcatalog            PROTO((Catalog *subcatalog, Catalog *catalog));
    134197void          clean_images        PROTO((void));
    135 void          clean_measures      PROTO((Catalog *catalog, int Ncatalog, int final));
     198void          clean_measures      PROTO((Catalog *catalog, int Ncatalog, int final, FlatCorrectionTable *flatcorr));
    136199void          clean_mosaics       PROTO((void));
    137200void          clean_stars         PROTO((Catalog *catalog, int Ncatalog));
     
    156219Coords       *getCoords           PROTO((off_t meas, int cat));
    157220off_t         getImageEntry       PROTO((off_t meas, int cat));
    158 float         getMcal             PROTO((off_t meas, int cat));
     221float         getMcal             PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog));
     222float         getMflat            PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog));
    159223float         getMgrid            PROTO((off_t meas, int cat));
    160224float         getMmos             PROTO((off_t meas, int cat));
    161225float         getMrel             PROTO((Catalog *catalog, off_t meas, int cat));
     226short         getUbercalDist      PROTO((off_t meas, int cat));
    162227Image        *getimage            PROTO((off_t N));
    163228Image        *getimages           PROTO((off_t *N, off_t **LineNumber));
    164 void          global_stats        PROTO((Catalog *catalog, int Ncatalog));
     229ImageSubset  *getimages_subset    PROTO((off_t *N));
     230void          global_stats        PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr));
    165231void          initGrid            PROTO((int dX, int dY));
    166232void          initGridBins        PROTO((Catalog *catalog, int Ncatalog));
    167233void          initImageBins       PROTO((Catalog *catalog, int Ncatalog, int doImageList));
     234void          initImagesSubset    PROTO((ImageSubset *input, off_t *line_number, off_t N));
    168235void          initImages          PROTO((Image *input, off_t *LineNumber, off_t N));
    169236void          initMosaicBins      PROTO((Catalog *catalog, int Ncatalog, int doMosaicList));
     
    172239void          initMrel            PROTO((Catalog *catalog, int Ncatalog));
    173240void          initialize          PROTO((int argc, char **argv));
     241void          initialize_client   PROTO((int argc, char **argv));
    174242void          initstats           PROTO((char *mode));
    175243int           liststats           PROTO((double *value, double *dvalue, int N, StatType *stats));
    176 Catalog       *load_catalogs      PROTO((SkyList *skylist, int *Ncatalog));
    177 SkyList      *load_images         PROTO((FITS_DB *db, char *regionName, SkyRegion *region, int RegionSelect));
    178 Image         *select_images      PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage));
     244Catalog      *load_catalogs       PROTO((SkyList *skylist, int *Ncatalog, int hostID, char *hostpath));
     245Catalog      *load_catalogs_parallel PROTO((SkyList *sky, int *Ncatalog));
     246
     247SkyList      *load_images         PROTO((FITS_DB *db, char *regionName, SkyRegion *region));
     248Image        *select_images       PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage));
    179249
    180250int           main                PROTO((int argc, char **argv));
     
    185255void          plot_chisq          PROTO((Catalog *catalog, int Ncatalog));
    186256void          plot_defaults       PROTO((Graphdata *graphdata));
    187 void          plot_grid           PROTO((Catalog *catalog));
     257void          plot_grid           PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr));
    188258void          plot_images         PROTO((void));
    189259void          plot_list           PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) OHANA_FORMAT(printf, 6, 7) );
    190260void          plot_mosaic_fields  PROTO((Catalog *catalog));
    191261void          plot_mosaics        PROTO((void));
    192 void          plot_scatter        PROTO((Catalog *catalog, int Ncatalog));
     262void          plot_scatter        PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr));
    193263void          plot_star_coords    PROTO((Catalog *catalog, int Ncatalog));
    194264void          plot_stars          PROTO((Catalog *catalog, int Ncatalog));
    195 void          reload_catalogs     PROTO((SkyList *skylist));
     265void          reload_catalogs     PROTO((SkyList *skylist, FlatCorrectionTable *flatcorr, int hostID, char *hostpath));
     266int           reload_catalogs_parallel PROTO((SkyList *sky));
    196267int           reload_images       PROTO((FITS_DB *db));
    197 int           setExclusions       PROTO((Catalog *catalog, int Ncatalog));
    198 void          setMcal             PROTO((Catalog *catalog, int Poor));
     268int           setExclusions       PROTO((Catalog *catalog, int Ncatalog, int verbose));
     269void          setMcal             PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr));
    199270void          setMcalFinal        PROTO((void));
    200 int           setMcalOutput       PROTO((Catalog *catalog, int Ncatalog));
    201 void          setMgrid            PROTO((Catalog *catalog));
    202 int           setMmos             PROTO((Catalog *catalog, int Poor));
    203 int           setMrel             PROTO((Catalog *catalog, int Ncatalog));
    204 void          setMrelFinal        PROTO((Catalog *catalog));
    205 int           setMrelOutput       PROTO((Catalog *catalog, int Ncatalog, int mark));
     271int           setMcalOutput       PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr));
     272void          setMgrid            PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr));
     273int           setMmos             PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr));
     274int           setMrel             PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr));
     275void          setMrelFinal        PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr));
     276int           setMrelOutput       PROTO((Catalog *catalog, int Ncatalog, int pass, FlatCorrectionTable *flatcorr));
    206277int           setMave             PROTO((Catalog *catalog, int Ncatalog));
    207278void          set_ZP              PROTO((double ZERO));
    208279int           setrefcode          PROTO((Image *image, off_t Nimage));
    209 void          skip_measurements   PROTO((Catalog *catalog, int pass));
     280void          skip_measurements   PROTO((Catalog *catalog, int pass, FlatCorrectionTable *flatcorr));
    210281void          sortA               PROTO((double *X, int N));
    211282void          sortB               PROTO((double *X, double *Y, int N));
     
    213284void          sortD               PROTO((double *X, double *Y, double *Z, int N));
    214285StatType      statsImageM         PROTO((Catalog *catalog));
    215 StatType      statsImageN         PROTO((Catalog *catalog));
     286StatType      statsImageN         PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr));
    216287StatType      statsImageX         PROTO((Catalog *catalog));
    217288StatType      statsImagedM        PROTO((Catalog *catalog));
    218289StatType      statsMosaicM        PROTO((Catalog *catalog));
    219 StatType      statsMosaicN        PROTO((Catalog *catalog));
     290StatType      statsMosaicN        PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr));
    220291StatType      statsMosaicX        PROTO((Catalog *catalog));
    221292StatType      statsMosaicdM       PROTO((Catalog *catalog));
    222 StatType      statsStarN          PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode));
     293StatType      statsStarN          PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode, FlatCorrectionTable *flatcorr));
    223294StatType      statsStarS          PROTO((Catalog *catalog, int Ncatalog, int Nsec));
    224295StatType      statsStarX          PROTO((Catalog *catalog, int Ncatalog, int Nsec));
     
    226297void          wimages             PROTO((void));
    227298void          write_coords        PROTO((Header *header, Coords *coords));
    228 int relphot_objects (void);
     299int relphot_objects (int hostID, char *hostpath);
    229300
    230301void relphot_usage (void);
    231302void relphot_help (int argc, char **argv);
    232303
     304void relphot_client_usage (void);
     305void relphot_client_help (int argc, char **argv);
     306
    233307off_t getImageByID (off_t ID);
    234308
     
    236310int LimitDensityCatalog (Catalog *subcatalog, Catalog *catalog);
    237311
    238 int populate_tiny_values (Catalog *catalog);
    239 int free_tiny_values (Catalog *catalog);
     312BrightCatalog *BrightCatalogLoad(char *filename);
     313int BrightCatalogSave(char *filename, BrightCatalog *catalog);
     314BrightCatalog *BrightCatalogMerge (Catalog *catalog, int Ncatalog);
     315CatalogSplitter *BrightCatalogSplitInit (int Nsecfilt);
     316int BrightCatalogSplitFree (CatalogSplitter *catalogs);
     317int BrightCatalogSplit (CatalogSplitter *catalogs, BrightCatalog *bcatalog);
     318
     319int ImageSubsetSave(char *filename, ImageSubset *image, off_t Nimage);
     320ImageSubset *ImageSubsetLoad(char *filename, off_t *nimage);
Note: See TracChangeset for help on using the changeset viewer.