Changeset 39653 for branches/czw_branch/20160809/psastro
- Timestamp:
- Aug 9, 2016, 12:40:45 PM (10 years ago)
- Location:
- branches/czw_branch/20160809/psastro/src
- Files:
-
- 4 edited
-
psastro.h (modified) (1 diff)
-
psastroChipAstrom.c (modified) (2 diffs)
-
psastroConvert.c (modified) (4 diffs)
-
psastroLoadRefstars.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20160809/psastro/src/psastro.h
r38040 r39653 70 70 bool psastroCorrectKH (pmConfig *config, pmFPAview *view, pmReadout *readout, psMetadata *recipe, psArray *inStars); 71 71 72 psArray *pmSourceToAstromObj (psArray *sources );72 psArray *pmSourceToAstromObj (psArray *sources, float MagOffset); 73 73 bool psastroAstromGuess (int *nStars, pmConfig *config); 74 74 bool psastroAstromGuessCheck (pmConfig *config); -
branches/czw_branch/20160809/psastro/src/psastroChipAstrom.c
r36914 r39653 85 85 for (int nn = 0; nn < refstars->n; nn++) { 86 86 pmAstromObj *ref = refstars->data[nn]; 87 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf \n",87 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf : %f %f\n", 88 88 ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD, 89 89 ref->TP->x, ref->TP->y, 90 90 ref->FP->x, ref->FP->y, 91 ref->chip->x, ref->chip->y );91 ref->chip->x, ref->chip->y, ref->Mag, ref->magCal); 92 92 } 93 93 fclose (outfile); … … 101 101 for (int nn = 0; nn < gridrawstars->n; nn++) { 102 102 pmAstromObj *ref = gridrawstars->data[nn]; 103 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf \n",103 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf : %f %f\n", 104 104 ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD, 105 105 ref->TP->x, ref->TP->y, 106 106 ref->FP->x, ref->FP->y, 107 ref->chip->x, ref->chip->y );107 ref->chip->x, ref->chip->y, ref->Mag, ref->magCal); 108 108 } 109 109 fclose (outfile); -
branches/czw_branch/20160809/psastro/src/psastroConvert.c
r38040 r39653 51 51 bool status; 52 52 53 // XXX I want to make this optional 54 float MagOffset = 0.0; 55 if (1) { 56 // select the input data sources 57 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 58 if (!input) { 59 psError(PSASTRO_ERR_CONFIG, true, "failed to find PSASTRO.INPUT\n"); 60 return false; 61 } 62 pmFPA *fpa = input->fpa; 63 64 float zeropt, exptime; 65 66 // really error-out here? or just skip? 67 if (!psastroZeroPointFromRecipe (&zeropt, &exptime, NULL, fpa, recipe)) { 68 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 69 zeropt = 0.0; 70 exptime = 1.0; 71 } 72 73 // recipe values are given in instrumental magnitudes 74 // use the zero point and exposure time to convert to apparent mags: M_ap = M_inst + C_0 + 2.5*log(exptime) 75 MagOffset = zeropt + 2.5*log10(exptime); 76 } 77 53 78 // PSPHOT.SOURCES carries the pmSource objects (from psphot analysis or loaded externally) 54 79 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); … … 59 84 60 85 // convert the pmSource objects into pmAstromObj objects (drop !STAR and SATSTAR?) 61 psArray *inStars = pmSourceToAstromObj (sources );86 psArray *inStars = pmSourceToAstromObj (sources, MagOffset); 62 87 63 88 // apply Koppenhoefer correction if needed … … 175 200 176 201 // select a magnitude range? 177 psArray *pmSourceToAstromObj (psArray *sources ) {202 psArray *pmSourceToAstromObj (psArray *sources, float MagOffset) { 178 203 179 204 psArray *objects = psArrayAllocEmpty (sources->n); … … 211 236 obj->dMag = source->psfMagErr; 212 237 obj->SBinst = source->psfMag + 5.0*log10(axes.major); 238 obj->magCal = obj->Mag + MagOffset; 213 239 214 240 // XXX do we have the information giving the readout and cell offset? -
branches/czw_branch/20160809/psastro/src/psastroLoadRefstars.c
r34967 r39653 265 265 ref->Color = 0.0; 266 266 } 267 ref->magCal = ref->Mag; 267 268 268 269 // XXX VERY temporary hack to avoid M31 bulge … … 306 307 ref->Color = 0.0; 307 308 } 309 ref->magCal = ref->Mag; 308 310 309 311 // XXX VERY temporary hack to avoid M31 bulge
Note:
See TracChangeset
for help on using the changeset viewer.
