IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 19, 2008, 3:28:01 PM (18 years ago)
Author:
eugene
Message:

import visualizations from cnb_branch_20081011

File:
1 edited

Legend:

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

    r17108 r20805  
    1010
    1111    // use small radius to match stars (assume starting astrometry is good)
    12     bool status = false; 
     12    bool status = false;
    1313    sprintf (radiusWord, "PSASTRO.MOSAIC.RADIUS.N%d", iteration);
    14     double RADIUS = psMetadataLookupF32 (&status, recipe, radiusWord); 
    15     if (!status) { 
    16         psError(PS_ERR_IO, false, "Failed to lookup matching radius: %s", radiusWord);
    17         psFree (view);
    18         return false;
    19     } 
     14    double RADIUS = psMetadataLookupF32 (&status, recipe, radiusWord);
     15    if (!status) {
     16        psError(PS_ERR_IO, false, "Failed to lookup matching radius: %s", radiusWord);
     17        psFree (view);
     18        return false;
     19    }
    2020
    2121    if (RADIUS <= 0.0) {
    22         if (iteration == 0) {
    23             psError(PS_ERR_IO, false, "Invalid match radius for first iteration: %s", radiusWord);
    24             psFree (view);
    25             return false;
    26         }
    27         psWarning ("skipping match for iteration %d\n", iteration);
    28         psFree (view);
    29         return true;
     22        if (iteration == 0) {
     23            psError(PS_ERR_IO, false, "Invalid match radius for first iteration: %s", radiusWord);
     24            psFree (view);
     25            return false;
     26        }
     27        psWarning ("skipping match for iteration %d\n", iteration);
     28        psFree (view);
     29        return true;
    3030    }
    3131
     
    3434        psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    3535        if (!chip->process || !chip->file_exists) { continue; }
    36         if (!chip->fromFPA) { continue; }
    37        
    38         while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
     36        if (!chip->fromFPA) { continue; }
     37
     38        while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
    3939            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    4040            if (!cell->process || !cell->file_exists) { continue; }
    4141
    42             // process each of the readouts
    43             // XXX there can only be one readout per chip, right?
    44             while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
    45                 if (! readout->data_exists) { continue; }
     42            // process each of the readouts
     43            // XXX there can only be one readout per chip, right?
     44            while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
     45                if (! readout->data_exists) { continue; }
    4646
    47                 // select the raw objects for this readout
    48                 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
    49                 if (rawstars == NULL) { continue; }
     47                // select the raw objects for this readout
     48                psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
     49                if (rawstars == NULL) { continue; }
    5050
    51                 // select the raw objects for this readout
    52                 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
    53                 if (refstars == NULL) { continue; }
    54                 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n);
     51                // select the raw objects for this readout
     52                psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
     53                if (refstars == NULL) { continue; }
     54                psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n);
    5555
    56                 psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, RADIUS);
    57                 psTrace ("psastro", 4, "Matched %ld refstars\n", matches->n);
     56                psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, RADIUS);
     57                psTrace ("psastro", 4, "Matched %ld refstars\n", matches->n);
    5858
    59                 // XXX drop the old one
    60                 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.MATCH", PS_DATA_ARRAY | PS_META_REPLACE, "astrometry matches", matches);
    61                 psFree (matches);
    62             }
    63         }
     59                psastroVisualPlotMosaicMatches(rawstars, refstars, matches, iteration, recipe);
     60
     61                // XXX drop the old one
     62                psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.MATCH", PS_DATA_ARRAY | PS_META_REPLACE, "astrometry matches", matches);
     63                psFree (matches);
     64            }
     65        }
    6466    }
    6567    psFree (view);
Note: See TracChangeset for help on using the changeset viewer.