IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11583


Ignore:
Timestamp:
Feb 2, 2007, 10:01:11 AM (19 years ago)
Author:
eugene
Message:

adding NSTARS to headers

Location:
trunk/psphot/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.h

    r11382 r11583  
    101101bool psphotLoadExtSources (pmConfig *config, pmFPAview *view, psArray *sources);
    102102psExit psphotGetExitStatus ();
     103bool psphotSetHeaderNstars (psMetadata *recipe, psArray *sources);
  • trunk/psphot/src/psphotOutput.c

    r11382 r11583  
    9292
    9393    psFree (photcode);
     94    return true;
     95}
     96
     97bool psphotSetHeaderNstars (psMetadata *recipe, psArray *sources) {
     98
     99    int nSrc = 0;
     100
     101    // count the number of sources which will be written
     102    for (int i = 0; i < sources->n; i++) {
     103        pmSource *source = (pmSource *) sources->data[i];
     104        pmModel *model = pmSourceSelectModel (source);
     105        if (model == NULL)
     106            continue;
     107        nSrc ++;
     108    }
     109    psMetadataAdd (recipe, PS_LIST_TAIL, "NSTARS", PS_DATA_S32 | PS_META_REPLACE, "NUMBER OF STARS", nSrc);
    94110    return true;
    95111}
     
    121137    psMetadataAdd (header, PS_LIST_TAIL, "FSATUR",   PS_DATA_F32 | PS_META_REPLACE, "SATURATION MAG",      0.0);
    122138    psMetadataAdd (header, PS_LIST_TAIL, "FLIMIT",   PS_DATA_F32 | PS_META_REPLACE, "COMPLETENESS MAG",    0.0);
     139    psMetadataItemTransfer (header, recipe, "NSTARS");
    123140
    124141    // sky background model statistics
  • trunk/psphot/src/psphotReadoutCleanup.c

    r11315 r11583  
    2828    }
    2929
     30    // write NSTARS to the image header
     31    psphotSetHeaderNstars (recipe, sources);
     32
    3033    // create an output header with stats results
    3134    psMetadata *header = psphotDefineHeader (recipe);
Note: See TracChangeset for help on using the changeset viewer.