Changeset 39926 for trunk/psastro/src/psastroConvert.c
- Timestamp:
- Jan 6, 2017, 11:30:10 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psastro/src/psastroConvert.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/czw_branch/20160809 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/psastro/src/psastroConvert.c
r38040 r39926 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?
Note:
See TracChangeset
for help on using the changeset viewer.
