Changeset 39653
- Timestamp:
- Aug 9, 2016, 12:40:45 PM (10 years ago)
- Location:
- branches/czw_branch/20160809
- Files:
-
- 6 edited
-
psModules/src/astrom/pmAstrometryObjects.c (modified) (5 diffs)
-
psModules/src/astrom/pmAstrometryObjects.h (modified) (1 diff)
-
psastro/src/psastro.h (modified) (1 diff)
-
psastro/src/psastroChipAstrom.c (modified) (2 diffs)
-
psastro/src/psastroConvert.c (modified) (4 diffs)
-
psastro/src/psastroLoadRefstars.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20160809/psModules/src/astrom/pmAstrometryObjects.c
r36834 r39653 252 252 y->data.F32[i] = refStar->FP->y; 253 253 254 wt->data.F32[i] = 1.0 ;254 wt->data.F32[i] = 1.01 - exp(-10.0*PS_SQR(refStar->magCal - rawStar->magCal)); // sigma = 0.22 mag 255 255 } 256 256 … … 657 657 obj->Color= 0; 658 658 obj->dMag = 0; 659 obj->magCal = 0; 659 660 660 661 return (obj); … … 685 686 obj->Color = old->Color; 686 687 obj->dMag = old->dMag; 688 obj->magCal = old->magCal; 687 689 688 690 return(obj); … … 816 818 } 817 819 820 int Npts = 10 * exp(-10.0*PS_SQR(ob1->magCal - ob2->magCal)); // sigma = 0.22 mag 821 818 822 // accumulate bin stats 819 NP[iY][iX] + +;820 DX[iY][iX] += dX ;821 DY[iY][iX] += dY ;822 D2[iY][iX] += PS_SQR(dX ) + PS_SQR(dY);823 NP[iY][iX] += Npts; 824 DX[iY][iX] += dX*Npts; 825 DY[iY][iX] += dY*Npts; 826 D2[iY][iX] += PS_SQR(dX*Npts) + PS_SQR(dY*Npts); 823 827 } 824 828 } … … 1079 1083 continue; 1080 1084 1081 xHist->data.F32[xBin] += 1.0; 1082 yHist->data.F32[yBin] += 1.0; 1085 int Npts = 10 * exp(-10.0*PS_SQR(ob1->magCal - ob2->magCal)); // sigma = 0.22 mag 1086 1087 xHist->data.F32[xBin] += Npts; 1088 yHist->data.F32[yBin] += Npts; 1083 1089 } 1084 1090 } -
branches/czw_branch/20160809/psModules/src/astrom/pmAstrometryObjects.h
r36834 r39653 43 43 float dMag; ///< error on object magnitude 44 44 float SBinst; ///< surface brightness, used for Koppenhoefer correction 45 float magCal; ///< object calibrated magnitude in extracted filter 45 46 } 46 47 pmAstromObj; -
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.
