IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 26, 2013, 9:07:23 AM (13 years ago)
Author:
eugene
Message:

major mods to allow multichip output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpOverlaps.c

    r35424 r35434  
    8383            }
    8484        }
     85        fprintf (stderr, "bounds %d : %f - %f, %f - %f\n", view->chip, Pmin, Pmax, Qmin, Qmax);
    8586        pswarpBoundsAppend (bounds, Pmin, Pmax, Qmin, Qmax);
    8687    }
     
    109110    pmFPAview *view = pmFPAviewAlloc (0);
    110111
     112    // we are looping over the chips of the OUTPUT fpa.  chip->file_exists is false for all chips.
     113    // at this point, I cannot exclude any of these chips (I do not know which output chips will not be created).
     114    // NOTE : I either have to use SKYCELL fpa and ensure SKYCELL->chip->toFPA exists or grab hdu from SKYCELL
     115
    111116    pmChip *chip = NULL;
    112117    while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) {
    113118        psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    114         if (!chip->process || !chip->file_exists) { continue; }
     119        // if (!chip->file_exists) { continue; } // this fpa refers to the output file, so no chip exist
     120        assert (chip->toFPA);
     121        chip->process = true; // start with process true, we will de-activate later (pswarpFindOverlaps)
    115122
    116123        // we've got the output astrom header
     
    153160    double Dmid = stats->sampleMean;
    154161
    155     psProjection *frame = psProjectionAlloc (Rmid, Dmid, 1.0, 1.0, PS_PROJ_TAN);
     162    psProjection *frame = psProjectionAlloc (Rmid, Dmid, PS_RAD_DEG/3600.0, PS_RAD_DEG/3600.0, PS_PROJ_TAN);
    156163    return frame;
    157164}
     
    162169    // elements overlap it.
    163170
    164     pmFPAview *view = pmFPAviewAlloc (0);
     171    assert (fpa->chips->n == tgt->Pmin->n);
    165172
    166     pmChip *chip = NULL;
    167     int Nout = 0;
    168     while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) {
    169         psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    170         if (!chip->process || !chip->file_exists) { continue; }
     173    for (int j = 0; j < fpa->chips->n; j++) {
     174        pmChip *chip = fpa->chips->data[j];
    171175
    172176        // we have src bounds
    173         float Pmin = tgt->Pmin->data.F32[Nout];
    174         float Pmax = tgt->Pmax->data.F32[Nout];
    175         float Qmin = tgt->Qmin->data.F32[Nout];
    176         float Qmax = tgt->Qmax->data.F32[Nout];
     177        float Pmin = tgt->Pmin->data.F32[j];
     178        float Pmax = tgt->Pmax->data.F32[j];
     179        float Qmin = tgt->Qmin->data.F32[j];
     180        float Qmax = tgt->Qmax->data.F32[j];
    177181
    178182        bool valid = false;
     
    183187            valid = Pvalid && Qvalid;
    184188        }
     189        // if (valid) {
     190        //     fprintf (stderr, "chip %d is valid\n", j);
     191        // } else {
     192        //     fprintf (stderr, "chip %d is NOT valid\n", j);
     193        // }
    185194        chip->process = valid;
    186195    }
Note: See TracChangeset for help on using the changeset viewer.