Changeset 36834 for trunk/psModules
- Timestamp:
- Jun 7, 2014, 6:37:32 AM (12 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 21 edited
- 2 copied
-
astrom/Makefile.am (modified) (2 diffs)
-
astrom/pmAstrometryModel.c (modified) (2 diffs)
-
astrom/pmAstrometryModel.h (modified) (1 diff)
-
astrom/pmAstrometryObjects.c (modified) (2 diffs)
-
astrom/pmAstrometryObjects.h (modified) (1 diff)
-
astrom/pmAstrometryVisual.c (modified) (3 diffs)
-
astrom/pmKHcorrect.c (copied) (copied from branches/eam_branches/ipp-20140423/psModules/src/astrom/pmKHcorrect.c )
-
astrom/pmKHcorrect.h (copied) (copied from branches/eam_branches/ipp-20140423/psModules/src/astrom/pmKHcorrect.h )
-
camera/pmFPAfile.c (modified) (3 diffs)
-
camera/pmFPAfile.h (modified) (1 diff)
-
camera/pmFPAfileFitsIO.c (modified) (1 diff)
-
camera/pmFPAfileIO.c (modified) (9 diffs)
-
concepts/pmConcepts.c (modified) (1 diff)
-
concepts/pmConcepts.h (modified) (1 diff)
-
detrend/pmDetrendDB.c (modified) (1 diff)
-
detrend/pmDetrendDB.h (modified) (1 diff)
-
extras/pmVisual.c (modified) (1 diff)
-
extras/pmVisual.h (modified) (2 diffs)
-
objects/pmModel.c (modified) (1 diff)
-
objects/pmPSFtryMakePSF.c (modified) (1 diff)
-
objects/pmSourceIO_MatchedRefs.c (modified) (2 diffs)
-
objects/pmSourceVisual.c (modified) (1 diff)
-
psmodules.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/Makefile.am
r20801 r36834 11 11 pmAstrometryRefstars.c \ 12 12 pmAstrometryWCS.c \ 13 pmAstrometryVisual.c 13 pmAstrometryVisual.c \ 14 pmKHcorrect.c 14 15 15 16 pkginclude_HEADERS = \ … … 21 22 pmAstrometryRefstars.h \ 22 23 pmAstrometryWCS.h \ 23 pmAstrometryVisual.h 24 pmAstrometryVisual.h \ 25 pmKHcorrect.h 24 26 25 27 CLEANFILES = *~ -
trunk/psModules/src/astrom/pmAstrometryModel.c
r26260 r36834 39 39 #include "pmFPAExtent.h" 40 40 #include "pmFPAfileFitsIO.h" 41 #include "pmConcepts.h" 41 42 #include "pmAstrometryWCS.h" 42 43 #include "pmAstrometryUtils.h" … … 452 453 } 453 454 454 int pmConceptsChipNumberFromName (pmFPA *fpa, char *name) {455 456 for (int i = 0; i < fpa->chips->n; i++) {457 pmChip *chip = fpa->chips->data[i];458 if (!chip) continue;459 char *thisone = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");460 if (!thisone) continue;461 if (!strcmp (name, thisone)) return (i);462 }463 return -1;464 }465 466 pmChip *pmConceptsChipFromName (pmFPA *fpa, char *name) {467 468 for (int i = 0; i < fpa->chips->n; i++) {469 pmChip *chip = fpa->chips->data[i];470 if (!chip) continue;471 char *thisone = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");472 if (!thisone) continue;473 if (!strcmp (name, thisone)) return (chip);474 }475 return NULL;476 }477 478 455 // first layer converts Chip to Focal Plane 479 456 bool pmAstromModelReadChips (pmFPAfile *file) { -
trunk/psModules/src/astrom/pmAstrometryModel.h
r18601 r36834 27 27 bool pmAstromModelWriteChips (pmFPAfile *file); 28 28 29 int pmConceptsChipNumberFromName (pmFPA *fpa, char *name);30 pmChip *pmConceptsChipFromName (pmFPA *fpa, char *name);31 32 29 bool pmAstromModelReadForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config); 33 30 bool pmAstromModelReadFPA (pmFPAfile *file); -
trunk/psModules/src/astrom/pmAstrometryObjects.c
r31671 r36834 571 571 psMemSetDeallocator (stats, (psFreeFunc)pmAstromStatsFree); 572 572 573 // stats->center = {0, 0, 0, 0}; 574 // stats->offset = {0, 0, 0, 0}; 575 stats->angle = 0.0; 576 stats->scale = 1.0; 577 stats->minMetric = 0.0; 578 stats->minVar = 0.0; 579 stats->nMatch = 0; 580 stats->nTest = 0; 581 stats->nSigma = 0; 573 stats->center.x = 0; 574 stats->center.y = 0; 575 stats->center.xErr = 0; 576 stats->center.yErr = 0; 577 578 stats->offset.x = 0; 579 stats->offset.y = 0; 580 stats->offset.xErr = 0; 581 stats->offset.yErr = 0; 582 583 stats->angle = 0.0; 584 stats->scale = 1.0; 585 stats->minMetric = 0.0; 586 stats->minVar = 0.0; 587 stats->nMatch = 0; 588 stats->nTest = 0; 589 stats->nSigma = 0; 582 590 583 591 return (stats); … … 914 922 // fprintf (stderr, "sigma: nMatch: %d, nTest: %d, nTen: %d\n", stats->nMatch, stats->nTest, sort->data.U32[sort->n - 10]); 915 923 916 917 psFree (sort); 924 psFree (sort); 918 925 psFree (listNP); 919 926 psFree (gridNP); -
trunk/psModules/src/astrom/pmAstrometryObjects.h
r26260 r36834 42 42 float Color; ///< object color 43 43 float dMag; ///< error on object magnitude 44 float SBinst; ///< surface brightness, used for Koppenhoefer correction 44 45 } 45 46 pmAstromObj; -
trunk/psModules/src/astrom/pmAstrometryVisual.c
r35768 r36834 946 946 KapaSendLabel (kapa2, "X (FP)", KAPA_LABEL_XM); 947 947 KapaSendLabel (kapa2, "Y (FP)", KAPA_LABEL_YM); 948 KapaSendLabel (kapa2, "pmAstromGridAngle re siduals. Box: Correlation Peak.", KAPA_LABEL_XP);948 KapaSendLabel (kapa2, "pmAstromGridAngle red: raw, black: ref.", KAPA_LABEL_XP); 949 949 950 950 // plot the REF data. (also calculate the plot ranges, accumulate the plot vectors) … … 966 966 KapaSetLimits(kapa2, &graphdata); 967 967 968 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN );968 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN | PS_STAT_MIN | PS_STAT_MAX ); 969 969 psVectorStats (stats, zPlot, NULL, NULL, 0); 970 float zero = stats->sampleMedian + 3.0; 971 float range = 6.0; 972 970 float range = stats->max - stats->min; 971 range = PS_MAX (0.5, PS_MIN (6.0, range)); 972 float zero = stats->sampleMedian + 0.25*range; 973 974 float maxZ = zPlot->data.F32[0], minZ = zPlot->data.F32[0]; 973 975 for (int i = 0; i < zPlot->n; i++) { 976 maxZ = PS_MAX (maxZ, zPlot->data.F32[i]); 977 minZ = PS_MIN (minZ, zPlot->data.F32[i]); 974 978 float value = (zero - zPlot->data.F32[i]) / range; 975 979 zPlot->data.F32[i] = PS_MAX(0.0, PS_MIN(1.0, value)); 976 980 } 981 fprintf (stderr, "ref mags: %f to %f (%f median)\n", minZ, maxZ, stats->sampleMedian); 977 982 978 983 // the point size will be scaled from the z vector … … 998 1003 psStatsInit(stats); 999 1004 psVectorStats (stats, zPlot, NULL, NULL, 0); 1000 zero = stats->sampleMedian + 3.0; 1001 range = 6.0; 1002 1005 range = stats->max - stats->min; 1006 range = PS_MAX (0.5, PS_MIN (6.0, range)); 1007 zero = stats->sampleMedian + 0.25*range; 1008 // zero = stats->sampleMedian + 1.0; 1009 // range = 6.0; 1010 1011 maxZ = zPlot->data.F32[0], minZ = zPlot->data.F32[0]; 1003 1012 for (int i = 0; i < zPlot->n; i++) { 1013 maxZ = PS_MAX (maxZ, zPlot->data.F32[i]); 1014 minZ = PS_MIN (minZ, zPlot->data.F32[i]); 1004 1015 float value = (zero - zPlot->data.F32[i]) / range; 1005 1016 zPlot->data.F32[i] = PS_MAX(0.0, PS_MIN(1.0, value)); 1006 1017 } 1018 fprintf (stderr, "raw mags: %f to %f (%f median)\n", minZ, maxZ, stats->sampleMedian); 1007 1019 1008 1020 // the point size will be scaled from the z vector -
trunk/psModules/src/camera/pmFPAfile.c
r36441 r36834 531 531 return PM_FPA_FILE_LINEARITY; 532 532 } 533 // deprecate this?534 533 if (!strcasecmp(type, "ASTROM")) { 535 return PM_FPA_FILE_ASTROM_MODEL;534 return PM_FPA_FILE_ASTROM_MODEL; 536 535 } 537 536 if (!strcasecmp(type, "ASTROM.MODEL")) { … … 540 539 if (!strcasecmp(type, "ASTROM.REFSTARS")) { 541 540 return PM_FPA_FILE_ASTROM_REFSTARS; 541 } 542 if (!strcasecmp(type, "KH.CORRECT")) { 543 return PM_FPA_FILE_KH_CORRECT; 542 544 } 543 545 if (!strcasecmp(type, "SUBKERNEL")) { … … 593 595 case PM_FPA_FILE_ASTROM_REFSTARS: 594 596 return ("ASTROM.REFSTARS"); 597 case PM_FPA_FILE_KH_CORRECT: 598 return ("KH.CORRECT"); 595 599 case PM_FPA_FILE_SUBKERNEL: 596 600 return ("SUBKERNEL"); -
trunk/psModules/src/camera/pmFPAfile.h
r36375 r36834 48 48 PM_FPA_FILE_ASTROM_MODEL, 49 49 PM_FPA_FILE_ASTROM_REFSTARS, 50 PM_FPA_FILE_KH_CORRECT, 50 51 PM_FPA_FILE_SUBKERNEL, 51 52 PM_FPA_FILE_SRCTEXT, -
trunk/psModules/src/camera/pmFPAfileFitsIO.c
r29833 r36834 150 150 case PM_FPA_FILE_PSF: 151 151 case PM_FPA_FILE_ASTROM_MODEL: 152 case PM_FPA_FILE_ASTROM_REFSTARS: { 152 case PM_FPA_FILE_ASTROM_REFSTARS: 153 case PM_FPA_FILE_KH_CORRECT: 154 { 153 155 pmHDU *hdu = pmFPAviewThisHDU(view, fpa); 154 156 if (hdu) { -
trunk/psModules/src/camera/pmFPAfileIO.c
r36623 r36834 48 48 #include "pmPSF_IO.h" 49 49 50 #include "pmKHcorrect.h" 50 51 #include "pmAstrometryModel.h" 51 52 #include "pmAstrometryRefstars.h" … … 234 235 status = pmAstromModelReadForView (view, file, config); 235 236 break; 237 case PM_FPA_FILE_KH_CORRECT: 238 status = pmKHcorrectReadForView (view, file, config); 239 break; 236 240 case PM_FPA_FILE_EXPNUM: 237 241 status = pmExpNumRead(view, file, config); … … 324 328 case PM_FPA_FILE_ASTROM_MODEL: 325 329 case PM_FPA_FILE_ASTROM_REFSTARS: 330 case PM_FPA_FILE_KH_CORRECT: 326 331 case PM_FPA_FILE_JPEG: 327 332 case PM_FPA_FILE_KAPA: … … 408 413 } 409 414 } 415 if (file->type == PM_FPA_FILE_KH_CORRECT) { 416 psTrace("psModules.camera", 6, "skip write for %s, no write function defined", file->name); 417 return true; 418 } 410 419 411 420 // open the file if not yet opened … … 500 509 case PM_FPA_FILE_ASTROM_REFSTARS: 501 510 status = pmAstromRefstarsWriteForView (view, file, config); 511 break; 512 513 case PM_FPA_FILE_KH_CORRECT: 514 psError(PS_ERR_IO, true, "cannot write type KH.CORRECT (%s)", file->name); 502 515 break; 503 516 … … 576 589 case PM_FPA_FILE_ASTROM_MODEL: 577 590 case PM_FPA_FILE_ASTROM_REFSTARS: 591 case PM_FPA_FILE_KH_CORRECT: 578 592 case PM_FPA_FILE_LINEARITY: 579 593 case PM_FPA_FILE_EXPNUM: … … 653 667 case PM_FPA_FILE_ASTROM_MODEL: 654 668 case PM_FPA_FILE_ASTROM_REFSTARS: 669 case PM_FPA_FILE_KH_CORRECT: 655 670 case PM_FPA_FILE_EXPNUM: 656 671 psTrace ("psModules.camera", 6, "NOT freeing %s (%s) : save for further analysis\n", file->filename, file->name); … … 815 830 case PM_FPA_FILE_ASTROM_MODEL: 816 831 case PM_FPA_FILE_ASTROM_REFSTARS: 832 case PM_FPA_FILE_KH_CORRECT: 817 833 case PM_FPA_FILE_LINEARITY: 818 834 case PM_FPA_FILE_EXPNUM: … … 1018 1034 case PM_FPA_FILE_EXPNUM: 1019 1035 case PM_FPA_FILE_ASTROM_MODEL: 1036 case PM_FPA_FILE_KH_CORRECT: 1020 1037 case PM_FPA_FILE_SX: 1021 1038 case PM_FPA_FILE_RAW: -
trunk/psModules/src/concepts/pmConcepts.c
r30049 r36834 578 578 } 579 579 580 int pmConceptsChipNumberFromName (pmFPA *fpa, char *name) { 581 582 for (int i = 0; i < fpa->chips->n; i++) { 583 pmChip *chip = fpa->chips->data[i]; 584 if (!chip) continue; 585 char *thisone = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 586 if (!thisone) continue; 587 if (!strcmp (name, thisone)) return (i); 588 } 589 return -1; 590 } 591 592 pmChip *pmConceptsChipFromName (pmFPA *fpa, char *name) { 593 594 for (int i = 0; i < fpa->chips->n; i++) { 595 pmChip *chip = fpa->chips->data[i]; 596 if (!chip) continue; 597 char *thisone = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 598 if (!thisone) continue; 599 if (!strcmp (name, thisone)) return (chip); 600 } 601 return NULL; 602 } 603 -
trunk/psModules/src/concepts/pmConcepts.h
r22699 r36834 161 161 ); 162 162 163 // some utility functions: 164 int pmConceptsChipNumberFromName (pmFPA *fpa, char *name); 165 pmChip *pmConceptsChipFromName (pmFPA *fpa, char *name); 166 163 167 /// @} 164 168 #endif -
trunk/psModules/src/detrend/pmDetrendDB.c
r35531 r36834 111 111 DETREND_STRING_CASE(LINEARITY); 112 112 DETREND_STRING_CASE(AUXMASK); 113 DETREND_STRING_CASE(KH_CORRECT); 113 114 default: 114 115 return NULL; -
trunk/psModules/src/detrend/pmDetrendDB.h
r35531 r36834 40 40 PM_DETREND_TYPE_LINEARITY, 41 41 PM_DETREND_TYPE_AUXMASK, 42 PM_DETREND_TYPE_KH_CORRECT, 42 43 } pmDetrendType; 43 44 -
trunk/psModules/src/extras/pmVisual.c
r36623 r36834 162 162 163 163 164 // ask the user to continue or not. give up after 2 seconds. 165 bool pmVisualAskUserOrDump(bool *plotFlag, bool *dumpData) 166 { 167 struct timeval timeout; 168 fd_set fdSet; 169 int status; 170 171 if (dumpData) *dumpData = false; 172 173 char key[10]; 174 if (plotFlag && dumpData) { 175 fprintf (stderr, "[p]ause? [c]ontinue? [s]kip the rest of these plots? [d]ump the data? [a]bort all visual plots? (c) "); 176 } 177 if (plotFlag && !dumpData) { 178 fprintf (stderr, "[p]ause? [c]ontinue? [s]kip the rest of these plots? [a]bort all visual plots? (c) "); 179 } 180 if (!plotFlag && dumpData) { 181 fprintf (stderr, "[p]ause? [c]ontinue? [d]ump the data? [a]bort all visual plots? (c) "); 182 } 183 if (!plotFlag && !dumpData) { 184 fprintf (stderr, "[p]ause? [c]ontinue? [a]bort all visual plots? (c) "); 185 } 186 187 /* Wait up to 1.0 second for a response, then continue */ 188 timeout.tv_sec = 10; 189 timeout.tv_usec = 0; 190 191 FD_ZERO (&fdSet); 192 FD_SET (STDIN_FILENO, &fdSet); 193 194 status = select (1, &fdSet, NULL, NULL, &timeout); 195 if (status <= 0) { 196 fprintf (stderr, "\n"); 197 return true; // if no data, give up 198 } 199 200 while (true) { 201 if (!fgets(key, 8, stdin)) { 202 psWarning("Unable to read option"); 203 } 204 switch (key[0]) { 205 case 's': 206 if (plotFlag) *plotFlag = false; 207 return true; 208 case 'd': 209 if (dumpData) *dumpData = true; 210 return true; 211 case 'a': 212 isVisual = false; 213 return true; 214 case 'c': 215 case '\n': 216 return true; 217 default: 218 break; 219 } 220 221 if (plotFlag && dumpData) { 222 fprintf (stderr, "[p]ause? [c]ontinue? [s]kip the rest of these plots? [d]ump the data? [a]bort all visual plots? (c) "); 223 } 224 if (plotFlag && !dumpData) { 225 fprintf (stderr, "[p]ause? [c]ontinue? [s]kip the rest of these plots? [a]bort all visual plots? (c) "); 226 } 227 if (!plotFlag && dumpData) { 228 fprintf (stderr, "[p]ause? [c]ontinue? [d]ump the data? [a]bort all visual plots? (c) "); 229 } 230 if (!plotFlag && !dumpData) { 231 fprintf (stderr, "[p]ause? [c]ontinue? [a]bort all visual plots? (c) "); 232 } 233 } 234 return true; 235 } 236 164 237 bool pmVisualImStats(psImage *image, double *mean, double *stdev, double *min, double *max) { 165 238 -
trunk/psModules/src/extras/pmVisual.h
r30623 r36834 52 52 */ 53 53 bool pmVisualAskUser(bool *plotFlag); 54 55 56 /** Ask the user how to proceed. 57 * At the user's request, this will disable diagnostic plotting. 58 * @param plotFlag, set to false if this plot should be disabled in the future 59 * @param dumpData, set to true if user requests a data dump 60 */ 61 bool pmVisualAskUserOrDump(bool *plotFlag, bool *dumpData); 54 62 55 63 … … 138 146 bool pmVisualInitGraph (int kapa, void *section, void *graphdata); 139 147 bool pmVisualAskUser(bool *plotFlag); 148 bool pmVisualAskUserOrDump(bool *plotFlag, bool *dumpData); 140 149 bool pmVisualScaleImage(int kapaFD, psImage *inImage, 141 150 const char *name, int channel, bool clip); -
trunk/psModules/src/objects/pmModel.c
r36375 r36834 39 39 { 40 40 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 41 if (!tmp) return; 42 41 43 psFree(tmp->params); 42 44 psFree(tmp->dparams); -
trunk/psModules/src/objects/pmPSFtryMakePSF.c
r36623 r36834 220 220 } 221 221 222 // weed out extreme e0 outliers here: find the median and exclude points not in the 223 // range MEDIAN / 5 < e0 < 5 * MEDIAN 224 { 225 psStats *e0stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN); 226 if (psVectorStats (e0stats, e0, NULL, srcMask, 0xff)) { 227 float e0med = e0stats->sampleMedian; 228 229 for (int i = 0; i < sources->n; i++) { 230 // skip any masked sources (failed to fit one of the model steps or get a magnitude) 231 if (srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue; 232 233 if (e0->data.F32[i] < 0.2*e0med) { 234 srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_OUTLIER; 235 } 236 if (e0->data.F32[i] > 5.0*e0med) { 237 srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_OUTLIER; 238 } 239 } 240 } 241 psFree (e0stats); 242 } 243 222 244 // we run 'clipIter' cycles clipping in each of x and y, with only one iteration each. 223 245 // This way, the parameters masked by one of the fits will be applied to the others -
trunk/psModules/src/objects/pmSourceIO_MatchedRefs.c
r36623 r36834 99 99 100 100 // select the raw objects for this readout 101 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS ");101 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS.SUBSET"); 102 102 if (rawstars == NULL) continue; 103 103 104 104 // select the raw objects for this readout 105 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS ");105 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET"); 106 106 if (refstars == NULL) continue; 107 107 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n); 108 109 # if (0)110 // XXX test111 FILE *outfile = fopen ("refstars.dat", "w");112 assert (outfile);113 for (int nn = 0; nn < refstars->n; nn++) {114 pmAstromObj *ref = refstars->data[nn];115 fprintf (outfile, "%lf %lf\n", ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD);116 }117 fclose (outfile);118 # endif119 108 120 109 psArray *matches = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.MATCH"); … … 128 117 129 118 psMetadata *row = psMetadataAlloc (); 130 psMetadataAdd (row, PS_LIST_TAIL, "RA", PS_DATA_F64, "right ascension (deg, J2000)", PM_DEG_RAD*ref->sky->r); 131 psMetadataAdd (row, PS_LIST_TAIL, "DEC", PS_DATA_F64, "declination (deg, J2000)", PM_DEG_RAD*ref->sky->d); 132 psMetadataAdd (row, PS_LIST_TAIL, "X_CHIP", PS_DATA_F32, "x coord on chip", raw->chip->x); 133 psMetadataAdd (row, PS_LIST_TAIL, "Y_CHIP", PS_DATA_F32, "y coord on chip", raw->chip->y); 134 psMetadataAdd (row, PS_LIST_TAIL, "X_CHIP_FIT",PS_DATA_F32, "x fitted coord on chip", ref->chip->x); 135 psMetadataAdd (row, PS_LIST_TAIL, "Y_CHIP_FIT",PS_DATA_F32, "y fitted coord on chip", ref->chip->y); 136 psMetadataAdd (row, PS_LIST_TAIL, "X_FPA", PS_DATA_F32, "x coord on focal plane", raw->FP->x); 137 psMetadataAdd (row, PS_LIST_TAIL, "Y_FPA", PS_DATA_F32, "y coord on focal plane", raw->FP->y); 138 psMetadataAdd (row, PS_LIST_TAIL, "MAG_INST", PS_DATA_F32, "instrumental magnitude", raw->Mag); 139 psMetadataAdd (row, PS_LIST_TAIL, "MAG_REF", PS_DATA_F32, "reference star magnitude", ref->Mag); 140 psMetadataAdd (row, PS_LIST_TAIL, "COLOR_REF",PS_DATA_F32, "reference star color", ref->Color); 141 psMetadataAdd (row, PS_LIST_TAIL, "CHIP_ID", PS_DATA_STRING, "chip identifier", chipName); 119 psMetadataAdd (row, PS_LIST_TAIL, "RA_REF", PS_DATA_F64, "right ascension (deg, J2000)", PM_DEG_RAD*ref->sky->r); 120 psMetadataAdd (row, PS_LIST_TAIL, "DEC_REF", PS_DATA_F64, "declination (deg, J2000)", PM_DEG_RAD*ref->sky->d); 121 psMetadataAdd (row, PS_LIST_TAIL, "X_CHIP_REF", PS_DATA_F32, "x fitted coord on chip", ref->chip->x); 122 psMetadataAdd (row, PS_LIST_TAIL, "Y_CHIP_REF", PS_DATA_F32, "y fitted coord on chip", ref->chip->y); 123 psMetadataAdd (row, PS_LIST_TAIL, "X_CHIP_RAW", PS_DATA_F32, "x coord on chip", raw->chip->x); 124 psMetadataAdd (row, PS_LIST_TAIL, "Y_CHIP_RAW", PS_DATA_F32, "y coord on chip", raw->chip->y); 125 psMetadataAdd (row, PS_LIST_TAIL, "X_FPA_RAW", PS_DATA_F32, "x coord on focal plane", raw->FP->x); 126 psMetadataAdd (row, PS_LIST_TAIL, "Y_FPA_RAW", PS_DATA_F32, "y coord on focal plane", raw->FP->y); 127 psMetadataAdd (row, PS_LIST_TAIL, "X_TPA_RAW", PS_DATA_F32, "x coord on focal plane", raw->TP->x); 128 psMetadataAdd (row, PS_LIST_TAIL, "Y_TPA_RAW", PS_DATA_F32, "y coord on focal plane", raw->TP->y); 129 psMetadataAdd (row, PS_LIST_TAIL, "MAG_INST", PS_DATA_F32, "instrumental magnitude", raw->Mag); 130 psMetadataAdd (row, PS_LIST_TAIL, "MAG_REF", PS_DATA_F32, "reference star magnitude", ref->Mag); 131 psMetadataAdd (row, PS_LIST_TAIL, "COLOR_REF", PS_DATA_F32, "reference star color", ref->Color); 132 psMetadataAdd (row, PS_LIST_TAIL, "CHIP_ID", PS_DATA_STRING, "chip identifier", chipName); 142 133 // XXX need to add the reference color, but this needs getstar / dvo.photcodes for the reference to be refined. 143 134 -
trunk/psModules/src/objects/pmSourceVisual.c
r36623 r36834 545 545 psFree (model); 546 546 547 bool dumpData = false; 548 547 549 // pause and wait for user input: 548 550 // continue, save (provide name), ?? 549 pmVisualAskUser(&plotPSF); 551 retry: 552 pmVisualAskUserOrDump(&plotPSF, &dumpData); 553 if (dumpData) { 554 char name[128]; 555 fprintf (stderr, "filename: "); 556 int status = fscanf (stdin, "%127s", name); 557 if (status != 1) { 558 fprintf (stderr, "odd response\n"); 559 goto retry; 560 } 561 562 FILE *f = fopen (name, "w"); 563 if (!f) { 564 fprintf (stderr, "cannot open %s for output\n", name); 565 goto retry; 566 } 567 for (int i = 0; i < x->n; i++) { 568 float vModel = pmTrend2DEval (trend, x->data.F32[i], y->data.F32[i]); 569 fprintf (f, "%f %f %f %f %d\n", x->data.F32[i], y->data.F32[i], param->data.F32[i], vModel, mask->data.PS_TYPE_VECTOR_MASK_DATA[i]); 570 } 571 fclose (f); 572 goto retry; 573 } 550 574 551 575 return true; -
trunk/psModules/src/psmodules.h
r36623 r36834 95 95 #include <pmAstrometryDistortion.h> 96 96 #include <pmAstrometryVisual.h> 97 #include <pmKHcorrect.h> 97 98 98 99 // the following headers are from psModule:imcombine
Note:
See TracChangeset
for help on using the changeset viewer.
