IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42229 for trunk/ppViz


Ignore:
Timestamp:
Jun 30, 2022, 3:42:01 PM (4 years ago)
Author:
tdeboer
Message:

Modify code to allow high FWHM image to progress to warp, and not be queued for wwdiffs

Location:
trunk/ppViz/src/ppCoord
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppViz/src/ppCoord/ppCoord.h

    r42154 r42229  
    1414    psString rawName;                   // Filename with raw image (or NULL)
    1515    psString pixelsName;                // Filename with pixel coordinates
    16     psString fpaName;                   // Filename with FPA coordinates
    1716    psString chipName;                  // Name of chip of interest
    1817    psString radecName;                 // Filename with sky coordinates
  • trunk/ppViz/src/ppCoord/ppCoordArguments.c

    r42154 r42229  
    4949    psMetadataAddStr(arguments, PS_LIST_TAIL, "-raw", 0, "Filename with raw data", NULL);
    5050    psMetadataAddStr(arguments, PS_LIST_TAIL, "-pixels", 0, "Filename with pixel coordinates", NULL);
    51     psMetadataAddStr(arguments, PS_LIST_TAIL, "-fpa", 0, "Filename with FPA coordinates", NULL);
    5251    psMetadataAddStr(arguments, PS_LIST_TAIL, "-chip", 0, "Chip for pixel coordinates", NULL);
    5352    psMetadataAddStr(arguments, PS_LIST_TAIL, "-radec", 0, "Filename with RA,Dec (default decimal degrees)", NULL);
     
    6766    data->rawName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-raw"));
    6867    data->pixelsName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-pixels"));
    69     data->fpaName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-fpa"));
    7068    data->chipName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-chip"));
    7169    data->radecName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-radec"));
     
    9896    }
    9997
    100     if (!data->pixelsName && !data->radecName && !data->fpaName && !data->streaksName && !data->clustersName) {
    101         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Neither -pixels nor -radec nor -fpa provided.");
     98    if (!data->pixelsName && !data->radecName && !data->streaksName && !data->clustersName) {
     99        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Neither -pixels nor -radec provided.");
    102100        return false;
    103101    }
  • trunk/ppViz/src/ppCoord/ppCoordData.c

    r42154 r42229  
    1616    psFree(data->rawName);
    1717    psFree(data->pixelsName);
    18     psFree(data->fpaName);
    1918    psFree(data->chipName);
    2019    psFree(data->radecName);
     
    3837    data->rawName = NULL;
    3938    data->pixelsName = NULL;
    40     data->fpaName = NULL;
    4139    data->chipName = NULL;
    4240    data->radecName = NULL;
  • trunk/ppViz/src/ppCoord/ppCoordLoop.c

    r42154 r42229  
    7979        NULL; // File with raw image
    8080
    81     psArray *pixels = NULL, *radec = NULL, *fpas = NULL, *streaks = NULL, *clusters = NULL; // Array of coordinate vectors
    82     psArray *radecOut = NULL,*fpaOut = NULL, *streaksOut = NULL, *clustersOut = NULL;        // Output for sky coordinates
     81    psArray *pixels = NULL, *radec = NULL, *streaks = NULL, *clusters = NULL; // Array of coordinate vectors
     82    psArray *radecOut = NULL, *streaksOut = NULL, *clustersOut = NULL;        // Output for sky coordinates
    8383    if (data->pixelsName) {
    8484        pixels = psVectorsReadFromFile(data->pixelsName, "%f %f");
     
    107107        psVectorInit(radecOut->data[1], NAN);
    108108        psVectorInit(radecOut->data[2], NAN);
    109     }
    110 
    111     if (data->fpaName) {
    112         fpas = psVectorsReadFromFile(data->fpaName, "%f %f");
    113         if (!fpas || fpas->n != 2) {
    114             psError(psErrorCodeLast(), false, "Unable to read FPA coordinates");
    115             return false;
    116         }
    117         psVector *fpa_x = fpas->data[0];  // FPA x coordinates
    118         long num = fpa_x->n;               // Number of coordinates
    119         fpaOut = psArrayAlloc(6);
    120         fpaOut->data[0] = psArrayAlloc(num);
    121         fpaOut->data[1] = psVectorAlloc(num, PS_TYPE_F32);
    122         fpaOut->data[2] = psVectorAlloc(num, PS_TYPE_F32);
    123         fpaOut->data[3] = psArrayAlloc(num);
    124         fpaOut->data[4] = psVectorAlloc(num, PS_TYPE_F32);
    125         fpaOut->data[5] = psVectorAlloc(num, PS_TYPE_F32);
    126         psVectorInit(fpaOut->data[1], NAN);
    127         psVectorInit(fpaOut->data[2], NAN);
    128         psVectorInit(fpaOut->data[4], NAN);
    129         psVectorInit(fpaOut->data[5], NAN);
    130109    }
    131110
     
    415394                yTP->data.F32[i] = src.tp.y;
    416395            }
    417         }
    418 
    419         if (fpas) {
    420             psVector *fpa_x = fpas->data[0], *fpa_y = fpas->data[1]; // FPA coordinates
    421             long num = fpa_x->n;                                     // Number of coordinates
    422 
    423             int numCols = psMetadataLookupS32(NULL, hdu->header, "IMNAXIS1"); // Number of columns
    424             int numRows = psMetadataLookupS32(NULL, hdu->header, "IMNAXIS2"); // Number of rows
    425             if (numCols <= 0 || numRows <= 0) {
    426                 psError(psErrorCodeLast(), false, "Unable to read size of chip.");
    427                 return false;
    428             }
    429 
    430             psArray *chipPix = fpaOut->data[0]; // Chip for pixels
    431             psVector *xPix = fpaOut->data[1];   // x coordinate for pixels
    432             psVector *yPix = fpaOut->data[2];   // y coordinate for pixels
    433             psArray *cellPix = fpaOut->data[3]; // Cell for pixels
    434             psVector *xCell = fpaOut->data[4];   // x coordinate for cell
    435             psVector *yCell = fpaOut->data[5];   // y coordinate for cell
    436 
    437             psPlane *pix = psPlaneAlloc();   // Pixel coordinates on chip
    438             psPlane *fp = psPlaneAlloc();    // Focal plane coordinates
    439 
    440             for (long i = 0; i < num; i++) {
    441                 float x, y;             // Pixel coordinates
    442                 fp->x = fpa_x->data.F32[i];
    443                 fp->y = fpa_y->data.F32[i];
    444 
    445                 psPlaneTransformApply(pix, chip->fromFPA, fp);
    446                 psTrace("ppCoord",2,"fpa2pix tr1: %f %f\n",pix->x,pix->y);
    447 
    448                 x = pix->x;
    449                 y = pix->y;
    450 
    451                 if ((x < 0 || x > numCols || y < 0 || y > numRows)) {
    452                     // Not on this chip
    453                     continue;
    454                 }
    455 
    456                 chipPix->data[i] = psStringCopy(chipName);
    457                 xPix->data.F32[i] = x;
    458                 yPix->data.F32[i] = y;
    459 
    460                 if (rawChip) {
    461                     psString cellName = NULL; // Name of cell
    462                     coordChip2Cell(&cellName, &x, &y, x, y, cellNames, cellBounds,
    463                                    cellX0, cellY0, cellParityX, cellParityY, cellBinX, cellBinY);
    464                     cellPix->data[i] = cellName;
    465                     xCell->data.F32[i] = x;
    466                     yCell->data.F32[i] = y;
    467                 }
    468 
    469             }
    470             psFree(pix);
    471             psFree(fp);
    472396        }
    473397
     
    632556    }
    633557
    634     if (fpaOut) {
    635         psArray *chipPix = fpaOut->data[0]; // Chip for pixels
    636         psVector *xPix = fpaOut->data[1];   // x coordinate for pixels
    637         psVector *yPix = fpaOut->data[2];   // y coordinate for pixels
    638         psArray *cellPix = fpaOut->data[3]; // Cell for pixels
    639         psVector *xCell = fpaOut->data[4];   // x coordinate for pixels
    640         psVector *yCell = fpaOut->data[5];   // y coordinate for pixels
    641         psVector *fpa_x = fpas->data[0];        // FPA x coordinate
    642         psVector *fpa_y = fpas->data[1];       // FPA y coordinate
    643 
    644         for (long i = 0; i < chipPix->n; i++) {
    645             const char *chipName = chipPix->data[i]; // Name of chip
    646             const char *cellName = cellPix->data[i]; // Name of cell, or NULL
    647             if (!data->all && (!isfinite(xPix->data.F32[i]) || !isfinite(yPix->data.F32[i]) ||
    648                                !chipName || (rawFile && !cellName))) {
    649                 continue;
    650             }
    651             if (!rawFile && data->ds9) {
    652                 // Region file is only appropriate if we're not mapping all the way back to cell coordinates
    653                 fprintf(data->ds9, "image;circle(%f,%f,%f) # color=%s\n",
    654                         xPix->data.F32[i], yPix->data.F32[i], data->ds9radius, data->ds9color);
    655             } else if (rawFile) {
    656                 fprintf(stdout, "%.3f %.3f --> %.3f %.3f %s %.3f %.3f %s\n",
    657                         fpa_x->data.F32[i], fpa_y->data.F32[i], xPix->data.F32[i], yPix->data.F32[i],
    658                         chipName ? chipName : "UNKNOWN",
    659                         xCell->data.F32[i], yCell->data.F32[i],
    660                         cellName ? cellName : "UNKNOWN");
    661             } else {
    662                 fprintf(stdout, "%.3f %.3f --> %.3f %.3f %s\n",
    663                         fpa_x->data.F32[i], fpa_y->data.F32[i], xPix->data.F32[i], yPix->data.F32[i],
    664                         chipName ? chipName : "UNKNOWN");
    665             }
    666         }
    667     }
    668 
    669558    if (streaksOut) {
    670559        psArray *chipPix1 = streaksOut->data[0]; // Chip for point 1
Note: See TracChangeset for help on using the changeset viewer.