Changeset 10214
- Timestamp:
- Nov 27, 2006, 6:37:47 PM (19 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 2 edited
-
ppImageMosaic.c (modified) (1 diff)
-
ppImageOptions.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageMosaic.c
r8751 r10214 3 3 #endif 4 4 5 # include "ppImage.h"5 #include "ppImage.h" 6 6 7 bool ppImageMosaicChip (pmConfig *config, const pmFPAview *view, char *outFile, char *inFile) { 7 bool ppImageMosaicChip(pmConfig *config, const pmFPAview *view, char *outFile, char *inFile) 8 { 9 bool status; // Status of MD lookup 8 10 9 bool status; 10 11 pmFPAfile *in = psMetadataLookupPtr (&status, config->files, inFile); 11 pmFPAfile *in = psMetadataLookupPtr(&status, config->files, inFile); // Input file 12 12 if (!status) { 13 psErrorStackPrint(stderr, "Can't find required I/O file!\n");14 exit(EXIT_FAILURE);13 psErrorStackPrint(stderr, "Can't find required I/O file!\n"); 14 exit(EXIT_FAILURE); 15 15 } 16 16 17 pmFPAfile *out = psMetadataLookupPtr (&status, config->files, outFile);17 pmFPAfile *out = psMetadataLookupPtr(&status, config->files, outFile); // Output file 18 18 if (!status) { 19 psErrorStackPrint(stderr, "Can't find required I/O file!\n");20 exit(EXIT_FAILURE);19 psErrorStackPrint(stderr, "Can't find required I/O file!\n"); 20 exit(EXIT_FAILURE); 21 21 } 22 22 23 pmFPAAddSourceFromView (out->fpa, view, out->format);24 pmChip *outChip = pmFPAviewThisChip (view, out->fpa);25 pmChip *inChip = pmFPAviewThisChip (view, in->fpa);23 pmFPAAddSourceFromView(out->fpa, view, out->format); 24 pmChip *outChip = pmFPAviewThisChip(view, out->fpa); 25 pmChip *inChip = pmFPAviewThisChip(view, in->fpa); 26 26 27 // Copy over concepts 27 28 if (!(out->fpa->conceptsRead & PM_CONCEPT_SOURCE_HEADER)) { 28 psMetadataCopy(out->fpa->concepts, in->fpa->concepts);29 out->fpa->conceptsRead |= PM_CONCEPT_SOURCE_HEADER;29 psMetadataCopy(out->fpa->concepts, in->fpa->concepts); 30 out->fpa->conceptsRead |= PM_CONCEPT_SOURCE_HEADER; 30 31 } 31 32 32 psTrace ("pmChipMosaic", 5, "mosaic chip %s to %s (xbin,ybin: %d,%d to %d,%d)\n", in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin); 33 pmChipMosaic (outChip, inChip); 34 35 return true; 33 psTrace("pmChipMosaic", 5, "mosaic chip %s to %s (xbin,ybin: %d,%d to %d,%d)\n", 34 in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin); 35 return pmChipMosaic(outChip, inChip); 36 36 } 37 37 38 bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile) { 38 bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile) 39 { 40 bool status; // Status of MD lookup 39 41 40 bool status; 41 42 pmFPAfile *in = psMetadataLookupPtr (&status, config->files, inFile); 42 pmFPAfile *in = psMetadataLookupPtr(&status, config->files, inFile); // Input file 43 43 if (!status) { 44 psErrorStackPrint(stderr, "Can't find required I/O file!\n");45 exit(EXIT_FAILURE);44 psErrorStackPrint(stderr, "Can't find required I/O file!\n"); 45 exit(EXIT_FAILURE); 46 46 } 47 47 48 pmFPAfile *out = psMetadataLookupPtr (&status, config->files, outFile);48 pmFPAfile *out = psMetadataLookupPtr(&status, config->files, outFile); // Output file 49 49 if (!status) { 50 psErrorStackPrint(stderr, "Can't find required I/O file!\n");51 exit(EXIT_FAILURE);50 psErrorStackPrint(stderr, "Can't find required I/O file!\n"); 51 exit(EXIT_FAILURE); 52 52 } 53 53 54 54 // XXX test printing of all concepts 55 # if 055 #if 0 56 56 for (int i = 0; i < in->fpa->chips->n; i++) { 57 pmChip *chip = in->fpa->chips->data[i];58 for (int j = 0; j < chip->cells->n; j++) {59 pmCell *cell = chip->cells->data[j];60 psMetadataPrint(stdout, cell->concepts, 2);61 }57 pmChip *chip = in->fpa->chips->data[i]; 58 for (int j = 0; j < chip->cells->n; j++) { 59 pmCell *cell = chip->cells->data[j]; 60 psMetadataPrint(stdout, cell->concepts, 2); 61 } 62 62 } 63 # endif63 #endif 64 64 65 pmFPAview *view = pmFPAviewAlloc (0); 66 pmFPAAddSourceFromView (out->fpa, view, out->format); 65 pmFPAview *view = pmFPAviewAlloc(0); 66 pmFPAAddSourceFromView(out->fpa, view, out->format); 67 psFree(view); 67 68 68 psTrace ("pmFPAMosaic", 5, "mosaic fpa %s to %s (xbin,ybin: %d,%d to %d,%d)\n", in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin); 69 pmFPAMosaic (out->fpa, in->fpa); 70 71 psFree (view); 72 return true; 69 psTrace ("pmFPAMosaic", 5, "mosaic fpa %s to %s (xbin,ybin: %d,%d to %d,%d)\n", 70 in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin); 71 return pmFPAMosaic(out->fpa, in->fpa); 73 72 } -
trunk/ppImage/src/ppImageOptions.c
r9857 r10214 137 137 overscanFit = PM_FIT_SPLINE; 138 138 } else if (strcasecmp(fit, "NONE")) { 139 psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, POLYNOMIAL, or SPLINE", fit, RECIPE_NAME); 139 psLogMsg(__func__, PS_LOG_WARN, 140 "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, POLYNOMIAL, or SPLINE", 141 fit, RECIPE_NAME); 140 142 exit(EXIT_FAILURE); 141 143 } … … 149 151 overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN); 150 152 } else { 151 psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN or MEDIAN", stat, RECIPE_NAME); 153 psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN or MEDIAN", 154 stat, RECIPE_NAME); 152 155 exit(EXIT_FAILURE); 153 156 } … … 173 176 // binned image options 174 177 options->xBin1 = psMetadataLookupS32(&status, recipe, "BIN1.XBIN"); 175 if (!status) options->xBin1 = 16; 178 if (!status) { 179 psWarning("BIN1.XBIN not found in recipe: setting to default value.\n"); 180 options->xBin1 = 16; 181 } 176 182 options->yBin1 = psMetadataLookupS32(&status, recipe, "BIN1.YBIN"); 177 if (!status) options->yBin1 = 16; 183 if (!status) { 184 psWarning("BIN1.YBIN not found in recipe: setting to default value.\n"); 185 options->yBin1 = 16; 186 } 178 187 179 188 options->xBin2 = psMetadataLookupS32(&status, recipe, "BIN2.XBIN"); 180 if (!status) options->xBin1 = 16; 189 if (!status) { 190 psWarning("BIN2.XBIN not found in recipe: setting to default value.\n"); 191 options->xBin1 = 16; 192 } 181 193 options->yBin2 = psMetadataLookupS32(&status, recipe, "BIN2.YBIN"); 182 if (!status) options->yBin1 = 16; 194 if (!status) { 195 psWarning("BIN2.YBIN not found in recipe: setting to default value.\n"); 196 options->yBin1 = 16; 197 } 183 198 184 199 options->BaseFITS = psMetadataLookupBool(NULL, recipe, "BASE.FITS"); … … 196 211 options->doAstromMosaic = psMetadataLookupBool(NULL, recipe, "ASTROM.MOSAIC"); 197 212 if ((options->doAstromChip || options->doAstromMosaic) && !options->doPhotom) { 198 psLogMsg(__func__, PS_LOG_ERROR, "Invalid P hase2 Options: cannot do ASTROMetry without PHOTOMetry");213 psLogMsg(__func__, PS_LOG_ERROR, "Invalid PPIMAGE options: cannot do ASTROMetry without PHOTOMetry"); 199 214 exit(EXIT_FAILURE); 200 215 } … … 202 217 options->doAddstar = psMetadataLookupBool(NULL, recipe, "ADDSTAR"); 203 218 if (options->doAddstar && !(options->doAstromChip || options->doAstromMosaic)) { 204 psLogMsg(__func__, PS_LOG_ERROR, "Invalid P hase2 Options: cannot Addstar without Astrometry");219 psLogMsg(__func__, PS_LOG_ERROR, "Invalid PPIMAGE options: cannot Addstar without Astrometry"); 205 220 exit(EXIT_FAILURE); 206 221 }
Note:
See TracChangeset
for help on using the changeset viewer.
