IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41498


Ignore:
Timestamp:
Feb 18, 2021, 11:10:42 AM (5 years ago)
Author:
eugene
Message:

count the number of chips which succeed and which fail, warn if too small a fraction succeed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroMosaicChipAstrom.c

    r21409 r41498  
    2121    pmReadout *readout = NULL;
    2222    pmFPAview *view = pmFPAviewAlloc (0);
     23
     24    float minGoodChipFraction = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.MIN.GOOD.CHIP.FRACTION");
     25    if (!status) {
     26      minGoodChipFraction = 0.1;     
     27      psWarning ("failed to find PSASTRO.MOSAIC.MIN.GOOD.CHIP.FRACTION in recipe, assuming default of %f", minGoodChipFraction);
     28    }
     29
     30    int nChipGood = 0;
     31    int nChipFail = 0;
    2332
    2433    // this loop selects the matched stars for all chips
     
    5160                    psErrorStackPrint(stderr, "failure for one chip\n");
    5261                    psErrorClear();
     62                    nChipFail ++;
    5363                    continue;
    5464                }
     
    6070                    psErrorStackPrint(stderr, "failure for one chip\n");
    6171                    psErrorClear();
     72                    nChipFail ++;
    6273                    continue;
    6374                }
     75                nChipGood ++;
    6476            }
    6577        }
    6678    }
    6779    psFree (view);
     80
     81    // if basically the entire exposure is bad, return false (calling function sets bad quality)
     82    float fGood = nChipGood / ((float) (nChipGood + nChipFail));
     83    if (fGood < minGoodChipFraction) {
     84      psWarning ("Too few good chips (%d of %d = %.2f), setting bad quality for this exposure\n", nChipGood, (nChipGood + nChipFail), fGood);
     85      // return false;
     86    }
     87
    6888    return true;
    6989}
     90
     91// XXX count success and failures
     92// XXX set bad quality if fraction of successes < threshold
     93// XXX e.g., 5% success would mean 3 of 60 GPC1 chips are goo.
     94// XXX or, 10% would be 6 of 60.
     95// XXX seems like a good indicator of failure.
     96// XXX also, test CERROR against a minimum value?
Note: See TracChangeset for help on using the changeset viewer.