IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31927


Ignore:
Timestamp:
Jul 22, 2011, 5:10:58 PM (15 years ago)
Author:
eugene
Message:

switch to consolidated, autocoded pmSourceIO_CMF files

Location:
branches/eam_branches/ipp-20110710/psModules/src/objects
Files:
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/psModules/src/objects/Makefile.am

    r31670 r31927  
    133133
    134134pmSourceIO_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.c
     135        mksource.pl pmSourceIO_CMF.c.in PS1_V1 pmSourceIO_CMF_PS1_V1.c
    136136
    137137pmSourceIO_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.c
     138        mksource.pl pmSourceIO_CMF.c.in PS1_V2 pmSourceIO_CMF_PS1_V2.c
    139139
    140140pmSourceIO_CMF_PS1_V3.v1.c : pmSourceIO_CMF.c.in mksource.pl
    141         mksource.pl pmSourceIO_CMF.c.in PS1_V2 pmSourceIO_CMF_PS1_V3.v1.c
     141        mksource.pl pmSourceIO_CMF.c.in PS1_V3 pmSourceIO_CMF_PS1_V3.c
    142142
    143143# EXTRA_DIST = pmErrorCodes.h.in pmErrorCodes.dat pmErrorCodes.c.in
  • branches/eam_branches/ipp-20110710/psModules/src/objects/mksource.pl

    r31670 r31927  
    1414
    1515# see if we can add in PS1_DV* and PS1_SV* as well...
    16 @cmfmodes = ("PS1_V1", 1,
     16%cmfmodes = ("PS1_V1", 1,
    1717             "PS1_V2", 2,
    1818             "PS1_V3", 3);
     19
     20print "1: $cmfmodes{1}\n";
     21print "PS1_V1: $cmfmodes{'PS1_V1'}\n";
    1922
    2023open (FILE, "$template") || die "failed to open template $template\n";
     
    5053
    5154    if ($gtMode) {
     55        # print "gtMode : $line\n";
    5256        $thisLevel = $cmfmodes{$gtMode};
    5357        $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*||;
    5661    }
    5762
    5863    if ($ltMode) {
     64        # print "ltMode : $line\n";
    5965        $thisLevel = $cmfmodes{$ltMode};
    6066        $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*||;
    6370    }
    6471
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceIO_CMF.c.in

    r31670 r31927  
    222222
    223223// read in a readout from the fits file
    224 psArray *pmSourcesRead_CMF_PS1_V3 (psFits *fits, psMetadata *header)
     224psArray *pmSourcesRead_CMF_@CMFMODE@ (psFits *fits, psMetadata *header)
    225225{
    226226    PS_ASSERT_PTR_NON_NULL(fits, false);
     
    281281        // XXX use these to determine PAR[PM_PAR_I0]?
    282282        @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");
    284284        @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");
    285290
    286291        // XXX this scaling is incorrect: does not include the 2 \pi AREA factor
     
    353358}
    354359
    355 bool pmSourcesWrite_CMF_PS1_V3_XSRC (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)
     360bool pmSourcesWrite_CMF_@CMFMODE@_XSRC (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)
    356361{
    357362    bool status;
     
    541546
    542547// 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)
     548bool pmSourcesWrite_CMF_@CMFMODE@_XFIT (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname)
    544549{
    545550
     
    673678}
    674679
    675 bool pmSourcesWrite_CMF_PS1_V3_XRAD(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)
     680bool pmSourcesWrite_CMF_@CMFMODE@_XRAD(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)
    676681{
    677682    return true;
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceOutputs.c

    r31451 r31927  
    181181    return true;
    182182}
     183
     184bool 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
     233escape:
     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.