IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 10, 2009, 4:55:32 PM (17 years ago)
Author:
Paul Price
Message:

Activating I/O of detection efficiency. Streamlined the code a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/psModules/src/objects/pmDetEff.c

    r25327 r25331  
    7878}
    7979
     80bool pmReadoutWriteDetEff(psFits *fits, const pmReadout *readout,
     81                          const psMetadata *header, const char *extname)
     82{
     83    PM_ASSERT_READOUT_NON_NULL(readout, false);
     84
     85    bool mdok;                          // Status of MD lookup
     86    pmDetEff *de = psMetadataLookupPtr(&mdok, readout->analysis, PM_DETEFF_ANALYSIS); // Detection efficiency
     87    if (!mdok || !de) {
     88        // Wrote everything there was to write
     89        return true;
     90    }
     91    return pmDetEffWrite(fits, de, header, extname);
     92}
     93
    8094
    8195pmDetEff *pmDetEffRead(psFits *fits, const char *extname)
     
    138152}
    139153
     154bool pmReadoutReadDetEff(psFits *fits, const pmReadout *readout, const char *extname)
     155{
     156    PM_ASSERT_READOUT_NON_NULL(readout, false);
     157
     158    pmDetEff *de = pmDetEffRead(fits, extname);
     159    if (!de) {
     160        if (psErrorCodeLast() != PS_ERR_NONE) {
     161            return false;
     162        }
     163        return true;
     164    }
     165
     166    return psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, PM_DETEFF_ANALYSIS,
     167                            PS_META_REPLACE | PS_DATA_UNKNOWN, "Detection efficiency", de);
     168}
Note: See TracChangeset for help on using the changeset viewer.