IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31334


Ignore:
Timestamp:
Apr 21, 2011, 11:34:02 AM (15 years ago)
Author:
bills
Message:

merge changes to support using a separate list of sources for grid search and fitting

Location:
tags/ipp-20110406
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110406/ippconfig/gpc1/psastro.config

    r31163 r31334  
    1616PSASTRO.GRID.SCALE     F32      50
    1717PSASTRO.GRID.NSTAR.MAX S32     800 # deprecated
    18 PSASTRO.GRID.NREF.MAX  S32     800 # max stars accepted for fitting from ref catalog
    19 PSASTRO.GRID.NRAW.MAX  S32    1200 # max stars accepted for fitting from raw image
     18PSASTRO.GRID.NREF.MAX  S32     800 # max stars accepted for grid search from ref catalog
     19PSASTRO.GRID.NRAW.MAX  S32    1200 # max stars accepted for grid search from raw image
    2020
    2121PSASTRO.MAX.NRAW      S32      1000   # max stars accepted for fitting (0 for all)
     
    2828PSASTRO.MIN.INST.MAG.RAW       F32     -15.0   # min instrumental magnitude for stars accepted for fitting
    2929PSASTRO.MAX.INST.MAG.RAW       F32      -8.0   # max instrumental magnitude for stars accepted for fitting
     30PSASTRO.GRID.MIN.INST.MAG.RAW  F32     -15.0   # min instrumental magnitude for stars accepted for grid search
     31PSASTRO.GRID.MAX.INST.MAG.RAW  F32      -8.0   # max instrumental magnitude for stars accepted for grid search
    3032
    3133PSASTRO.GRID.MIN.ANGLE F32 -1.0 # start angle (degrees)
     
    314316  # allow more stars per chip and boost the density to which we query
    315317  # from the reference database.
    316   PSASTRO.MAX.NRAW      S32      2000   #
    317   PSASTRO.MAX.NREF      S32      8000   # max stars accepted for fitting (0 for all)
    318   DVO.GETSTAR.MAX.RHO   F32      60000.0
     318  PSASTRO.MAX.NRAW               S32      2000   #
     319  PSASTRO.MAX.NREF               S32      8000   # max stars accepted for fitting (0 for all)
     320  # use wider range of magnitudes for grid search
     321  PSASTRO.GRID.MIN.INST.MAG.RAW  F32     -15.0   # min instrumental magnitude for stars accepted for fitting
     322  PSASTRO.GRID.MAX.INST.MAG.RAW  F32     -11.0   # max instrumental magnitude for stars accepted for fitting
     323
     324  # reduce the magnitude range to avoid the bright stars have bad astrometry problem
     325  PSASTRO.MIN.INST.MAG.RAW       F32     -12.0   # min instrumental magnitude for stars accepted for fitting
     326  PSASTRO.MAX.INST.MAG.RAW       F32     -11.0   # min instrumental magnitude for stars accepted for fitting
     327
     328  DVO.GETSTAR.MIN.MAG.INST   F32     -15.0
     329  DVO.GETSTAR.MAX.RHO        F32      60000.0
    319330 
    320331  # the crowding is high, so unless we restrict somewhat tightly early
     
    324335
    325336  # single-chip radius match in pixels
    326   PSASTRO.MATCH.RADIUS.N0 F32    10
     337  PSASTRO.MATCH.RADIUS.N0 F32   10
    327338  PSASTRO.MATCH.RADIUS.N1 F32    5
    328339  PSASTRO.MATCH.RADIUS.N2 F32    5
  • tags/ipp-20110406/ippconfig/recipes/psastro.config

    r31163 r31334  
    8383PSASTRO.MIN.INST.MAG.RAW       F32      0.0   # min instrumental magnitude for stars accepted for fitting
    8484PSASTRO.MAX.INST.MAG.RAW       F32      0.0   # max instrumental magnitude for stars accepted for fitting
     85PSASTRO.GRID.MIN.INST.MAG.RAW       F32      0.0   # min instrumental magnitude for stars accepted for grid search
     86PSASTRO.GRID.MAX.INST.MAG.RAW       F32      0.0   # max instrumental magnitude for stars accepted for grid search
    8587
    8688PSASTRO.MATCH.LUMFUNC  BOOL     FALSE
  • tags/ipp-20110406/psastro/src

  • tags/ipp-20110406/psastro/src/psastroAstromGuess.c

    r23989 r31334  
    161161                    psastroPlotRawstars (rawstars, fpa, chip, recipe);
    162162                }
     163
     164                // Next if we are using a different set of stars for grid search fill out their pmAstromObjs
     165                psArray *grid_rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.GRID.RAWSTARS");
     166                if (grid_rawstars == NULL || grid_rawstars == rawstars) { continue; }
     167
     168                for (int i = 0; i < grid_rawstars->n; i++) {
     169                    pmAstromObj *raw = grid_rawstars->data[i];
     170
     171                    psPlaneTransformApply (raw->FP, chip->toFPA, raw->chip);
     172                    psPlaneTransformApply (raw->TP, fpa->toTPA, raw->FP);
     173                    psDeproject (raw->sky, raw->TP, fpa->toSky);
     174
     175                    // rationalize ra to sky range centered on boresite
     176                    while (raw->sky->r < RAminSky) raw->sky->r += 2.0*M_PI;
     177                    while (raw->sky->r > RAmaxSky) raw->sky->r -= 2.0*M_PI;
     178
     179                    RAmin = PS_MIN (raw->sky->r, RAmin);
     180                    RAmax = PS_MAX (raw->sky->r, RAmax);
     181
     182                    DECmin = PS_MIN (raw->sky->d, DECmin);
     183                    DECmax = PS_MAX (raw->sky->d, DECmax);
     184                }
     185                // XXX: should we plot grid_rawstars?
    163186            }
    164187        }
  • tags/ipp-20110406/psastro/src/psastroChipAstrom.c

    r27639 r31334  
    6060
    6161                // select the raw objects for this readout
     62                psArray *gridrawstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.GRID.RAWSTARS.SUBSET");
     63                if (gridrawstars == NULL) {
     64                    gridrawstars = rawstars;
     65                } else {
     66                    // the absolute minimum number of stars is 4 (for order = 1)
     67                    if (gridrawstars->n < 4) {
     68                        readout->data_exists = false;
     69                        psLogMsg ("psastro", 3, "insufficient gird rawstars (%ld)", gridrawstars->n);
     70                        continue;
     71                    }
     72                }
     73
    6274                psArray *refstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
    6375                if (refstars == NULL) { continue; }
     
    8092
    8193                // XXX update the header with info to reflect the failure
    82                 if (!psastroOneChipGrid (fpa, chip, refstars, rawstars, recipe, updates)) {
     94                if (!psastroOneChipGrid (fpa, chip, refstars, gridrawstars, recipe, updates)) {
    8395                    readout->data_exists = false;
    8496                    psLogMsg ("psastro", 3, "failed to find a solution\n");
  • tags/ipp-20110406/psastro/src/psastroConvert.c

    r31161 r31334  
    1414// leak free 2006.04.27
    1515
     16static psArray * chooseStars(psArray *inStars, char *listName, psArray *sources, psVector *index, int nMax, float iMagMin, float iMagMax, pmSourceMode skip);
     17
    1618bool psastroConvertFPA (pmFPA *fpa, psMetadata *recipe) {
    1719
     
    8789    }
    8890
     91    psArray *rawStars = chooseStars(inStars, "", sources, index, PS_MIN(nMax, inStars->n), iMagMin, iMagMax, skip);
     92    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.RAWSTARS", PS_DATA_ARRAY, "astrometry objects", rawStars);
     93
     94    bool gridSearch = psMetadataLookupBool (&status, recipe, "PSASTRO.GRID.SEARCH");
     95    if (gridSearch) {
     96        // See if different magnitude limits have been specified for grid search. If so, create a separate list of stars to use.
     97        float iGridMagMax = psMetadataLookupF32 (&status, recipe, "PSASTRO.GRID.MAX.INST.MAG.RAW");
     98        float iGridMagMin = psMetadataLookupF32 (&status, recipe, "PSASTRO.GRID.MIN.INST.MAG.RAW");
     99        int   nMaxGrid = psMetadataLookupS32 (&status, recipe, "PSASTRO.GRID.NRAW.MAX");
     100   
     101        // XXX Should we check PSASTRO.GRID.NRAW.MAX != PSASTRO.MAX.NRAW as well? It usually is smaller so that would cause
     102        // us to always create a separate list. So I won't check.
     103
     104        if ((iGridMagMax != iMagMax) || (iGridMagMin != iMagMin)) {
     105            psArray *gridStars = chooseStars(inStars, "grid search ", sources, index, PS_MIN(nMaxGrid, inStars->n), iGridMagMin, iGridMagMax, skip);
     106            psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.GRID.RAWSTARS", PS_DATA_ARRAY, "astrometry objects for grid search", gridStars);
     107            psFree(gridStars);
     108        }
     109    }
     110
     111    psFree (index);
     112    psFree (inStars);
     113    psFree (rawStars);
     114
     115    return true;
     116}
     117
     118
     119psArray * chooseStars(psArray *inStars, char *listName, psArray *sources, psVector *index, int nMax, float iMagMin, float iMagMax, pmSourceMode skip) {
    89120    // choose the first nMax sources
    90121    int j = 0;
    91     psArray *rawStars = psArrayAlloc (PS_MIN (nMax, inStars->n));
     122    psArray *rawStars = psArrayAlloc(nMax);
    92123
    93124    float mMin = +100.0;
     
    128159    rawStars->n = j;
    129160
    130     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.RAWSTARS", PS_DATA_ARRAY, "astrometry objects", rawStars);
    131 
    132     psLogMsg ("psastro", 4, "loaded %ld sources, using %ld of %ld good sources (inst mag: %f to %f)\n", sources->n, rawStars->n, inStars->n, mMin, mMax);
     161    psLogMsg ("psastro", 4, "loaded %ld %ssources, using %ld of %ld good sources (inst mag: %f to %f)\n", sources->n, listName, rawStars->n, inStars->n, mMin, mMax);
    133162    psLogMsg ("psastro", 4, "skip reasons: mode: %d, faint: %d, bright: %d, inf: %d\n", nModeSkip, nFaintSkip, nBrightSkip, nInfSkip);
    134163
    135     psFree (index);
    136     psFree (inStars);
    137     psFree (rawStars);
    138 
    139     return true;
     164    return rawStars;
    140165}
    141166
  • tags/ipp-20110406/psastro/src/psastroRemoveClumps.c

    r26275 r31334  
    6161                psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.RAWSTARS.SUBSET", PS_DATA_ARRAY, "astrometry objects", subset);
    6262                psFree (subset);
     63
     64                psArray *gridstars = psMetadataLookupPtr(&status, readout->analysis, "PSASTRO.GRID.RAWSTARS");
     65                if ((gridstars == rawstars) || (gridstars == NULL)) { continue; }
     66
     67                psArray *gridstars_subset = psastroRemoveClumpsIterate(gridstars, 150, 3);
     68                psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.GRID.RAWSTARS.SUBSET", PS_DATA_ARRAY, "astrometry objects", gridstars_subset);
     69                psFree (gridstars_subset);
    6370            }
    6471        }
Note: See TracChangeset for help on using the changeset viewer.