IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30815


Ignore:
Timestamp:
Mar 6, 2011, 2:59:23 PM (15 years ago)
Author:
eugene
Message:

handle case where we have peaks and no detected footprints

Location:
branches/eam_branches/ipp-20110213/psModules/src/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintAssignPeaks.c

    r30621 r30815  
    4646     */
    4747    psImage *ids = pmSetFootprintArrayIDs(footprints, true);
    48     assert (ids != NULL);
    49     assert (ids->type.type == PS_TYPE_S32);
    50     const int row0 = ids->row0;
    51     const int col0 = ids->col0;
    52     const int numRows = ids->numRows;
    53     const int numCols = ids->numCols;
     48    if (ids) { assert (ids->type.type == PS_TYPE_S32); }
     49   
     50    const int row0 = ids ? ids->row0 : 0;
     51    const int col0 = ids ? ids->col0 : 0;
     52    const int numRows = ids ? ids->numRows : -1;
     53    const int numCols = ids ? ids->numCols : -1;
    5454
    5555    for (int i = 0; i < peaks->n; i++) {
     
    5858        const int y = peak->y - row0;
    5959       
    60         assert (x >= 0 && x < numCols && y >= 0 && y < numRows);
    61         int id = ids->data.S32[y][x - col0];
     60        if (ids) { assert (x >= 0 && x < numCols && y >= 0 && y < numRows);}
     61        int id = ids ? ids->data.S32[y][x - col0] : 0;
    6262
    6363        if (id == 0) {                  // peak isn't in a footprint, so make one for it
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintIDs.c

    r29004 r30815  
    6666
    6767   if (footprints->n == 0) {
    68        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "You didn't provide any footprints");
     68       // XXX this was an error, but is an allowed condition -- NULL returned image means no footprints for any peaks
     69       // psError(PS_ERR_BAD_PARAMETER_SIZE, true, "You didn't provide any footprints");
    6970       return NULL;
    7071   }
Note: See TracChangeset for help on using the changeset viewer.