Changeset 14874
- Timestamp:
- Sep 17, 2007, 4:19:23 PM (19 years ago)
- Location:
- trunk/pswarp
- Files:
-
- 7 edited
-
configure.ac (modified) (1 diff)
-
src/Makefile.am (modified) (1 diff)
-
src/pswarp.h (modified) (1 diff)
-
src/pswarpArguments.c (modified) (2 diffs)
-
src/pswarpLoop.c (modified) (1 diff)
-
src/pswarpParseCamera.c (modified) (2 diffs)
-
src/pswarpTransformReadout_Opt.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/configure.ac
r14186 r14874 29 29 PKG_CHECK_MODULES([PSMODULE], [psmodules >= 1.0.0]) 30 30 PKG_CHECK_MODULES([PPSTATS], [ppStats >= 1.0.0]) 31 PKG_CHECK_MODULES([PSPHOT], [psphot >= 0.8.0]) 31 32 32 33 dnl Set CFLAGS for build -
trunk/pswarp/src/Makefile.am
r13661 r14874 1 1 bin_PROGRAMS = pswarp 2 pswarp_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PS WARP_CFLAGS)3 pswarp_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PPSTATS_LIBS) $(PS WARP_LIBS)2 pswarp_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PSWARP_CFLAGS) 3 pswarp_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PSWARP_LIBS) 4 4 5 5 pswarp_SOURCES = \ -
trunk/pswarp/src/pswarp.h
r14389 r14874 9 9 # include <pslib.h> 10 10 # include <psmodules.h> 11 # include <psphot.h> 11 12 12 13 # include "pswarpErrorCodes.h" -
trunk/pswarp/src/pswarpArguments.c
r14389 r14874 23 23 pmConfigRecipeOptions (config, PSWARP_RECIPE); 24 24 25 pmConfigFileSetsMD (config->arguments, &argc, argv, "ASTROM", "-astrom", "-astromlist");25 pmConfigFileSetsMD(config->arguments, &argc, argv, "ASTROM", "-astrom", "-astromlist"); 26 26 27 27 // chip selection is used to limit chips to be processed … … 39 39 "Filename for statistics of output image", argv[N]); 40 40 psArgumentRemove(N, &argc, argv); 41 } 42 43 // PSF determination? 44 if ((N = psArgumentGet(argc, argv, "-psf"))) { 45 psArgumentRemove(N, &argc, argv); 46 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "PSF", 0, "Do PSF determination?", true); 41 47 } 42 48 -
trunk/pswarp/src/pswarpLoop.c
r14768 r14874 198 198 } 199 199 200 // We need a new PSF model for the warped frame 201 // It would be good to generate this analytically, but that's going to be tricky. 202 // We have a list of sources, so we could use those to redetermine the PSF model. 203 // Until Gene makes the necessary adaptations to psphot, we will simply redetermine the PSF model from 204 // scratch. 205 if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) { 206 psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes, 207 PSPHOT_RECIPE); // Recipe for psphot 208 if (!psphotRecipe) { 209 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find %s recipe.", PSPHOT_RECIPE); 210 return false; 211 } 212 213 psMetadataAddStr(psphotRecipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, 214 "Break point for psphot operations", "PSFMODEL"); 215 216 pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT"); 217 pmFPACopy(photFile->fpa, outFPA); 218 219 pmFPAview *view = pmFPAviewAlloc(0); // View into skycell 220 if (!psphotReadout(config, view)) { 221 psError(psErrorCodeLast(), false, "Unable to determine PSF for warped image.\n"); 222 psFree(view); 223 return false; 224 } 225 psFree(view); 226 227 pmFPAfileActivate(config->files, false, "PSPHOT.INPUT"); 228 } 229 200 230 output->data_exists = true; 201 231 outCell->data_exists = true; 202 232 outChip->data_exists = true; 203 233 204 #if 0205 float gain = 0.0, readnoise = 0.0, saturation = INFINITY, exposure = 0.0, darktime = 0.0;206 double mjd = 0.0;207 #endif208 209 #if 0210 // XXX Hack so that INSTRUME header keyword and the like are not updated properly211 // If INSTRUME (etc) is updated, then the FITS file with the warped image will be often212 // recognised as coming from the old camera, not the new, warped camera.213 // The proper solution to this, I believe, would be to define a skycell derivative of the214 // old camera, so that the skycell can be recognised as coming from the old camera (and would215 // also therefore inherit all its recipes, which would be good), rather than having a completely216 // different camera. That will take some work; the below solution should be good enough for now.217 {218 psMetadataItem *item; // Concepts item to update219 220 item = psMetadataLookup(outFPA->concepts, "FPA.INSTRUMENT");221 psFree(item->data.V);222 item->data.V = NULL;223 224 item = psMetadataLookup(outFPA->concepts, "FPA.DETECTOR");225 psFree(item->data.V);226 item->data.V = NULL;227 }228 #endif229 234 230 235 // Perform statistics on the output image -
trunk/pswarp/src/pswarpParseCamera.c
r14768 r14874 4 4 5 5 bool status; 6 bool mdok; // Status of MD lookup 6 7 pmFPAfile *skycell = NULL; 7 8 pmConfig *skyConfig = NULL; … … 89 90 } 90 91 92 if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) { 93 // This file, PSPHOT.INPUT, is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by 94 // psphotDefineFiles 95 pmFPAfile *psphotInput = pmFPAfileDefineFromFPA(config, output->fpa, 1, 1, "PSPHOT.INPUT"); 96 if (!psphotInput) { 97 psError(PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.INPUT")); 98 return false; 99 } 100 101 // Define associated psphot input/output files 102 if (!psphotDefineFiles(config, psphotInput)) { 103 psError(PSPHOT_ERR_CONFIG, false, 104 "Unable to define the additional input/output files for psphot"); 105 return false; 106 } 107 } 91 108 92 109 // Chip selection: turn on only the chips specified 93 bool mdok; // Status of MD lookup94 110 char *chipLine = psMetadataLookupStr(&mdok, config->arguments, "CHIP_SELECTIONS"); 95 111 if (mdok) { -
trunk/pswarp/src/pswarpTransformReadout_Opt.c
r14800 r14874 11 11 psTimerStart ("warp"); 12 12 13 // Get grid size 13 // Get warp parameters 14 bool mdok; 14 15 int nGridX = psMetadataLookupS32(NULL, config->arguments, "GRID.NX"); 15 16 int nGridY = psMetadataLookupS32(NULL, config->arguments, "GRID.NY"); … … 145 146 146 147 // Transform sources 147 bool mdok;148 148 psArray *inSources = psMetadataLookupPtr(&mdok, input->analysis, "PSPHOT.SOURCES"); // Sources in source 149 149 if (goodPixels && mdok && inSources) {
Note:
See TracChangeset
for help on using the changeset viewer.
