Changeset 6125
- Timestamp:
- Jan 21, 2006, 12:29:48 AM (20 years ago)
- Location:
- trunk/ppImage
- Files:
-
- 8 edited
-
src/ppFile.c (modified) (1 diff)
-
src/ppImage.h (modified) (1 diff)
-
src/ppImageDetrendBias.c (modified) (1 diff)
-
src/ppImageDetrendCell.c (modified) (3 diffs)
-
src/ppImageLoop.c (modified) (4 diffs)
-
src/ppImageParseCamera.c (modified) (1 diff)
-
test/ipprc.config (modified) (1 diff)
-
test/phase2.config (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppFile.c
r5977 r6125 7 7 psFree(file->fpa); 8 8 psFree(file->phu); 9 psFitsClose(file->fits); 9 if (file->fits) { 10 psFitsClose(file->fits); 11 } 10 12 return; 11 13 } -
trunk/ppImage/src/ppImage.h
r6064 r6125 78 78 ppFile *flat; // The flat-field correction image 79 79 ppFile *fringe; // The fringe correction image 80 psFits *output; // The output file 80 81 #if 0 81 82 ppFile *process; // A dummy file pointing out what needs to be processed -
trunk/ppImage/src/ppImageDetrendBias.c
r6064 r6125 1 1 #include "ppImage.h" 2 2 3 bool ppDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppOptions *options) {4 5 6 // psMetadataPrint(input Cell->concepts, 7);3 bool ppDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppOptions *options) 4 { 5 psTrace(__func__, 1, "Commencing bias processing....\n"); 6 // psMetadataPrint(inputReadout->parent->concepts, 7); 7 7 8 8 pmSubtractBias(inputReadout, options->overscan, bias, dark); -
trunk/ppImage/src/ppImageDetrendCell.c
r6114 r6125 6 6 pmReadout *ppDetrendSelectFirst(pmCell *cell, char *name, bool doThis) 7 7 { 8 9 8 if (!doThis) { 10 9 return NULL; … … 34 33 #endif 35 34 36 // Dark time for dark image37 float darkTime = 1.0;38 if (options->doDark) {39 darkTime = psMetadataLookupF32(NULL, detrend->dark->concepts, "CELL.DARKTIME");40 if (darkTime <= 0.0) {41 psErrorStackPrint(stderr, "DARKTIME for dark image (%f) is non-positive.\n", darkTime);42 exit(EXIT_FAILURE);43 }44 }45 46 35 for (int k = 0; k < detrend->input->readouts->n; k++) { 47 36 … … 50 39 // Mask bad pixels 51 40 if (options->doMask) { 52 ppDetrendMask (detrend->input, input, mask);41 ppDetrendMask(detrend->input, input, mask); 53 42 } 54 43 55 44 // Non-linearity correction 56 45 if (options->doNonLin) { 57 ppDetrendNonLinear (detrend->input, input, options);46 ppDetrendNonLinear(detrend->input, input, options); 58 47 } 59 48 -
trunk/ppImage/src/ppImageLoop.c
r6114 r6125 1 1 # include "ppImage.h" 2 3 psMemId ppMemPrint(const psMemBlock *ptr) 4 { 5 psLogMsg(__func__, PS_LOG_INFO, 6 "Memory block %d (%ld):\n" 7 "\tFile %s, line %d, size %d\n" 8 "\tPosts: %lx %lx %lx\n", 9 ptr->id, ptr->refCounter, ptr->file, ptr->lineno, ptr->userMemorySize, ptr->startblock, 10 ptr->endblock, *(void**)((int8_t *)(ptr + 1) + ptr->userMemorySize)); 11 return 0; 12 } 2 13 3 14 // Read the entire FPA … … 51 62 psArray *chips = data->input->fpa->chips; // Component chips 52 63 for (int i = 0; i < chips->n; i++) { 64 65 if (i > 6) { 66 continue; 67 } 68 53 69 if (processChip >= 0 && i != processChip) { 54 70 continue; … … 100 116 psLogMsg(__func__, PS_LOG_INFO, "%d cells mosaicked.\n", numMosaicked); 101 117 118 // XXX EAM: Photometry goes here! 119 120 // A kludge to get the write to behave wrt the concepts 121 const psMetadata *camera = data->input->fpa->camera; 122 data->input->fpa->camera = NULL; 123 pmFPAWrite(data->output, data->input->fpa, config->database); 124 data->input->fpa->camera = camera; 125 126 // Now I can blow away the mosaic so I can then read more. 127 psFree(chips->data[i]); 128 ppMemPrint((psMemBlock*)chips->data[i]-1); 102 129 } 130 131 #if 0 132 // Write out the mosaicked chip, just to see; this wouldn't normally happen 133 psFits *mosaicFile = psFitsOpen("mosaic.fits", "w"); 134 for (int i = 0; i < chips->n; i++) { 135 pmChip *chip = chips->data[i]; 136 if (! chip || ! chip->exists || ! chip->process) { 137 continue; 138 } 139 #if 0 140 psArray *cells = chip->cells; 141 pmCell *cell = cells->data[0]; 142 psArray *readouts = cell->readouts; 143 pmReadout *readout = readouts->data[0]; 144 psImage *image = readout->image; 145 #else 146 psImage *image = chip->hdu->images->data[0]; 147 #endif 148 psFitsWriteImage(mosaicFile, NULL, image, 0); 149 150 } 151 #endif 103 152 104 153 // Free the detrend FPA and chips … … 108 157 psFree(data->flat); 109 158 159 psFitsClose(data->output); 110 160 111 161 return true; -
trunk/ppImage/src/ppImageParseCamera.c
r6114 r6125 56 56 data->fringe->fpa = pmFPAConstruct(config->camera); 57 57 58 // Open output file 59 const char *outname = psMetadataLookupStr(NULL, config->arguments, "-output"); // Name of output file 60 data->output = psFitsOpen(outname, "w"); // File for writing 61 if (! data->output) { 62 psError(PS_ERR_IO, false, "Unable to open output file %s.\n", data->output); 63 exit(EXIT_FAILURE); 64 } 65 58 66 // XXX EAM : extend this to allow an array of selected chips by name 59 67 // Chip selection: if we are using a single chip, select it for each FPA -
trunk/ppImage/test/ipprc.config
r6089 r6125 21 21 LOGDEST STR STDOUT # Log destination 22 22 TRACE METADATA # Trace levels 23 #ppImageLoop S32 1023 ppImageLoop S32 10 24 24 # ppImageLoadPixels S32 10 25 # pmFPAWrite S32 10 26 # pmFPARead S32 10 25 27 # pmSubtractBias S32 10 28 # ppDetrendBias S32 10 26 29 # pmFPAPrint S32 10 27 30 # psModule.concepts S32 10 28 # pmFPAWrite S32 1029 31 # pmConfigRead S32 10 30 32 # pmFPAWriteMask S32 10 31 33 # pmFPAWriteWeight S32 10 32 34 # pmChipMosaic S32 10 33 # pmFPAMorph S32 1034 # pap_psMetadataCopy S32 935 35 END -
trunk/ppImage/test/phase2.config
r6089 r6125 5 5 NONLIN BOOL FALSE # Non-linearity correction 6 6 OVERSCAN BOOL TRUE # Overscan subtraction 7 BIAS BOOL TRUE # Bias subtraction7 BIAS BOOL FALSE # Bias subtraction 8 8 DARK BOOL FALSE # Dark subtraction 9 FLAT BOOL TRUE # Flat-field normalisation9 FLAT BOOL FALSE # Flat-field normalisation 10 10 FRINGE BOOL FALSE # Fringe subtraction 11 11 SOURCE BOOL FALSE # Source identification and photometry
Note:
See TracChangeset
for help on using the changeset viewer.
