IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 19, 2006, 2:55:33 PM (21 years ago)
Author:
eugene
Message:

adapted everything to work with pmReadout *readout instead of eamReadout *imdata

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotOutput.c

    r5993 r6056  
    22
    33// output functions: we have several fixed modes (sx, obj, cmp)
    4 void psphotOutput (eamReadout *imdata, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky) {
     4void psphotOutput (pmReadout *readout, psMetadata *header, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky) {
    55
    66    bool status;
     
    1313    char *psfFile    = psMetadataLookupPtr (&status, config, "PSF_OUTPUT_FILE");
    1414
    15     if (residImage != NULL) psphotSaveImage (imdata->header, imdata->image, residImage);
    16     psphotSamplePSFs (config, psf, imdata->image);
     15    if (residImage != NULL) psphotSaveImage (header, readout->image, residImage);
     16    psphotSamplePSFs (config, psf, readout->image);
    1717
    1818    if (psfFile != NULL) {
     
    3030    }
    3131    if (!strcasecmp (outputMode, "OBJ")) {
    32         pmSourcesWriteOBJ (imdata, config, outputFile, sources, psf, sky);
     32        pmSourcesWriteOBJ (readout, config, outputFile, sources, psf, sky);
    3333        return;
    3434    }
    3535    if (!strcasecmp (outputMode, "SX")) {
    36         pmSourcesWriteSX (imdata, config, outputFile, sources, psf, sky);
     36        pmSourcesWriteSX (readout, config, outputFile, sources, psf, sky);
    3737        return;
    3838    }
    3939    if (!strcasecmp (outputMode, "CMP")) {
    40         pmSourcesWriteCMP (imdata, config, outputFile, sources, psf, sky);
     40        pmSourcesWriteCMP (readout, header, config, outputFile, sources, psf, sky);
    4141        return;
    4242    }
    4343    if (!strcasecmp (outputMode, "CMF")) {
    44         pmSourcesWriteCMF (imdata, config, outputFile, sources, psf, sky);
     44        pmSourcesWriteCMF (readout, header, config, outputFile, sources, psf, sky);
    4545        return;
    4646    }
    4747    if (!strcasecmp (outputMode, "TEXT")) {
    48         pmSourcesWriteText (imdata, config, outputFile, sources, psf, sky);
     48        pmSourcesWriteText (readout, config, outputFile, sources, psf, sky);
    4949        return;
    5050    }
     
    5454
    5555// dophot-style output list with fixed line width
    56 bool pmSourcesWriteOBJ (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {
     56bool pmSourcesWriteOBJ (pmReadout *readout, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {
    5757
    5858    int type;
     
    106106
    107107// elixir-mode / sextractor-style output list with fixed line width
    108 bool pmSourcesWriteSX (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {
     108bool pmSourcesWriteSX (pmReadout *readout, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {
    109109
    110110    pmModel *model;
     
    157157
    158158// elixir-style pseudo FITS table (header + ascii list)
    159 bool pmSourcesWriteCMP (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {
     159bool pmSourcesWriteCMP (pmReadout *readout, psMetadata *header, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {
    160160
    161161    int i, type;
     
    172172
    173173    // write necessary information to output header
    174     psphotUpdateHeader (imdata->header, config);
    175     psMetadataAdd (imdata->header, PS_LIST_TAIL, "NSTARS",   PS_DATA_S32 | PS_META_REPLACE, "NUMBER OF STARS", sources->n);
     174    psphotUpdateHeader (header, config);
     175    psMetadataAdd (header, PS_LIST_TAIL, "NSTARS",   PS_DATA_S32 | PS_META_REPLACE, "NUMBER OF STARS", sources->n);
    176176
    177177    // create file, write-out header
     
    179179
    180180    // set NAXIS to 0 : CFITSIO requires isolated header to have NAXIS = 0
    181     mdi = psMetadataLookup (imdata->header, "NAXIS");
     181    mdi = psMetadataLookup (header, "NAXIS");
    182182    mdi->data.S32 = 0;
    183183    mdi->type = PS_DATA_S32;
    184184
    185     // psMetadataAdd (imdata->header, PS_LIST_HEAD, "NAXIS", PS_DATA_S32 | PS_META_REPLACE, "", 0);
    186     psFitsWriteHeader (imdata->header, fits);
     185    // psMetadataAdd (header, PS_LIST_HEAD, "NAXIS", PS_DATA_S32 | PS_META_REPLACE, "", 0);
     186    psFitsWriteHeader (header, fits);
    187187    psFitsClose (fits);
    188188
     
    232232// this format consists of a header derived from the image header
    233233// followed by a zero-size matrix, followed by the table data
    234 bool pmSourcesWriteCMF (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {
     234bool pmSourcesWriteCMF (pmReadout *readout, psMetadata *header, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {
    235235
    236236    psArray *table;
     
    249249
    250250    // write necessary information to output header
    251     psphotUpdateHeader (imdata->header, config);
     251    psphotUpdateHeader (header, config);
    252252
    253253    table = psArrayAlloc (sources->n);
     
    286286
    287287    // write the correct number of sources in the header
    288     psMetadataAdd (imdata->header, PS_LIST_TAIL, "NSTARS", PS_DATA_S32 | PS_META_REPLACE, "NUMBER OF STARS", table->n);
    289     psMetadataAdd (imdata->header, PS_LIST_TAIL, "EXTEND", PS_DATA_BOOL | PS_META_REPLACE, "this file has extensions", true);
     288    psMetadataAdd (header, PS_LIST_TAIL, "NSTARS", PS_DATA_S32 | PS_META_REPLACE, "NUMBER OF STARS", table->n);
     289    psMetadataAdd (header, PS_LIST_TAIL, "EXTEND", PS_DATA_BOOL | PS_META_REPLACE, "this file has extensions", true);
    290290
    291291    // set NAXIS to 0 (we don't write out the data array)
    292     mdi = psMetadataLookup (imdata->header, "NAXIS");
     292    mdi = psMetadataLookup (header, "NAXIS");
    293293    mdi->data.S32 = 0;
    294294    mdi->type = PS_DATA_S32;
     
    300300    // write out the header and table
    301301    psFits *fits = psFitsOpen (filename, "w");
    302     psFitsWriteHeader (imdata->header, fits);
     302    psFitsWriteHeader (header, fits);
    303303    psFitsWriteTable (fits, theader, table);
    304304    psFitsClose (fits);
     
    309309/***** Text Output Methods *****/
    310310
    311 bool pmSourcesWriteText (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky) {
     311bool pmSourcesWriteText (pmReadout *readout, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky) {
    312312
    313313    char *name = (char *) psAlloc (strlen(filename) + 10);
Note: See TracChangeset for help on using the changeset viewer.