Changeset 31927
- Timestamp:
- Jul 22, 2011, 5:10:58 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110710/psModules/src/objects
- Files:
-
- 3 deleted
- 4 edited
-
Makefile.am (modified) (1 diff)
-
mksource.pl (modified) (2 diffs)
-
pmSourceIO_CMF.c.in (modified) (5 diffs)
-
pmSourceIO_CMF_PS1_V1.c (deleted)
-
pmSourceIO_CMF_PS1_V2.c (deleted)
-
pmSourceIO_CMF_PS1_V3.c (deleted)
-
pmSourceOutputs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/psModules/src/objects/Makefile.am
r31670 r31927 133 133 134 134 pmSourceIO_CMF_PS1_V1.v1.c : pmSourceIO_CMF.c.in mksource.pl 135 mksource.pl pmSourceIO_CMF.c.in PS1_V1 pmSourceIO_CMF_PS1_V1. v1.c135 mksource.pl pmSourceIO_CMF.c.in PS1_V1 pmSourceIO_CMF_PS1_V1.c 136 136 137 137 pmSourceIO_CMF_PS1_V2.v1.c : pmSourceIO_CMF.c.in mksource.pl 138 mksource.pl pmSourceIO_CMF.c.in PS1_V2 pmSourceIO_CMF_PS1_V2. v1.c138 mksource.pl pmSourceIO_CMF.c.in PS1_V2 pmSourceIO_CMF_PS1_V2.c 139 139 140 140 pmSourceIO_CMF_PS1_V3.v1.c : pmSourceIO_CMF.c.in mksource.pl 141 mksource.pl pmSourceIO_CMF.c.in PS1_V 2 pmSourceIO_CMF_PS1_V3.v1.c141 mksource.pl pmSourceIO_CMF.c.in PS1_V3 pmSourceIO_CMF_PS1_V3.c 142 142 143 143 # EXTRA_DIST = pmErrorCodes.h.in pmErrorCodes.dat pmErrorCodes.c.in -
branches/eam_branches/ipp-20110710/psModules/src/objects/mksource.pl
r31670 r31927 14 14 15 15 # see if we can add in PS1_DV* and PS1_SV* as well... 16 @cmfmodes = ("PS1_V1", 1,16 %cmfmodes = ("PS1_V1", 1, 17 17 "PS1_V2", 2, 18 18 "PS1_V3", 3); 19 20 print "1: $cmfmodes{1}\n"; 21 print "PS1_V1: $cmfmodes{'PS1_V1'}\n"; 19 22 20 23 open (FILE, "$template") || die "failed to open template $template\n"; … … 50 53 51 54 if ($gtMode) { 55 # print "gtMode : $line\n"; 52 56 $thisLevel = $cmfmodes{$gtMode}; 53 57 $myLevel = $cmfmodes{$cmfmode}; 54 if ($thisLevel <= $myLevel) { next; } 55 $line =~ s|\@<\S*\@\s*||; 58 print "gtMode : $gtMode vs $cmfmode, $thisLevel, $myLevel\n"; 59 if ($myLevel <= $thisLevel) { next; } 60 $line =~ s|\@>\S*\@\s*||; 56 61 } 57 62 58 63 if ($ltMode) { 64 # print "ltMode : $line\n"; 59 65 $thisLevel = $cmfmodes{$ltMode}; 60 66 $myLevel = $cmfmodes{$cmfmode}; 61 if ($thisLevel >= $myLevel) { next; } 62 $line =~ s|\@>\S*\@\s*||; 67 print "ltMode : $ltMode vs $cmfmode, $thisLevel, $myLevel\n"; 68 if ($myLevel >= $thisLevel) { next; } 69 $line =~ s|\@<\S*\@\s*||; 63 70 } 64 71 -
branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceIO_CMF.c.in
r31670 r31927 222 222 223 223 // read in a readout from the fits file 224 psArray *pmSourcesRead_CMF_ PS1_V3(psFits *fits, psMetadata *header)224 psArray *pmSourcesRead_CMF_@CMFMODE@ (psFits *fits, psMetadata *header) 225 225 { 226 226 PS_ASSERT_PTR_NON_NULL(fits, false); … … 281 281 // XXX use these to determine PAR[PM_PAR_I0]? 282 282 @ALL@ source->psfMag = psMetadataLookupF32 (&status, row, "PSF_INST_MAG"); 283 @ALL@ source->psfMagErr = psMetadataLookupF32 (&status, row, "PSF_INST_MAG_SIG");283 @ALL@ source->psfMagErr = psMetadataLookupF32 (&status, row, "PSF_INST_MAG_SIG"); 284 284 @ALL@ source->apMag = psMetadataLookupF32 (&status, row, "AP_MAG"); 285 @=PS1_V3@ source->apMagRaw = psMetadataLookupF32 (&status, row, "AP_MAG_RAW"); 286 287 // XXX use these to determine PAR[PM_PAR_I0] if they exist? 288 @=PS1_V3@ source->psfFlux = psMetadataLookupF32 (&status, row, "PSF_INST_FLUX"); 289 @=PS1_V3@ source->psfFluxErr= psMetadataLookupF32 (&status, row, "PSF_INST_FLUX_SIG"); 285 290 286 291 // XXX this scaling is incorrect: does not include the 2 \pi AREA factor … … 353 358 } 354 359 355 bool pmSourcesWrite_CMF_ PS1_V3_XSRC (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)360 bool pmSourcesWrite_CMF_@CMFMODE@_XSRC (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe) 356 361 { 357 362 bool status; … … 541 546 542 547 // XXX this layout is still the same as PS1_DEV_1 543 bool pmSourcesWrite_CMF_ PS1_V3_XFIT (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname)548 bool pmSourcesWrite_CMF_@CMFMODE@_XFIT (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname) 544 549 { 545 550 … … 673 678 } 674 679 675 bool pmSourcesWrite_CMF_ PS1_V3_XRAD(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)680 bool pmSourcesWrite_CMF_@CMFMODE@_XRAD(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe) 676 681 { 677 682 return true; -
branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceOutputs.c
r31451 r31927 181 181 return true; 182 182 } 183 184 bool pmSourceLocalAstrometry (psSphere *ptSky, float *posAngle, float *pltScale, pmChip *chip, float xPos, float yPos) { 185 186 pmFPA *fpa = chip->parent; 187 188 if (!chip->toFPA) goto escape; 189 if (!fpa->toTPA) goto escape; 190 if (!fpa->toSky) goto escape; 191 192 // generate RA,DEC 193 psPlane ptCH, ptFP, ptTP_o, ptTP_x, ptTP_y; 194 195 // calculate the astrometry for the coordinate of interest 196 ptCH.x = xPos; 197 ptCH.y = yPos; 198 psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH); 199 psPlaneTransformApply (&ptTP_o, fpa->toTPA, &ptFP); 200 psDeproject (ptSky, &ptTP_o, fpa->toSky); 201 202 // calculate the astrometry for the coordinate + 1pix in X 203 ptCH.x = xPos + 1.0; 204 ptCH.y = yPos; 205 psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH); 206 psPlaneTransformApply (&ptTP_x, fpa->toTPA, &ptFP); 207 208 // calculate the astrometry for the coordinate + 1pix in Y 209 ptCH.x = xPos; 210 ptCH.y = yPos + 1.0; 211 psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH); 212 psPlaneTransformApply (&ptTP_y, fpa->toTPA, &ptFP); 213 214 // the resulting Tangent Plane coordinates are in TP pixels; convert to local Tangent Plane 215 // degrees 216 217 float dTPx_dCHx = fpa->toSky->Xs * (ptTP_x.x - ptTP_o.x); 218 float dTPy_dCHx = fpa->toSky->Ys * (ptTP_x.y - ptTP_o.y); 219 220 float dTPx_dCHy = fpa->toSky->Xs * (ptTP_y.x - ptTP_o.x); 221 float dTPy_dCHy = fpa->toSky->Ys * (ptTP_y.y - ptTP_o.y); 222 223 float pltScale_x = hypot(dTPx_dCHx, dTPy_dCHx); 224 float pltScale_y = hypot(dTPx_dCHy, dTPy_dCHy); 225 *pltScale = 0.5*(pltScale_x + pltScale_y); 226 227 float posAngle_x = atan2 (+dTPy_dCHx, +dTPx_dCHx); 228 float posAngle_y = atan2 (-dTPy_dCHy, +dTPx_dCHy); 229 *posAngle = 0.5*(posAngle_x + posAngle_y); 230 231 return true; 232 233 escape: 234 // no astrometry calibration, give up 235 ptSky->r = NAN; 236 ptSky->d = NAN; 237 *posAngle = NAN; 238 *pltScale = NAN; 239 240 return false; 241 } 242
Note:
See TracChangeset
for help on using the changeset viewer.
