IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:16:41 PM (15 years ago)
Author:
eugene
Message:

improvements to the output headers; some code organization; plug leaks; user-specified limits to input seeing ranges

Location:
trunk/ppStack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack

    • Property svn:ignore
      •  

        old new  
        1717autom4te.cache
        1818Doxyfile
         19a.out.dSYM
    • Property svn:mergeinfo deleted
  • trunk/ppStack/src/ppStackUpdateHeader.c

    r30620 r31158  
    7070    psMetadataAddStr(hdu->header, PS_LIST_TAIL, "TESS_ID", PS_META_REPLACE, "type of stack", tessID);
    7171
     72    psMetadataAddF32(hdu->header, PS_LIST_TAIL, "AIRM_SLP", PS_META_REPLACE, "airmass slope", options->airmassSlope);
     73   
     74
     75    // write the following fields to the output headers:
     76    // INP_NNNN : input file names
     77    // SCL_NNNN : scale factor for each input file
     78    // ZPT_NNNN : zero point of input file
     79    // EXT_NNNN : exptime of input file
     80    // AIR_NNNN : airmass of input file
     81
     82    // use separate loops so they are blocked together in the headers (more readable)
     83
     84    // save the input filenames
     85    for (int i = 0; i < options->num; i++) {
     86        char field[64];
     87        snprintf (field, 64, "INP_%04d", i);
     88
     89        psString basename = psStringFileBasename(options->origImages->data[i]);
     90        psMetadataAddStr(hdu->header, PS_LIST_TAIL, field, PS_META_REPLACE, "input image name", basename);
     91        psFree(basename);
     92    }   
     93
     94    // save the input normalizations
     95    for (int i = 0; i < options->num; i++) {
     96        char field[64];
     97
     98        float value = options->norm ? pow(10.0, -0.4*options->norm->data.F32[i]) : NAN;
     99        snprintf (field, 64, "SCL_%04d", i);
     100        psMetadataAddF32(hdu->header, PS_LIST_TAIL, field, PS_META_REPLACE, "input image scale factor", value);
     101    }   
     102    // save the input exptimes
     103    for (int i = 0; i < options->num; i++) {
     104        char field[64];
     105
     106        float value = options->zpInput ? options->zpInput->data.F32[i] : NAN;
     107        snprintf (field, 64, "ZPT_%04d", i);
     108        psMetadataAddF32(hdu->header, PS_LIST_TAIL, field, PS_META_REPLACE, "input image zero point", value);
     109    }   
     110    // save the input normalizations
     111    for (int i = 0; i < options->num; i++) {
     112        char field[64];
     113
     114        float value = options->expTimeInput ? options->expTimeInput->data.F32[i] : NAN;
     115        snprintf (field, 64, "EXP_%04d", i);
     116        psMetadataAddF32(hdu->header, PS_LIST_TAIL, field, PS_META_REPLACE, "input image exptime", value);
     117    }   
     118    // save the input normalizations
     119    for (int i = 0; i < options->num; i++) {
     120        char field[64];
     121
     122        float value = options->airmassInput ? options->airmassInput->data.F32[i] : NAN;
     123        snprintf (field, 64, "AIR_%04d", i);
     124        psMetadataAddF32(hdu->header, PS_LIST_TAIL, field, PS_META_REPLACE, "input image airmass", value);
     125    }   
    72126    return true;
    73127}
Note: See TracChangeset for help on using the changeset viewer.