IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12718


Ignore:
Timestamp:
Apr 3, 2007, 10:43:21 AM (19 years ago)
Author:
eugene
Message:

failure for a chip is not a failure for the camera; temporarily turn off luminosity func test; better numbers for min Nstars

Location:
trunk/psastro/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastro.h

    r12492 r12718  
    5959bool psastroMosaicCommonScale (pmFPA *fpa, psMetadata *recipe);
    6060bool psastroMosaicAstrom (pmConfig *config, psArray *refs);
    61 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, bool nonlinear);
     61bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, int iteration);
    6262bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe, int iteration);
    6363bool psastroMosaicSetAstrom (pmFPA *fpa);
    6464bool psastroMosaicHeaders (pmConfig *config);
    6565bool psastroMosaicRescaleChips (pmFPA *fpa);
    66 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, bool nonlinear);
     66bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, int iteration);
    6767
    6868// Return version strings.
  • trunk/psastro/src/psastroChipAstrom.c

    r12712 r12718  
    4747                // the absolute minimum number of stars is 4 (for order = 1)
    4848                if ((rawstars->n < 4) || (refstars->n < 4)) {
     49                    readout->data_exists = false;
    4950                    psLogMsg ("psastro", 3, "insufficient rawstars (%ld) or refstars (%ld)",
    5051                            rawstars->n, refstars->n);
     
    7273                // XXX update the header with info to reflect the failure
    7374                if (!psastroOneChip (fpa, chip, refstars, rawstars, recipe, updates)) {
     75                    readout->data_exists = false;
    7476                    psLogMsg ("psastro", 3, "failed to find a solution\n");
    7577                    psFree (updates);
  • trunk/psastro/src/psastroChooseRefstars.c

    r10880 r12718  
    8080                psFree (refstars);
    8181
     82                // XXX TEST : skip the luminosity function selection
     83                continue;
     84
    8285                // XXX this error means the readout fails, but should probably not kill the entire program
    8386                // in this case, no PSASTRO.REFSTARS is added to readout->analysis
  • trunk/psastro/src/psastroLoadRefstars.c

    r12536 r12718  
    1919    float DECmin = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MIN");
    2020    float DECmax = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MAX");
    21     float MAGmax = psMetadataLookupF32(NULL, recipe, "MAG_MAX");
     21    // float MAGmax = psMetadataLookupF32(NULL, recipe, "MAG_MAX");
    2222
    2323    // XXX CATDIR needs to look up abstracted name from psastro.config
     
    5353
    5454    // XXX set getstar in config?
     55    // XXX TEST : no magnitude limit
    5556    // psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile);
    56     psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile);
     57    // psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile);
     58    psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -region %f %f %f %f -o %s", catformat, RAmin, DECmin, RAmax, DECmax, tempFile);
    5759    psTrace ("psastro", 3, "%s\n", getstarLine);
    5860
  • trunk/psastro/src/psastroMosaicAstrom.c

    r12536 r12718  
    7474    if (psTraceGetLevel("psastro.dump") > 0) { psastroDumpMatches (fpa, "match.4.dat"); }
    7575
    76     if (!psastroMosaicChipAstrom (fpa, recipe, false)) {
     76    if (!psastroMosaicChipAstrom (fpa, recipe, 0)) {
    7777        psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (2nd pass)");
    7878        return false;
     
    8282    // now fit the chips under the common distortion with higher-order terms
    8383    // first, re-perform the match with a slightly tighter circle
    84     if (!psastroMosaicSetMatch (fpa, recipe, 1)) {
     84    if (!psastroMosaicSetMatch (fpa, recipe, 2)) {
    8585        psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic (3rd pass)");
    8686        return false;
    8787    }
    88     if (!psastroMosaicChipAstrom (fpa, recipe, true)) {
     88    if (!psastroMosaicChipAstrom (fpa, recipe, 1)) {
    8989        psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (3rd pass)");
    9090        return false;
  • trunk/psastro/src/psastroMosaicChipAstrom.c

    r10880 r12718  
    22# define NONLIN_TOL 0.001 /* tolerance in pixels */
    33
    4 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, bool nonlinear) {
     4bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, int iteration) {
    55
    66    pmChip *chip = NULL;
     
    2626                psMetadata *updates = psMetadataAlloc();
    2727
    28                 psastroMosaicOneChip (chip, readout, recipe, updates, nonlinear);
     28                if (!psastroMosaicOneChip (chip, readout, recipe, updates, iteration)) {
     29                    readout->data_exists = false;
     30                    psLogMsg ("psastro", 3, "failed to find a solution for %d,%d,%d\n", view->chip, view->cell, view->readout);
     31                    psFree (updates);
     32                    continue;
     33                }
    2934
    3035                // create the header keywords to descripe the results
  • trunk/psastro/src/psastroMosaicOneChip.c

    r10880 r12718  
    77   return false; }
    88
    9 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, bool nonlinear) {
     9bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, int iteration) {
    1010
    1111    bool status;
     12    char errorWord[64];
    1213
    1314    PS_ASSERT_PTR_NON_NULL(chip,    false);
     
    3031
    3132    // allowed limits for valid solutions
    32     REQUIRED_RECIPE_VALUE (float maxError, "PSASTRO.MOSAIC.MAX.ERROR", F32, "failed to find single-chip max allowed error\n");
     33    sprintf (errorWord, "PSASTRO.MOSAIC.MAX.ERROR.N%d", iteration);
     34    REQUIRED_RECIPE_VALUE (float maxError, errorWord, F32, "failed to find single-chip max allowed error\n");
    3335    REQUIRED_RECIPE_VALUE (int minNstar, "PSASTRO.MOSAIC.MIN.NSTAR", S32, "failed to find single-chip min allowed stars\n");
    3436
    35     // set the order of the per-chip fit (higher order only if nonlinear == true)
     37    // set the order of the per-chip fit (higher order only if iteration > 0)
    3638    int order = 1;
    37     if (nonlinear) {
     39    if (iteration > 0) {
    3840        // select the desired chip order
    3941        REQUIRED_RECIPE_VALUE (order, "PSASTRO.MOSAIC.CHIP.ORDER", S32, "failed to find mosaic chip-level fit order\n");
    4042
    4143        // modify the order to correspond to the actual number of matched stars:
    42         if ((match->n < 11) && (order >= 3)) order = 2;
    43         if ((match->n <  7) && (order >= 2)) order = 1;
    44         if ((match->n <  4) && (order >= 1)) order = 0;
     44        if ((match->n < 15) && (order >= 3)) order = 2;
     45        if ((match->n < 11) && (order >= 2)) order = 1;
     46        if ((match->n <  8) && (order >= 1)) order = 0;
    4547        if (order < 1) {
    4648            psLogMsg ("psastro", 3, "insufficient stars or invalid order: %ld stars", match->n);
     
    8486    int astNstar = results->yStats->clippedNvalues;
    8587
     88    // if we clip away too many stars, the order may be invalid
     89    if (order == 3) { minNstar = PS_MAX (15, minNstar); }
     90    if (order == 2) { minNstar = PS_MAX (11, minNstar); }
     91    if (order == 1) { minNstar = PS_MAX ( 8, minNstar); }
     92
    8693    bool validSolution = true;
    8794
     
    114121    psFree (fitStats);
    115122    psFree (results);
    116     return true;
     123    return validSolution;
    117124}
  • trunk/psastro/src/psastroOneChip.c

    r12712 r12718  
    154154    psFree (fitStats);
    155155    psFree (gridStats);
    156     return true;
     156    return validSolution;
    157157}
    158158
Note: See TracChangeset for help on using the changeset viewer.