IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39653


Ignore:
Timestamp:
Aug 9, 2016, 12:40:45 PM (10 years ago)
Author:
eugene
Message:

modify astrometry chip fitting and grid search weights based on distance from nominal photometry values

Location:
branches/czw_branch/20160809
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20160809/psModules/src/astrom/pmAstrometryObjects.c

    r36834 r39653  
    252252        y->data.F32[i] = refStar->FP->y;
    253253
    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
    255255    }
    256256
     
    657657    obj->Color= 0;
    658658    obj->dMag = 0;
     659    obj->magCal = 0;
    659660
    660661    return (obj);
     
    685686    obj->Color =  old->Color;
    686687    obj->dMag  =  old->dMag;
     688    obj->magCal =  old->magCal;
    687689
    688690    return(obj);
     
    816818            }
    817819
     820            int Npts = 10 * exp(-10.0*PS_SQR(ob1->magCal - ob2->magCal));  // sigma = 0.22 mag
     821
    818822            // 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);
    823827        }
    824828    }
     
    10791083                continue;
    10801084
    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;
    10831089        }
    10841090    }
  • branches/czw_branch/20160809/psModules/src/astrom/pmAstrometryObjects.h

    r36834 r39653  
    4343    float dMag;                         ///< error on object magnitude
    4444    float SBinst;                       ///< surface brightness, used for Koppenhoefer correction
     45    float magCal;                       ///< object calibrated magnitude in extracted filter
    4546}
    4647pmAstromObj;
  • branches/czw_branch/20160809/psastro/src/psastro.h

    r38040 r39653  
    7070bool              psastroCorrectKH (pmConfig *config, pmFPAview *view, pmReadout *readout, psMetadata *recipe, psArray *inStars);
    7171
    72 psArray          *pmSourceToAstromObj (psArray *sources);
     72psArray          *pmSourceToAstromObj (psArray *sources, float MagOffset);
    7373bool              psastroAstromGuess (int *nStars, pmConfig *config);
    7474bool              psastroAstromGuessCheck (pmConfig *config);
  • branches/czw_branch/20160809/psastro/src/psastroChipAstrom.c

    r36914 r39653  
    8585                  for (int nn = 0; nn < refstars->n; nn++) {
    8686                    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",
    8888                             ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD,
    8989                             ref->TP->x, ref->TP->y,
    9090                             ref->FP->x, ref->FP->y,
    91                              ref->chip->x, ref->chip->y);
     91                             ref->chip->x, ref->chip->y, ref->Mag, ref->magCal);
    9292                  }
    9393                  fclose (outfile);
     
    101101                  for (int nn = 0; nn < gridrawstars->n; nn++) {
    102102                    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",
    104104                             ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD,
    105105                             ref->TP->x, ref->TP->y,
    106106                             ref->FP->x, ref->FP->y,
    107                              ref->chip->x, ref->chip->y);
     107                             ref->chip->x, ref->chip->y, ref->Mag, ref->magCal);
    108108                  }
    109109                  fclose (outfile);
  • branches/czw_branch/20160809/psastro/src/psastroConvert.c

    r38040 r39653  
    5151    bool status;
    5252
     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
    5378    // PSPHOT.SOURCES carries the pmSource objects (from psphot analysis or loaded externally)
    5479    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     
    5984
    6085    // convert the pmSource objects into pmAstromObj objects (drop !STAR and SATSTAR?)
    61     psArray *inStars = pmSourceToAstromObj (sources);
     86    psArray *inStars = pmSourceToAstromObj (sources, MagOffset);
    6287
    6388    // apply Koppenhoefer correction if needed
     
    175200
    176201// select a magnitude range?
    177 psArray *pmSourceToAstromObj (psArray *sources) {
     202psArray *pmSourceToAstromObj (psArray *sources, float MagOffset) {
    178203
    179204    psArray *objects = psArrayAllocEmpty (sources->n);
     
    211236        obj->dMag = source->psfMagErr;
    212237        obj->SBinst = source->psfMag + 5.0*log10(axes.major);
     238        obj->magCal = obj->Mag + MagOffset;
    213239
    214240        // XXX do we have the information giving the readout and cell offset?
  • branches/czw_branch/20160809/psastro/src/psastroLoadRefstars.c

    r34967 r39653  
    265265            ref->Color    = 0.0;
    266266        }
     267        ref->magCal   = ref->Mag;
    267268
    268269        // XXX VERY temporary hack to avoid M31 bulge
     
    306307            ref->Color = 0.0;
    307308        }
     309        ref->magCal   = ref->Mag;
    308310
    309311        // XXX VERY temporary hack to avoid M31 bulge
Note: See TracChangeset for help on using the changeset viewer.