Changeset 19386 for trunk/psastro/src/psastroMosaicAstrom.c
- Timestamp:
- Sep 5, 2008, 7:46:30 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMosaicAstrom.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMosaicAstrom.c
r19310 r19386 2 2 # define NONLIN_TOL 0.001 /* tolerance in pixels */ 3 3 4 bool psastroMosaicFit (pmFPA *fpa, psMetadata *recipe, int pass);4 bool psastroMosaicFit (pmFPA *fpa, psMetadata *recipe, const char *rootname, int pass); 5 5 6 6 // XXX require this fpa to have multiple chip extensions and a PHU? 7 7 bool psastroMosaicAstrom (pmConfig *config) { 8 8 9 bool status; 10 char filename[256]; 11 9 12 // select the current recipe 10 psMetadata *recipe = psMetadataLookupPtr ( NULL, config->recipes, PSASTRO_RECIPE);13 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); 11 14 if (!recipe) { 12 15 psError(PSASTRO_ERR_CONFIG, false, "Can't find PSASTRO recipe!\n"); … … 36 39 # endif 37 40 38 if (!psastroMosaicFit (fpa, recipe, 0)) return false; 39 if (!psastroMosaicFit (fpa, recipe, 1)) return false; 40 if (!psastroMosaicFit (fpa, recipe, 2)) return false; 41 if (!psastroMosaicFit (fpa, recipe, 3)) return false; 41 char *outroot = psMetadataLookupStr (&status, config->arguments, "OUTPUT"); 42 if (!status || !outroot) psAbort ("Can't find outroot on config->arguments"); 43 44 if (!psastroMosaicFit (fpa, recipe, outroot, 0)) return false; 45 if (!psastroMosaicFit (fpa, recipe, outroot, 1)) return false; 46 if (!psastroMosaicFit (fpa, recipe, outroot, 2)) return false; 47 if (!psastroMosaicFit (fpa, recipe, outroot, 3)) return false; 42 48 43 49 // now fit the chips under the common distortion with higher-order terms … … 51 57 return false; 52 58 } 53 if (psTraceGetLevel("psastro.dump") > 0) { psastroDumpMatches (fpa, "match.10.dat"); } 59 if (psTraceGetLevel("psastro.dump") > 0) { 60 snprintf (filename, 256, "%s.10.dat", outroot); 61 psastroDumpMatches (fpa, filename); 62 } 54 63 55 64 // save WCS and analysis metadata in update header. … … 84 93 // 2: match 6,7 85 94 // 3: match 8,9 86 bool psastroMosaicFit (pmFPA *fpa, psMetadata *recipe, int pass) {95 bool psastroMosaicFit (pmFPA *fpa, psMetadata *recipe, const char *rootname, int pass) { 87 96 88 char filename[ 16];97 char filename[256]; 89 98 90 99 // given the existing per-chip astrometry, determine matches between raw and ref stars … … 95 104 } 96 105 97 if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0)) { psastroDumpMatches (fpa, "match.0.dat"); } 106 if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0)) { 107 snprintf (filename, 256, "%s.0.dat", rootname); 108 psastroDumpMatches (fpa, filename); 109 } 98 110 99 111 // fitted chips will follow the local plate-scale, hiding the distortion … … 105 117 } 106 118 107 if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0)) { psastroDumpMatches (fpa, "match.1.dat"); } 119 if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0)) { 120 snprintf (filename, 256, "%s.1.dat", rootname); 121 psastroDumpMatches (fpa, filename); 122 } 108 123 109 124 // fit the distortion by fitting its gradient … … 115 130 } 116 131 117 snprintf (filename, 16, "match.%d.dat", 2*pass + 2);132 snprintf (filename, 256, "%s.%d.dat", rootname, 2*pass + 2); 118 133 if (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0) { psastroDumpMatches (fpa, filename); } 119 134 … … 124 139 } 125 140 126 snprintf (filename, 16, "match.%d.dat", 2*pass + 3);141 snprintf (filename, 256, "%s.%d.dat", rootname, 2*pass + 3); 127 142 if (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 0) { psastroDumpMatches (fpa, filename); } 128 143
Note:
See TracChangeset
for help on using the changeset viewer.
