Changeset 7508
- Timestamp:
- Jun 9, 2006, 6:25:41 PM (20 years ago)
- Location:
- trunk/ppImage
- Files:
-
- 9 edited
-
configure.ac (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/ppImage.h (modified) (2 diffs)
-
src/ppImageDetrendMask.c (modified) (1 diff)
-
src/ppImageDetrendReadout.c (modified) (1 diff)
-
src/ppImageLoop.c (modified) (4 diffs)
-
src/ppImageOptions.c (modified) (2 diffs)
-
src/ppImageOptions.h (modified) (1 diff)
-
src/ppImagePhot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/configure.ac
r6902 r7508 18 18 [AS_HELP_STRING(--enable-optimize,enable compiler optimization)], 19 19 [AC_MSG_RESULT(compile optimization enabled) 20 CFLAGS=" ${CFLAGS=}-O2"],20 CFLAGS="-O2"], 21 21 [AC_MSG_RESULT([compile optimization disabled]) 22 CFLAGS=" ${CFLAGS=}-O0 -g"]22 CFLAGS="-O0 -g"] 23 23 ) 24 24 25 25 PKG_CHECK_MODULES([PSLIB], [pslib >= 0.9.0]) 26 26 PKG_CHECK_MODULES([PSMODULE], [psmodule >= 0.0.0]) 27 PKG_CHECK_MODULES([PSPHOT], [psphot >= 0.0.0]) 27 28 28 29 CFLAGS="${CFLAGS} -Wall -Werror -std=c99" -
trunk/ppImage/src/Makefile.am
r7217 r7508 6 6 ppMem.h 7 7 8 ppImage_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $( ppImage_CFLAGS)9 ppImage_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) 8 ppImage_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(ppImage_CFLAGS) 9 ppImage_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) 10 10 ppImage_SOURCES = \ 11 11 ppImage.c \ … … 15 15 ppImageLoop.c \ 16 16 ppImageDetrendReadout.c \ 17 ppImageDetrendMask.c \18 17 ppImageDetrendBias.c \ 19 18 ppImageDetrendNonLinear.c \ 20 19 ppImageRebinReadout.c \ 20 ppImagePhot.c \ 21 21 ppMem.c 22 22 23 # ppImageParseCamera.c \ 23 24 # ppDetrendFlat.c \ -
trunk/ppImage/src/ppImage.h
r6849 r7508 5 5 #include "pslib.h" 6 6 #include "psmodules.h" 7 #include "psphot.h" 7 8 #include "ppImageOptions.h" 8 9 #include "ppMem.h" … … 32 33 bool ppImageRebinReadout (pmConfig *config, pmFPAview *view, char *filename); 33 34 35 bool ppImagePhotom (pmConfig *config, pmFPAview *view); 36 34 37 #endif // Pau. -
trunk/ppImage/src/ppImageDetrendMask.c
r6817 r7508 32 32 // by identifying the image type as a mask (in pmFPAfile). 33 33 // currently, pmFPAfileReadImage converts the image to F32 34 35 36 // XXX this function needs to use pmReadoutSetMask to construct the initial mask 37 // then the pixels will correspond and pmMaskBadPixels can be correctly applied. 38 // this function should not have to lookup the value of CELL.SATURATION, nor should it have to 39 // apply it. -
trunk/ppImage/src/ppImageDetrendReadout.c
r7360 r7508 10 10 // find the currently selected readout 11 11 pmReadout *input = pmFPAfileThisReadout (config->files, view, "PPIMAGE.INPUT"); 12 pmReadoutSetWeight (input);13 12 14 // Mask bad pixels 13 // create the target mask and weight images 14 pmReadoutSetMaskWeight (input); 15 16 // apply the externally supplied mask to the input->mask pixels 15 17 if (options->doMask) { 16 18 pmReadout *mask = pmFPAfileThisReadout (config->files, detview, "PPIMAGE.MASK"); 17 ppImageDetrendMask(input, mask); 19 pmMaskBadPixels (input, mask, options->maskValue); 20 // ppImageDetrendMask(input, mask); 18 21 } 19 22 -
trunk/ppImage/src/ppImageLoop.c
r6849 r7508 37 37 ppImageDetrendReadout (options, config, view); 38 38 39 if (options->doBin1) { 40 ppImageRebinReadout (config, view, "PPIMAGE.BIN1"); 41 } 42 43 if (options->doBin2) { 44 ppImageRebinReadout (config, view, "PPIMAGE.BIN2"); 45 } 39 if (options->doBin1) ppImageRebinReadout (config, view, "PPIMAGE.BIN1"); 40 if (options->doBin2) ppImageRebinReadout (config, view, "PPIMAGE.BIN2"); 46 41 47 42 pmFPAfileIOChecks (config->files, view, PM_FPA_AFTER); … … 51 46 52 47 // ppImageChipMosaic (config, view); 53 // ppImagePSPhot (config, view); 54 // ppImagePSAstro (config, view); 48 49 // we perform photometry on the readouts of this chip in the output 50 ppImagePhotom (config, view); 55 51 56 52 pmFPAfileIOChecks (config->files, view, PM_FPA_AFTER); … … 66 62 } 67 63 64 // ppImageAstrom (config); 65 68 66 // ppImageFPAMosaic (config, view); 69 67 // ppImageJpegFPA (config, view); … … 75 73 } 76 74 75 // input image is: PPIMAGE.INPUT 76 // output image is: PPIMAGE.OUTPUT -
trunk/ppImage/src/ppImageOptions.c
r6849 r7508 28 28 // default flags for various activities 29 29 options->doMask = false; // Mask bad pixels 30 options->maskValue = 0xff; // Default mask value 31 30 32 options->doNonLin = false; // Non-linearity correction 31 33 options->doBias = false; // Bias subtraction … … 138 140 // Mask recipe options 139 141 options->doMask = psMetadataLookupBool(NULL, recipe, "MASK"); 142 psMaskType maskValue = psMetadataLookupU8(&status, recipe, "MASK.VALUE"); 143 if (status) { 144 options->maskValue = maskValue; 145 } 146 140 147 options->doBias = psMetadataLookupBool(NULL, recipe, "BIAS"); 141 148 options->doDark = psMetadataLookupBool(NULL, recipe, "DARK"); -
trunk/ppImage/src/ppImageOptions.h
r6849 r7508 5 5 typedef struct { 6 6 bool doMask; // Mask bad pixels 7 psMaskType maskValue; // apply this bit-mask to choose masked bits 8 7 9 bool doBias; // Bias subtraction 8 10 bool doDark; // Dark subtraction -
trunk/ppImage/src/ppImagePhot.c
r6747 r7508 1 #include <stdio.h> 2 #include "pslib.h" 3 #include "psmodules.h" 4 #include "ppImage.h" 1 # include "ppImage.h" 5 2 6 bool ppImagePhot(ppData *data, ppOptions *options, pmConfig *config) 7 { 8 ppFile *input = data->input; // The input file information 9 pmFPA *fpa = input->fpa; // The input FPA 3 bool ppImagePhotom (pmConfig *config, pmFPAview *view) { 10 4 11 int numMosaicked = pmFPAMosaicCells(fpa, 1, 1); // Number of chips mosaicked together 12 psLogMsg(__func__, PS_LOG_INFO, "%d chips mosaicked.\n", numMosaicked); 5 bool status; 6 pmCell *cell; 7 pmReadout *readout; 13 8 14 #if 1 15 // Write out the mosaicked chip, just to see; this wouldn't normally happen 16 psFits *mosaicFile = psFitsOpen("mosaic.fits", "w"); 17 psArray *chips = fpa->chips; 18 for (int i = 0; i < chips->n; i++) { 19 pmChip *chip = chips->data[i]; 20 if (! chip || ! chip->exists || ! chip->process) { 21 continue; 22 } 23 psArray *cells = chip->cells; 24 pmCell *cell = cells->data[0]; 25 psArray *readouts = cell->readouts; 26 pmReadout *readout = readouts->data[0]; 27 psImage *image = readout->image; 28 psFitsWriteImage(mosaicFile, NULL, image, 0); 9 psphotModelGroupInit (); 10 11 // select recipe options supplied on command line 12 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, "PSPHOT"); 13 14 // set default recipe values here 15 // XXX place this in a psphot library function? 16 psMetadataAddStr (recipe, PS_LIST_TAIL, "FITMODE", PS_META_NO_REPLACE, "default fitting mode", "NONE"); 17 psMetadataAddStr (recipe, PS_LIST_TAIL, "PHOTCODE", PS_META_NO_REPLACE, "default photcode", "NONE"); 18 psMetadataAddStr (recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_NO_REPLACE, "default break point", "NONE"); 19 psMetadataAddF32 (recipe, PS_LIST_TAIL, "ZERO_PT", PS_META_NO_REPLACE, "default zero point", 25.00); 20 psMetadataAddS32 (recipe, PS_LIST_TAIL, "BACKGROUND.XBIN", PS_META_NO_REPLACE, "default binning", 64); 21 psMetadataAddS32 (recipe, PS_LIST_TAIL, "BACKGROUND.YBIN", PS_META_NO_REPLACE, "default binning", 64); 22 23 // find or define a pmFPAfile PSPHOT.INPUT 24 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT"); 25 if (!status) { 26 27 // psphotReadout requires a pmFPAfile supplied with the name PSPHOT.INPUT 28 // create a pmFPAfile which points at PPIMAGE.OUTPUT 29 // mode is 'REFERENCE' to prevent double frees of the fpa 30 pmFPAfile *output = psMetadataLookupPtr (&status, config->files, "PPIMAGE.OUTPUT"); 31 input = pmFPAfileDefine (config->files, config->camera, output->fpa, "PSPHOT.INPUT"); 32 input->mode = PM_FPA_MODE_REFERENCE; 33 34 pmFPAfileDefine (config->files, config->camera, input->fpa, "PSPHOT.OUTPUT"); 35 36 // supply the output name (from cmd-line) to all output (WRITE) files 37 // XXX does this cause trouble with existing files? 38 char *outname = psMetadataLookupPtr(&status, config->arguments, "OUTPUT"); 39 pmFPAfileAddFileNames (config->files, "OUTPUT", outname, PM_FPA_MODE_WRITE); 29 40 } 30 #endif31 41 32 // XXX EAM: Insert psphot stuff here 42 // XXX add the option output files here 43 44 // int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN"); 45 // int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN"); 46 47 // we only was to operate on PSPHOT pmFPAfiles here: 48 pmFPAfileActivate (config->files, false, NULL); 49 pmFPAfileActivate (config->files, true, "PSPHOT.INPUT"); 50 pmFPAfileActivate (config->files, true, "PSPHOT.RESID"); 51 pmFPAfileActivate (config->files, true, "PSPHOT.OUTPUT"); 52 53 pmFPAfileActivate (config->files, true, "PSPHOT.BACKSUB"); 54 pmFPAfileActivate (config->files, true, "PSPHOT.BACKGND"); 55 pmFPAfileActivate (config->files, true, "PSPHOT.BACKMDL"); 56 57 58 // iterate over the cells in the current chip 59 // view->cell = -1; 60 61 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 62 psLogMsg ("ppImagePhot", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 63 if (! cell->process || ! cell->file_exists) { continue; } 64 pmFPAfileIOChecks (config->files, view, PM_FPA_BEFORE); 65 66 // process each of the readouts 67 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 68 pmFPAfileIOChecks (config->files, view, PM_FPA_BEFORE); 69 if (! readout->data_exists) { continue; } 70 71 // run the actual photometry analysis 72 psphotReadout (config, view); 73 74 pmFPAfileIOChecks (config->files, view, PM_FPA_AFTER); 75 } 76 pmFPAfileIOChecks (config->files, view, PM_FPA_AFTER); 77 } 78 79 // de-activate the PSPHOT image files, activate the PPIMAGE ones 80 pmFPAfileActivate (config->files, false, NULL); 81 pmFPAfileActivate (config->files, true, "PPIMAGE.INPUT"); 82 pmFPAfileActivate (config->files, true, "PPIMAGE.BIAS"); 83 pmFPAfileActivate (config->files, true, "PPIMAGE.DARK"); 84 pmFPAfileActivate (config->files, true, "PPIMAGE.MASK"); 85 pmFPAfileActivate (config->files, true, "PPIMAGE.FLAT"); 86 pmFPAfileActivate (config->files, true, "PPIMAGE.OUTPUT"); 87 88 pmFPAfileActivate (config->files, true, "PPIMAGE.BIN1"); 89 pmFPAfileActivate (config->files, true, "PPIMAGE.JPEG1"); 90 pmFPAfileActivate (config->files, true, "PPIMAGE.BIN2"); 91 pmFPAfileActivate (config->files, true, "PPIMAGE.JPEG2"); 33 92 34 93 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
