IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 21, 2021, 2:04:53 PM (5 years ago)
Author:
eugene
Message:

I have stripped out all flatcorr references : flat correction is applied by setphot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/relphot.20210521/src/StarOps.c

    r41603 r41606  
    88  Catalog *catalog;
    99  int Ncatalog;
    10   FlatCorrectionTable *flatcorr;
    1110  SetMrelInfo summary;
    1211} ThreadInfo;
     
    1413// ** internal functions:
    1514void *setMrel_worker (void *data);
    16 int setMrel_threaded (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr);
    17 int setMrel_catalog (Catalog *catalog, int Nc, int pass, FlatCorrectionTable *flatcorr, SetMrelInfo *results, int Nsecfilt);
     15int setMrel_threaded (Catalog *catalog, int Ncatalog);
     16int setMrel_catalog (Catalog *catalog, int Nc, int pass, SetMrelInfo *results, int Nsecfilt);
    1817int print_measure_set (Average *average, SecFilt *secfilt, Measure *measure);
    1918
     
    298297// * setMrelOutput updates average EXT flags (PS1 and 2MASS)
    299298
    300 int setMrel (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) {
     299int setMrel (Catalog *catalog, int Ncatalog) {
    301300
    302301  int i;
    303302
    304303  if (NTHREADS) {
    305     int status = setMrel_threaded (catalog, Ncatalog, flatcorr);
     304    int status = setMrel_threaded (catalog, Ncatalog);
    306305    return status;
    307306  }
     
    314313
    315314  for (i = 0; i < Ncatalog; i++) {
    316     setMrel_catalog_alt (catalog, i, FALSE, flatcorr, &results, Nsecfilt);
     315    setMrel_catalog_alt (catalog, i, FALSE, &results, Nsecfilt);
    317316    SetMrelInfoAccum (&summary, &results);
    318317  }
     
    326325
    327326// setMrelOutput is NOT threaded because we read/write catalogs one at a time (for now)
    328 int setMrelOutput (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) {
     327int setMrelOutput (Catalog *catalog, int Ncatalog) {
    329328
    330329  int i;
     
    337336
    338337  for (i = 0; i < Ncatalog; i++) {
    339     setMrel_catalog_alt (catalog, i, TRUE, flatcorr, &results, Nsecfilt);
     338    setMrel_catalog_alt (catalog, i, TRUE, &results, Nsecfilt);
    340339    SetMrelInfoAccum (&summary, &results);
    341340  }
     
    347346}
    348347
    349 int setMrel_threaded (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) {
     348int setMrel_threaded (Catalog *catalog, int Ncatalog) {
    350349
    351350  int i;
     
    374373    threadinfo[i].catalog  =  catalog;
    375374    threadinfo[i].Ncatalog = Ncatalog;
    376     threadinfo[i].flatcorr = flatcorr;
    377375    SetMrelInfoInit (&threadinfo[i].summary, FALSE);
    378376    pthread_create (&threads[i], NULL, setMrel_worker, &threadinfo[i]);
     
    435433
    436434    Catalog *catalog = threadinfo->catalog;
    437     FlatCorrectionTable *flatcorr = threadinfo->flatcorr;
    438 
    439     setMrel_catalog_alt (catalog, i, FALSE, flatcorr, &results, Nsecfilt);
     435
     436    setMrel_catalog_alt (catalog, i, FALSE, &results, Nsecfilt);
    440437    SetMrelInfoAccum (&threadinfo->summary, &results);
    441438  }
     
    474471
    475472/* set measure.Mcal for all measures except ID_MEAS_NOCAL and ID_IMAGE_PHOTOM_NOCAL */
    476 int setMcalOutput (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) {
     473int setMcalOutput (Catalog *catalog, int Ncatalog) {
    477474
    478475  int i;
     
    667664# define NSIGMA_CLIP 3.0
    668665# define NSIGMA_REJECT 5.0
    669 void clean_measures (Catalog *catalog, int Ncatalog, int final, FlatCorrectionTable *flatcorr) {
     666void clean_measures (Catalog *catalog, int Ncatalog, int final) {
    670667
    671668  off_t j, k, m, Nmax, Ndel, Nave;
     
    833830}
    834831
    835 StatType statsStarN (Catalog *catalog, int Ncatalog, int Nsec, int seccode, FlatCorrectionTable *flatcorr) {
     832StatType statsStarN (Catalog *catalog, int Ncatalog, int Nsec, int seccode) {
    836833
    837834  off_t j, k, m, Ntot;
     
    11061103      float MrelPSF  = getMrel  (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); // average magnitude
    11071104      // float Mgrid    = getMgridTiny (&catalog[c].measureT[m]);                    // camera offset (deprecated?)
    1108       // float Mflat    = getMflat (m, c, flatcorr, catalog); // flat-field correction
     1105      // float Mflat    = getMflat (m, c, catalog); // flat-field correction
    11091106
    11101107      off_t n = catalog[c].measureT[m].averef;
     
    11211118  fclose (fout);
    11221119}
     1120
     1121// maybe make this a macro
     1122float getMflat (off_t meas, int cat, Catalog *catalog) {
     1123  float offset = catalog[cat].measureT[meas].Mflat;
     1124  if (!isfinite(offset)) {
     1125    offset = 0.0;
     1126  }
     1127  return (offset);
     1128}
Note: See TracChangeset for help on using the changeset viewer.