IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20979


Ignore:
Timestamp:
Dec 14, 2008, 9:18:42 AM (17 years ago)
Author:
eugene
Message:

new functions to examine the CR masking

Location:
branches/eam_branch_20081214/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081214/psphot/src/psphot.h

    r20938 r20979  
    169169bool psphotVisualPlotApResid (psArray *sources);
    170170bool psphotVisualPlotSourceSize (psArray *sources);
     171bool psphotVisualShowCRMask (psVector *xf, psVector *yf);
     172bool psphotVisualShowSNLimit (pmReadout *readout, float limit);
    171173
    172174bool psphotImageQuality (psMetadata *recipe, psArray *sources);
  • branches/eam_branch_20081214/psphot/src/psphotVisual.c

    r20938 r20979  
    13821382}
    13831383
     1384bool psphotVisualShowCRMask (psVector *xf, psVector *yf) {
     1385
     1386    int Noverlay;
     1387    KiiOverlay *overlay;
     1388 
     1389    if (!isVisual) return true;
     1390
     1391    if (kapa == -1) {
     1392        fprintf (stderr, "kapa not opened, skipping\n");
     1393        return false;
     1394    }
     1395
     1396    // note: this uses the Ohana allocation tools:
     1397    // ALLOCATE (overlay, KiiOverlay, 3*peaks->n + 1);
     1398    ALLOCATE (overlay, KiiOverlay, xf->n);
     1399
     1400    Noverlay = 0;
     1401    for (int i = 0; i < xf->n; i++) {
     1402        overlay[Noverlay].type = KII_OVERLAY_CIRCLE;
     1403        overlay[Noverlay].x = xf->data.F32[i];
     1404        overlay[Noverlay].y = yf->data.F32[i];
     1405        overlay[Noverlay].dx = 0.5;
     1406        overlay[Noverlay].dy = 0.5;
     1407        overlay[Noverlay].angle = 0.0;
     1408        overlay[Noverlay].text = NULL;
     1409        Noverlay ++;
     1410    }
     1411
     1412    KiiLoadOverlay (kapa, overlay, Noverlay, "red");
     1413    FREE (overlay);
     1414
     1415    KiiCenter (kapa, xf->data.F32[0], yf->data.F32[0], 0.0);
     1416
     1417    // pause and wait for user input:
     1418    // continue, save (provide name), ??
     1419    char key[10];
     1420    fprintf (stdout, "[c]ontinue? ");
     1421    if (!fgets(key, 8, stdin)) {
     1422        psWarning("Unable to read option");
     1423    }
     1424    return true;
     1425}
     1426
     1427bool psphotVisualShowSNLimit (pmReadout *readout, float limit) {
     1428
     1429    if (!isVisual) return true;
     1430
     1431    if (kapa == -1) {
     1432        fprintf (stderr, "kapa not opened, skipping\n");
     1433        return false;
     1434    }
     1435
     1436    psImage *snlimit = psImageAlloc (readout->image->numCols, readout->image->numRows, PS_TYPE_F32);
     1437    for (int iy = 0; iy < snlimit->numRows; iy++) {
     1438      for (int ix = 0; ix < snlimit->numCols; ix++) {
     1439        snlimit->data.F32[iy][ix] = readout->image->data.F32[iy][ix] / sqrt(readout->weight->data.F32[iy][ix]);
     1440      }
     1441    }
     1442    psphotVisualRangeImage (kapa, snlimit, "snlimit", 1, limit, limit + 0.1);
     1443    psFree (snlimit);
     1444    return true;
     1445}
     1446
    13841447bool psphotVisualShowSourceSize (pmReadout *readout, psArray *sources) {
    13851448
Note: See TracChangeset for help on using the changeset viewer.