IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 7, 2008, 4:52:04 PM (18 years ago)
Author:
eugene
Message:

do not fit known CRs in FitSourcesLinear; defined a new CR masking function based on footprints, but it is not yet ready

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotVisual.c

    r20594 r20938  
    2626
    2727    isVisual = mode;
     28    return true;
     29}
     30
     31bool psphotVisualShowMask (int kapaFD, psImage *inImage, const char *name, int channel) {
     32
     33    KiiImage image;
     34    KapaImageData data;
     35    Coords coords;
     36
     37    strcpy (coords.ctype, "RA---TAN");
     38
     39    psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
     40    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0);
     41    if (!psImageBackground(stats, NULL, inImage, NULL, 0, rng)) {
     42        fprintf (stderr, "failed to get background values\n");
     43        return false;
     44    }
     45
     46    image.Nx = inImage->numCols;
     47    image.Ny = inImage->numRows;
     48
     49    ALLOCATE (image.data2d, float *, image.Ny);
     50    for (int iy = 0; iy < image.Ny; iy++) {
     51        ALLOCATE (image.data2d[iy], float, image.Nx);
     52        for (int ix = 0; ix < image.Nx; ix++) {
     53            image.data2d[iy][ix] = inImage->data.U8[iy][ix];
     54        }
     55    }
     56
     57    strcpy (data.name, name);
     58    strcpy (data.file, name);
     59    data.zero = -1;
     60    data.range = 32;
     61    data.logflux = 0;
     62 
     63    KiiSetChannel (kapaFD, channel);
     64    KiiNewPicture2D (kapaFD, &image, &data, &coords);
     65
     66    for (int iy = 0; iy < image.Ny; iy++) {
     67        free (image.data2d[iy]);
     68    }
     69    free (image.data2d);
     70
     71    psFree (stats);
     72    psFree (rng);
     73
    2874    return true;
    2975}
     
    13361382}
    13371383
    1338 bool psphotVisualShowSourceSize (psArray *sources) {
     1384bool psphotVisualShowSourceSize (pmReadout *readout, psArray *sources) {
    13391385
    13401386    int Noverlay, NOVERLAY;
     
    13981444    KiiLoadOverlay (kapa, overlay, Noverlay, "blue");
    13991445    FREE (overlay);
     1446
     1447    psphotVisualShowMask (kapa, readout->mask, "mask", 2);
    14001448
    14011449    // pause and wait for user input:
Note: See TracChangeset for help on using the changeset viewer.