IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41620


Ignore:
Timestamp:
May 27, 2021, 11:41:52 AM (5 years ago)
Author:
eugene
Message:

consolidate reset operations for clarity

Location:
branches/eam_branches/relphot.20210521
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/relphot.20210521/Makefile

    r41612 r41620  
    3131$(SRC)/GridOps.$(ARCH).o         \
    3232$(SRC)/GridIO.$(ARCH).o  \
     33$(SRC)/ResetOps.$(ARCH).o        \
    3334$(SRC)/ImageOps.$(ARCH).o        \
    3435$(SRC)/ImageSubset.$(ARCH).o     \
     
    9192$(SRC)/GridOps.$(ARCH).o         \
    9293$(SRC)/GridIO.$(ARCH).o  \
     94$(SRC)/ResetOps.$(ARCH).o        \
    9395$(SRC)/ImageOps.$(ARCH).o        \
    9496$(SRC)/ImageSubset.$(ARCH).o     \
  • branches/eam_branches/relphot.20210521/include/relphot.h

    r41615 r41620  
    442442int    RESET;
    443443int    RESET_ZEROPTS;
     444int    RESET_FLATCORR;
    444445int    REPAIR_WARPS;
    445446int    PRESERVE_PS1;
     
    578579ImageSubset  *getimages_subset    PROTO((off_t *N));
    579580void          global_stats        PROTO((Catalog *catalog, int Ncatalog, int nloop));
    580 void          initGrid            PROTO(());
     581void          initGrid            PROTO((void));
    581582void          setMflatFromGrid    PROTO((Catalog *catalog));
    582 void          initGridBins        PROTO(());
     583void          initGridBins        PROTO((void));
    583584GridCorrectionType *getGridCorrByCode PROTO((int code));
    584585GridCorrectionType *getGridCorrNext   PROTO((int *Nlast));
     
    749750StatDataSet *StatDataSetAlloc (int Nsecfilt, int Nmax);
    750751
    751 int init_synthetic_mags ();
     752int init_synthetic_mags (void);
    752753int add_synthetic_mags (AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, off_t *Nmeasure, off_t *Nm);
    753754
     
    810811
    811812int SynthZeroPointsLoad (char *filename);
    812 SynthZeroPoints *SynthZeroPointsGet ();
     813SynthZeroPoints *SynthZeroPointsGet (void);
    813814
    814815int relphot_synthphot (SkyList *sky, int hostID, char *hostpath);
     
    829830
    830831void put_astrom_table (AstromOffsetTable *myTable);
    831 void free_astrom_table ();
     832void free_astrom_table (void);
    832833
    833834uint64_t CreatePSPSObjectID(double ra, double dec);
     
    852853
    853854int MagResidSave(char *filename, Catalog *catalog);
     855
     856void ResetAverageAndMeasure (Catalog *catalog);
     857void ResetAverageObjects (Catalog *catalog);
     858void ResetImages (Image *subset, off_t Nsubset);
     859void ResetMeasureZeroPoints (MeasureTiny *measure, off_t Nmeasure, off_t Ncat);
     860void ResetAverageActivePhotcodes (SecFilt *secfilt);
     861
     862
  • branches/eam_branches/relphot.20210521/src/GridOps.c

    r41615 r41620  
    2929# define NY_BIN 2
    3030
    31 void initGridBins () {
     31void initGridBins (void) {
    3232
    3333  // allocate the full possible range of GridCorrectionType pointers, Nphotcode
     
    116116/* for GPC1, we have 60 chips, 5 filters, 16x16 grid cells = 2MB of memory for this stuff
    117117   if we go to 64x64 grid cells (~75 pixels), then it is still only 29MB */
    118 void initGrid () {
     118void initGrid (void) {
    119119
    120120  if (!GRID_ZEROPT) return;
  • branches/eam_branches/relphot.20210521/src/args.c

    r41615 r41620  
    220220    RESET = TRUE;
    221221  }
    222 
    223222  RESET_ZEROPTS = FALSE;
    224223  if ((N = get_argument (argc, argv, "-reset-zpts"))) {
    225224    remove_argument (N, &argc, argv);
    226225    RESET_ZEROPTS = TRUE;
     226  }
     227  RESET_FLATCORR = FALSE;
     228  if ((N = get_argument (argc, argv, "-reset-flat"))) {
     229    remove_argument (N, &argc, argv);
     230    RESET_FLATCORR = TRUE;
    227231  }
    228232
     
    759763    RESET = TRUE;
    760764  }
    761 
    762765  RESET_ZEROPTS = FALSE;
    763766  if ((N = get_argument (argc, argv, "-reset-zpts"))) {
    764767    remove_argument (N, &argc, argv);
    765768    RESET_ZEROPTS = TRUE;
     769  }
     770  RESET_FLATCORR = FALSE;
     771  if ((N = get_argument (argc, argv, "-reset-flat"))) {
     772    remove_argument (N, &argc, argv);
     773    RESET_FLATCORR = TRUE;
    766774  }
    767775
  • branches/eam_branches/relphot.20210521/src/bcatalog.c

    r41603 r41620  
    3535  ALLOCATE (Nvalid, int, Nsecfilt);
    3636
    37   // flags used by the photometry analysis (excluding UBERCAL)
    38   unsigned int PHOTOM_FLAGS =
    39     ID_MEAS_NOCAL          | // detection ignored for this analysis (photcode, time range)
    40     ID_MEAS_POOR_PHOTOM    | // detection is photometry outlier
    41     ID_MEAS_SKIP_PHOTOM    | // detection was ignored for photometry measurement
    42     ID_MEAS_AREA           | // detetion was outside acceptable area of device
    43     ID_MEAS_SYNTH_MAG      | // magnitude is synthetic
    44     ID_MEAS_STACK_PRIMARY  | // this stack measurement is in the primary skycell
    45     ID_MEAS_STACK_PHOT_SRC | // this measurement supplied the stack photometry
    46     ID_MEAS_PHOTOM_PSF     | // this measurement is used for the mean psf mag
    47     ID_MEAS_PHOTOM_APER    | // this measurement is used for the mean ap mag
    48     ID_MEAS_PHOTOM_KRON    ; // this measurement is used for the mean kron mag
    49    
    5037  /* exclude stars not in range or with too few measurements */
    5138  for (i = 0; i < catalog[0].Naverage; i++) {
     
    6148    }
    6249
    63     // reset the calculated average magnitudes (does not affect ubercal-tied measurements or images)
    64     if (RESET) {
    65       int Ns;
    66 
    67       for (Ns = 0; Ns < Nphotcodes; Ns++) {
    68 
    69         int thisCode = photcodes[Ns][0].code;
    70         int Nsec = GetPhotcodeNsec(thisCode);
    71 
    72         dvo_secfilt_init (&subcatalog[0].secfilt[Nsecfilt*Naverage+Nsec], SECFILT_RESET_ALL);
    73       }
    74     }
     50    // reset the calculated average magnitudes for active photcode only
     51    ResetAverageActivePhotcodes (&subcatalog[0].secfilt[Nsecfilt*Naverage]);
    7552
    7653    Nm = 0;
     
    11188      if (isnan(catalog[0].measure[offset].Mkron)) { Nnan ++; continue; }
    11289
    113       // require 0x01 in photFlags (fitted with a PSF)
     90      // require 0x01 in photFlags (fitted with a PSF) -- add to the test data
    11491// XXX EAM : test is inconsistent -- fix      if ((catalog[0].measure[offset].photFlags & 0x01) == 0) { Nbad ++; continue; }
    11592
     
    156133      subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_SKIP_PHOTOM;
    157134      subcatalog[0].measureT[Nmeasure].averef = Naverage;
    158       if (RESET) {
    159         // only reset Mcal for measures with a matching image
    160         // do not reset Mcal for ubercal images unless explicitly requested
    161         if (subcatalog[0].measureT[Nmeasure].dbFlags & ID_MEAS_PHOTOM_UBERCAL) {
    162           if (!KEEP_UBERCAL) {
    163             subcatalog[0].measureT[Nmeasure].McalPSF  = 0.0;
    164             subcatalog[0].measureT[Nmeasure].McalAPER = 0.0;
    165             subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL;
    166           }
    167         } else {
    168           if (getImageEntry (Nmeasure, Ncat) >= 0) {
    169             subcatalog[0].measureT[Nmeasure].McalPSF  = 0.0;
    170             subcatalog[0].measureT[Nmeasure].McalAPER = 0.0;
    171           }
    172         }
    173         subcatalog[0].measureT[Nmeasure].dbFlags &= ~PHOTOM_FLAGS;
    174       }
     135      ResetMeasureZeroPoints (&subcatalog[0].measureT[Nmeasure], Nmeasure, Ncat);
     136
    175137      Nmeasure ++;
    176138      Nm ++;
  • branches/eam_branches/relphot.20210521/src/launch_region_hosts.c

    r40291 r41620  
    6262    if (RESET)                      strextend (&command, "-reset");
    6363    if (RESET_ZEROPTS)              strextend (&command, "-reset-zpts");
     64    if (RESET_FLATCORR)             strextend (&command, "-reset-flat");
    6465    if (!KEEP_UBERCAL)              strextend (&command, "-reset-ubercal");
    6566    if (DophotSelect)               strextend (&command, "-dophot %d", DophotValue);
  • branches/eam_branches/relphot.20210521/src/load_catalogs.c

    r40549 r41620  
    165165    if (RESET)               { strextend (&command, "-reset"); }
    166166    if (RESET_ZEROPTS)       { strextend (&command, "-reset-zpts"); }
     167    if (RESET_FLATCORR)      { strextend (&command, "-reset-flat"); }
    167168    if (!KEEP_UBERCAL)       { strextend (&command, "-reset-ubercal"); }
    168169    if (DophotSelect)        { strextend (&command, "-dophot %d", DophotValue); }
  • branches/eam_branches/relphot.20210521/src/load_images.c

    r41555 r41620  
    5757  // reset image values as needed.  always allow 'few' images to succeed, if possible (new
    5858  // images / detections may have been added
    59   for (off_t i = 0; i < Nsubset; i++) {
    60     // reset these two regardless (we will re-determine)
    61     subset[i].flags &= ~(ID_IMAGE_PHOTOM_NOCAL | ID_IMAGE_PHOTOM_POOR | ID_IMAGE_PHOTOM_SKIP | ID_IMAGE_PHOTOM_FEW);
    62     if (RESET) {
    63       if (RESET_ZEROPTS) {
    64         if (!KEEP_UBERCAL || !(subset[i].flags & ID_IMAGE_PHOTOM_UBERCAL)) {
    65           subset[i].McalPSF  = 0.0;
    66           subset[i].McalAPER = 0.0;
    67           subset[i].dMcal    = NAN;
    68           subset[i].flags   &= ~ID_IMAGE_PHOTOM_UBERCAL;
    69         }
    70       }
    71       subset[i].flags &= ~(ID_IMAGE_MOSAIC_POOR | ID_IMAGE_NIGHT_POOR);
    72       subset[i].flags &= ~(ID_IMAGE_IMAGE_PHOTCAL | ID_IMAGE_MOSAIC_PHOTCAL | ID_IMAGE_TGROUP_PHOTCAL);
    73       subset[i].ubercalDist = 1000;
    74     }
    75   }
     59  ResetImages (subset, Nsubset);
    7660
    7761  // XXX consider allowing relphot to skip the AstroMap load (do we need precise astrometry here?)
     
    11599  return TRUE;
    116100}
     101
     102// This function re-creates the image subset array using the array of LineNumbers saved
     103// initially by load_images.  This function is only called by relphot_images.c after the
     104// loops have been completed (if any).  I am not certain this function is doing anything
     105// at all : the values in the image subset are copied back to the master table in
     106// save_images_updates() so the values copied from the master to the subset should already
     107// be there.
    117108
    118109int reload_images (FITS_DB *db) {
  • branches/eam_branches/relphot.20210521/src/reload_catalogs.c

    r41615 r41620  
    9090    initTGroupBins (&catalog, 1);
    9191
    92     initGridBins   (&catalog, 1);
     92    initGridBins   ();
    9393    TIMESTAMP(time3b);
    9494
     
    237237    char *command = NULL;
    238238    strextend (&command, "relphot_client %s -update-catalogs %s", PhotcodeList, imageFile);
    239     strextend (&command, "-hostID %d -D CATDIR %s -hostdir %s", group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].pathname);
     239    strextend (&command, "-hostID %d", group->hosts[i][0].hostID);
     240    strextend (&command, "-D CATDIR %s", CATDIR);
     241    strextend (&command, "-hostdir %s", group->hosts[i][0].pathname);
    240242    strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    241243    strextend (&command, "-statmode %s", STATMODE);
    242244    strextend (&command, "-D CAMERA %s", CAMERA);
    243     strextend (&command, "-D STAR_TOOFEW %d -minerror %f", STAR_TOOFEW, MIN_ERROR);
    244 
    245     // options & configs which affect relphot_client -update-catalogs
    246     // VERBOSE, VERBOSE2
    247     // RESET
    248     // RESET_ZEROPTS
    249     // TimeSelect
    250     // AreaSelect
    251     // STATMODE
    252     // STAR_TOOFEW
    253     // MIN_ERROR
    254    
     245    strextend (&command, "-D STAR_TOOFEW %d", STAR_TOOFEW);
     246    strextend (&command, "-minerror %f", MIN_ERROR);
     247
    255248    if (VERBOSE)           { strextend (&command, "-v"); }
    256249    if (VERBOSE2)          { strextend (&command, "-vv"); }
    257250    if (RESET)             { strextend (&command, "-reset"); }
    258251    if (RESET_ZEROPTS)     { strextend (&command, "-reset-zpts"); }
     252    if (RESET_FLATCORR)    { strextend (&command, "-reset-flat"); }
     253    if (!KEEP_UBERCAL)     { strextend (&command, "-reset-ubercal"); }
    259254    if (PRESERVE_PS1)      { strextend (&command, "-preserve-ps1"); }
     255    if (IS_DIFF_DB)        { strextend (&command, "-is-diff-db"); }
    260256    if (UPDATE)            { strextend (&command, "-update"); }
    261     if (IS_DIFF_DB)        { strextend (&command, "-is-diff-db"); }
    262     if (!KEEP_UBERCAL)     { strextend (&command, "-reset-ubercal"); }
    263257    if (UPDATE_CATFORMAT)  { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
    264258    if (BOUNDARY_TREE)     { strextend (&command, "-boundary-tree %s", BOUNDARY_TREE); }
     
    266260    if (GRID_ZEROPT)       { strextend (&command, "-grid %s", GRID_MEANFILE); }
    267261    if (USE_BASIC_CHECK)   {  strextend (&command, "-basic-image-search"); }
     262    // if (USE_ALL_IMAGES)    { strextend (&command, "-use-all-images"); }
    268263    if (USE_MCAL_PSF_FOR_STACK_APER) { strextend (&command, "-use-mcal-psf-for-stack-aper"); }
    269264
  • branches/eam_branches/relphot.20210521/src/relphot_images.c

    r41615 r41620  
    3838  MARKTIME("-- load image data: %f sec\n", dtime);
    3939
    40   /* load regions and images based on specified sky patch and/or catalog */
     40  // load regions and images based on specified sky patch and/or catalog
     41  // NOTE: load_images transfers zero points from images to mosaics (initMosaicMcal)
     42  // and to tgroups (initTGroupMcal), resetting the image zero points to 0.0.
     43
     44  // (if both tgroups and mosaics are used, the mosaics will hold the value and tgroups
     45  // will get values of 0.0.  This is not clearly the right way to go, but may not matter
     46  // if we reset everything).
     47
    4148  load_images (&db, skylist, &UserPatch, FALSE, USE_ALL_IMAGES);
    4249  MARKTIME("-- load images: %f sec\n", dtime);
     
    4552  if (!UPDATE) dvo_image_unlock (&db);
    4653
    47   initGridBins (); // allocates the empty array of corrections (elements are build below)
     54  initGridBins (); // allocates the empty array of corrections (elements are built below)
    4855
    4956  if (CALIBRATE_STACKS_AND_WARPS || (NLOOP > 0)) {
  • branches/eam_branches/relphot.20210521/src/relphot_objects.c

    r41606 r41620  
    1010int relphot_objects (SkyList *skylist, int hostID, char *hostpath) {
    1111
    12   off_t i, j, k;
    13   int Nsecfilt;
     12  off_t i;
    1413  struct stat filestat;
    1514
     
    8584
    8685    // reset the calculated average magnitudes (does not affect ubercal-tied measurements or images)
    87     if (RESET) {
    88       Nsecfilt = catalog.Nsecfilt;
    89 
    90       DVOAverageFlags photomBits =
    91         ID_OBJ_EXT             | // extended in our data (eg, PS)
    92         ID_OBJ_EXT_ALT         | // extended in external data (eg, 2MASS)
    93         ID_OBJ_GOOD            | // good-quality measurement in our data (eg,PS)
    94         ID_OBJ_GOOD_ALT        | // good-quality measurement in  external data (eg, 2MASS)
    95         ID_OBJ_GOOD_STACK      | // good-quality object in the stack (> 1 good stack)
    96         ID_OBJ_BEST_STACK      | // the primary stack measurement are the best measurements
    97         ID_OBJ_SUSPECT_STACK   | // suspect object in the stack (> 1 good or suspect stack, < 2 good)
    98         ID_OBJ_BAD_STACK;        // good-quality object in the stack (> 1 good stack)
    99      
    100       for (j = 0; j < catalog.Naverage; j++) {
    101         catalog.average[j].flags    &= ~photomBits; // reset all except astrometry bits
    102         catalog.average[j].psfQF     = NAN;     // reset (will be re-calculated here)
    103         catalog.average[j].psfQFperf = NAN;     // reset (will be re-calculated here)
    104         catalog.average[j].stargal   = NAN;     // reset (will be re-calculated here)
    105         catalog.average[j].photFlagsUpper = 0;  // reset (will be re-calculated here)
    106         catalog.average[j].photFlagsLower = 0;  // reset (will be re-calculated here)
    107         catalog.average[j].NwarpOK        = 0;  // reset (will be re-calculated here)
    108         for (k = 0; k < Nsecfilt; k++) {
    109           dvo_secfilt_init (&catalog.secfilt[j*Nsecfilt + k], SECFILT_RESET_ALL);
    110         }
    111       }
    112     }
     86    ResetAverageObjects(&catalog);
    11387
    11488    populate_tiny_values(&catalog, DVO_TV_MEASURE | DVO_TV_AVERAGE);
     
    11993    // XXX reload_catalogs.c calls initTGroupBins here
    12094
    121     initGridBins   (&catalog, 1);
     95    initGridBins   ();
    12296
    12397    findImages (&catalog, 1, FALSE);
     
    235209    if (RESET)             { strextend (&command, "-reset"); }
    236210    if (RESET_ZEROPTS)     { strextend (&command, "-reset-zpts"); }
     211    if (RESET_FLATCORR)    { strextend (&command, "-reset-flat"); }
     212    if (!KEEP_UBERCAL)     { strextend (&command, "-reset-ubercal"); }
    237213    if (PRESERVE_PS1)      { strextend (&command, "-preserve-ps1"); }
    238214    if (IS_DIFF_DB)        { strextend (&command, "-is-diff-db"); }
    239215    if (UPDATE)            { strextend (&command, "-update"); }
    240     if (!KEEP_UBERCAL)     { strextend (&command, "-reset-ubercal"); }
    241216    if (UPDATE_CATFORMAT)  { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
    242217    if (BOUNDARY_TREE)     { strextend (&command, "-boundary-tree %s", BOUNDARY_TREE); }
    243218    if (SYNTH_ZERO_POINTS) { strextend (&command, "-synthphot-zpts %s", SYNTH_ZERO_POINTS); }
     219    // if (GRID_ZEROPT)       { strextend (&command, "-grid %s", GRID_MEANFILE); }
    244220    if (USE_BASIC_CHECK)   { strextend (&command, "-basic-image-search"); }
    245221    if (USE_ALL_IMAGES)    { strextend (&command, "-use-all-images"); }
     
    251227
    252228    // if (SET_MREL_VERSION != 1) { strextend (&command, "-set-mrel-version %d", SET_MREL_VERSION); }
     229
     230    // missing AreaSelect & TimeSelect
    253231
    254232    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/relphot.20210521/src/select_images.c

    r41601 r41620  
    102102     
    103103    if (!(i % 300000)) fprintf (stderr, ".");
    104 
    105     // XXX I am just going for force this for the moment:
    106     // goto found_it;
    107104
    108105    /* exclude images by photcode (we are not doing this, but I'm not sure why) */
  • branches/eam_branches/relphot.20210521/src/setMrelCatalog.c

    r41608 r41620  
    351351  for (Nsec = 0; Nsec < Nsecfilt; Nsec++) {
    352352
    353     // if we detected this object in PS1, or do not request -preserve-ps1, keep the mean photometry values
     353    // -preserve-ps1 means keep an existing average PS1 value
     354    // if we did not detect this object in PS1, or do not request -preserve-ps1, keep the mean photometry values
    354355    if (!PRESERVE_PS1 || !(secfilt[Nsec].flags & ID_SECF_HAS_PS1)) {
    355356      dvo_secfilt_init (&secfilt[Nsec], SECFILT_RESET_CHIP); // this does not reset astrometry or STACK bits
     
    606607
    607608    // reset all stack-related values for this secfilt:
    608     secfilt[Nsec].stackBestOff = -1;
    609     secfilt[Nsec].stackPrmryOff = -1;
    610     secfilt[Nsec].FpsfStk   = NAN;
    611     secfilt[Nsec].dFpsfStk  = NAN;
    612     secfilt[Nsec].FkronStk  = NAN;
    613     secfilt[Nsec].dFkronStk = NAN;
    614     secfilt[Nsec].FapStk    = NAN;
    615     secfilt[Nsec].dFapStk   = NAN;
    616     secfilt[Nsec].MpsfStk   = NAN;
    617     secfilt[Nsec].MkronStk  = NAN;
    618     secfilt[Nsec].MapStk    = NAN;
    619     secfilt[Nsec].Nstack    = 0;
    620     secfilt[Nsec].NstackDet = 0;
    621     secfilt[Nsec].flags    &= ~ID_SECF_STACK_FLAGS; // reset the stack flags
     609    dvo_secfilt_init (&secfilt[Nsec], SECFILT_RESET_STACK);
    622610
    623611    for (off_t k = 0; k < Nmeasure; k++) {
  • branches/eam_branches/relphot.20210521/src/setMrelFinal.c

    r41608 r41620  
    1111  int Nsecfilt = GetPhotcodeNsecfilt ();
    1212
    13   /*** RESET photometry flags and Mcal values ***/
    14   if (RESET) {
    15     // flags used by the photometry analysis (excluding UBERCAL)
    16     unsigned int PHOTOM_FLAGS =
    17       ID_MEAS_NOCAL |          // detection ignored for this analysis (photcode, time range)
    18       ID_MEAS_POOR_PHOTOM |    // detection is photometry outlier
    19       ID_MEAS_SKIP_PHOTOM |    // detection was ignored for photometry measurement
    20       ID_MEAS_AREA |           // detetion was outside acceptable area of device
    21       ID_MEAS_SYNTH_MAG |      // magnitude is synthetic
    22       ID_MEAS_STACK_PRIMARY |  // this stack measurement is in the primary skycell
    23       ID_MEAS_STACK_PHOT_SRC;  // this measurement supplied the stack photometry
    24 
    25     // ID_MEAS_PHOTOM_UBERCAL -- externally-supplied zero point from ubercal analysis
    26     // this is set by 'setphot', do not reset here
    27 
    28     // flags used by the photometry analysis (excluding UBERCAL)
    29     // unsigned int secfiltFlags =
    30     //   ID_PHOTOM_PASS_0 | // average measured at pass 0
    31     //   ID_PHOTOM_PASS_1 | // average measured at pass 1
    32     //   ID_PHOTOM_PASS_2 | // average measured at pass 2
    33     //   ID_PHOTOM_PASS_3 | // average measured at pass 3
    34     //   ID_PHOTOM_PASS_4 | // average measured at pass 3
    35     //   ID_SECF_USE_SYNTH | // average measured at pass 3
    36     //   ID_SECF_USE_UBERCAL | // average measured at pass 3
    37     //   ID_SECF_OBJ_EXT; // average measured at pass 3
    38    
    39     // XXX I should really deprecate the concept of applying the average
    40     // calculation to a limited set of photcodes. 
    41     // for now, just do all photcodes here (
    42     // as it stands, only stacks are limited by photcode; mean exp and forced warp
    43     // are applied to all Nsecfilt
    44 
    45     for (i = 0; i < catalog[0].Naverage; i++) {
    46       int Ns;
    47       for (Ns = 0; Ns < Nsecfilt; Ns++) {
    48        
    49         off_t N = Nsecfilt*i+Ns;
    50         dvo_secfilt_init (&catalog[0].secfilt[N], SECFILT_RESET_ALL);
    51 
    52         off_t m = catalog[0].average[i].measureOffset;
    53         off_t j;
    54         for (j = 0; j < catalog[0].average[i].Nmeasure; j++, m++) {
    55        
    56           /* select measurements by time */
    57           if (TimeSelect) {
    58             if (catalog[0].measure[m].t < TSTART) continue;
    59             if (catalog[0].measure[m].t > TSTOP) continue;
    60           }
    61        
    62           // only reset Mcal for measures with a matching image
    63           // do not reset Mcal for ubercal images unless explicitly requested
    64 
    65           if (catalog[0].measure[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) {
    66             if (!KEEP_UBERCAL) {
    67               catalog[0].measure[m].McalPSF  = 0.0;
    68               catalog[0].measure[m].McalAPER = 0.0;
    69               catalog[0].measure[m].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL;
    70             }
    71           } else {
    72             if (RESET_ZEROPTS && (getImageEntry (m, 0) >= 0)) {
    73               catalog[0].measure[m].McalPSF  = 0.0;
    74               catalog[0].measure[m].McalAPER = 0.0;
    75             }
    76           }
    77           catalog[0].measure[m].dbFlags &= ~PHOTOM_FLAGS;
    78         }
    79       }
    80     }
    81   }
    82 
     13  ResetAverageAndMeasure (catalog);
     14 
    8315  // this sets flags in the measureT element, not the measure element
    8416  setExclusions (catalog, 1, VERBOSE);  /* mark by area */
Note: See TracChangeset for help on using the changeset viewer.