Changeset 6056 for trunk/psphot/src/psphotSetup.c
- Timestamp:
- Jan 19, 2006, 2:55:33 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSetup.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSetup.c
r5986 r6056 7 7 // load or construct the weight 8 8 9 eamReadout *psphotSetup (psMetadata *config)9 pmReadout *psphotSetup (psMetadata *config, psMetadata **header) 10 10 { 11 psMetadata * header = NULL;11 psMetadata *myHeader; 12 12 psImage *image = NULL; 13 13 psImage *weight = NULL; … … 23 23 // setup header template, specify COMMENT and HISTORY as MULTI 24 24 // XXX EAM - shouldn't this be part of the basic FITS concept? 25 header = psMetadataAlloc ();26 psMetadataAdd ( header, PS_LIST_HEAD, "COMMENT", PS_DATA_METADATA_MULTI, "folder for comment", NULL);27 psMetadataAdd ( header, PS_LIST_HEAD, "HISTORY", PS_DATA_METADATA_MULTI, "folder for history", NULL);25 myHeader = psMetadataAlloc (); 26 psMetadataAdd (myHeader, PS_LIST_HEAD, "COMMENT", PS_DATA_METADATA_MULTI, "folder for comment", NULL); 27 psMetadataAdd (myHeader, PS_LIST_HEAD, "HISTORY", PS_DATA_METADATA_MULTI, "folder for history", NULL); 28 28 29 29 // read header and image data from INPUT … … 31 31 if (!status) psAbort ("psphot", "input image not specified"); 32 32 psFits *file = psFitsOpen (input, "r"); 33 header = psFitsReadHeader (header, file);33 myHeader = psFitsReadHeader (myHeader, file); 34 34 psImage *tmpimage = psFitsReadImage (NULL, file, region, 0); 35 35 image = psImageCopy (NULL, tmpimage, PS_TYPE_F32); … … 40 40 41 41 // grab these values from the approrpiate location (image header if necessary) 42 float RDNOISE = pmConfigLookupF32 (&status, config, header, "RDNOISE");43 float GAIN = pmConfigLookupF32 (&status, config, header, "GAIN");42 float RDNOISE = pmConfigLookupF32 (&status, config, myHeader, "RDNOISE"); 43 float GAIN = pmConfigLookupF32 (&status, config, myHeader, "GAIN"); 44 44 psMetadataAdd (config, PS_LIST_TAIL, "RDNOISE", PS_DATA_F32 | PS_META_REPLACE, "read noise value used", RDNOISE); 45 45 psMetadataAdd (config, PS_LIST_TAIL, "GAIN", PS_DATA_F32 | PS_META_REPLACE, "gain value used", GAIN); … … 108 108 109 109 // return image data 110 eamReadout *imdata = eamReadoutAlloc(image, weight, mask, header); 111 return (imdata); 110 pmReadout *readout = pmReadoutAlloc(NULL); 111 readout->image = image; 112 readout->weight = weight; 113 readout->mask = mask; 114 115 *header = myHeader; 116 return (readout); 112 117 }
Note:
See TracChangeset
for help on using the changeset viewer.
