IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 30, 2010, 10:05:23 AM (16 years ago)
Author:
rhenders
Message:

Now looking up column numbers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/ippToPspsBatchDetection.c

    r28529 r28559  
    5757    status=0; fits_read_key(fitsIn, TDOUBLE, "MJD-OBS", &expStart, NULL, &status);
    5858    status=0; fits_read_key(fitsIn, TDOUBLE, "EXPTIME", &expTime, NULL, &status);
    59     obsTime = expStart + (expTime/172800); // exp start plus half exp time (converted from secs to days)
     59    obsTime = expStart + (expTime/172800.0); // exp start plus half exp time (converted from secs to days)
    6060   
    6161    ippToPspsConfig_writeTable(this->config, fitsIn, this->fitsOut, 1, "FrameMeta", true);
     
    161161    long removeList[MAXDETECT];
    162162    long thisObjId;
     163    bool firstTimeIn = true;
     164    int ippIDetNum, instMagNum, instMagErrNum, peakMagNum;
    163165
    164166    // loop round all 60 chips
     
    251253            s = d = totalDetections = invalidDvoRows = smfJumps = unmatched = 0;
    252254
     255            // determine column numbers for certain IPP detection columns
     256            if (firstTimeIn) {
     257
     258                status=0;fits_get_colnum(fitsIn, CASESEN, "IPP_IDET", &ippIDetNum, &status);
     259                if (status) psError(PS_ERR_IO, false, "Unable to read col num for IPP_IDET");
     260                status=0;fits_get_colnum(fitsIn, CASESEN, "PSF_INST_MAG", &instMagNum, &status);
     261                if (status) psError(PS_ERR_IO, false, "Unable to read col num for PSF_INST_MAG");
     262                status=0;fits_get_colnum(fitsIn, CASESEN, "PSF_INST_MAG_SIG", &instMagErrNum, &status);
     263                if (status) psError(PS_ERR_IO, false, "Unable to read col num for PSF_INST_MAG_SIG");
     264                status=0;fits_get_colnum(fitsIn, CASESEN, "PEAK_FLUX_AS_MAG", &peakMagNum, &status);
     265                if (status) psError(PS_ERR_IO, false, "Unable to read col num for PEAK_FLUX_AS_MAG");
     266
     267                firstTimeIn=false;
     268            }
     269
    253270            anynull = 0;
    254             fits_read_col(fitsIn, TLONG, 1, 1, 1, nDet, &longnull, ippIDet, &anynull, &status);
    255             fits_read_col(fitsIn, TFLOAT, 8, 1, 1, nDet, &floatnull, instMag, &anynull, &status);
    256             fits_read_col(fitsIn, TFLOAT, 9, 1, 1, nDet, &floatnull, instMagErr, &anynull, &status);
    257             fits_read_col(fitsIn, TFLOAT, 12, 1, 1, nDet, &floatnull, peakMag, &anynull, &status);
     271            fits_read_col(fitsIn, TLONG, ippIDetNum, 1, 1, nDet, &longnull, ippIDet, &anynull, &status);
     272            fits_read_col(fitsIn, TFLOAT, instMagNum, 1, 1, nDet, &floatnull, instMag, &anynull, &status);
     273            fits_read_col(fitsIn, TFLOAT, instMagErrNum, 1, 1, nDet, &floatnull, instMagErr, &anynull, &status);
     274            fits_read_col(fitsIn, TFLOAT, peakMagNum, 1, 1, nDet, &floatnull, peakMag, &anynull, &status);
    258275
    259276            // DVO detections are ordered by IPP_IDET, which increments from 0 in SMF table
     
    405422}
    406423
    407 
Note: See TracChangeset for help on using the changeset viewer.