IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 1, 2012, 3:24:39 PM (14 years ago)
Author:
eugene
Message:

support for parallel dvo in mextract, avextract, avmerge, gstar, gcat; remove some if-def-ed out code already moved to libdvo; list -vectors and -buffers options (store names of vectors and buffers in lists); list -copy give error if missing source; catlist, hosts & remote functions to support parallel dvos; skyregion -save option; new skycoverage modes (-min-ubercal; -min-dmag-sys; -min-mcal; -max-mcal); gstar output formatting cleanups; add more average info to gstar output; functions for spectral similarity analysis; coords returns nans for projections off the sphere; fix cumulative function; add name:type option to opihi/read function (eg read a:float 2 b:time 3 c:int 4); line -frac option; vtype function to get vector types; threshold function; write -fits option; code for unfinished mtype function (matching vtype)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/skycoverage.c

    r32632 r33662  
    11# include "dvoshell.h"
    22
     3// enum to define possible modes
     4enum {COVERAGE, DENSITY, MIN_UBERCAL, MIN_DMAG_SYS, MIN_MCAL, MAX_MCAL};
     5
    36int wordhash (char *word);
    47
    58int skycoverage (int argc, char **argv) {
    69
    7   int WITH_MOSAIC, SOLO_MOSAIC, ShowDensity;
     10  int WITH_MOSAIC, SOLO_MOSAIC, mode;
    811  off_t i, Nimage;
    912  int N, status, TimeSelect, ByName, xs, ys;
     
    6063  }
    6164
    62   ShowDensity = FALSE;
     65  mode = COVERAGE;
    6366  if ((N = get_argument (argc, argv, "-density"))) {
    6467    remove_argument (N, &argc, argv);
    65     ShowDensity = TRUE;
     68    mode = DENSITY;
     69  }
     70  if ((N = get_argument (argc, argv, "-min-ubercal"))) {
     71    remove_argument (N, &argc, argv);
     72    mode = MIN_UBERCAL;
     73  }
     74  if ((N = get_argument (argc, argv, "-min-dmag-sys"))) {
     75    remove_argument (N, &argc, argv);
     76    mode = MIN_DMAG_SYS;
     77  }
     78  if ((N = get_argument (argc, argv, "-min-mcal"))) {
     79    remove_argument (N, &argc, argv);
     80    mode = MIN_MCAL;
     81  }
     82  if ((N = get_argument (argc, argv, "-max-mcal"))) {
     83    remove_argument (N, &argc, argv);
     84    mode = MAX_MCAL;
    6685  }
    6786
     
    194213  V = (float *)buf[0].matrix.buffer;
    195214
     215  // init the V array (depends on mode)
    196216  for (ys = 0; ys < Ny; ys++) {
    197217    for (xs = 0; xs < Nx; xs++) {
     
    199219      status &= (r >= 0);
    200220      status &= (r <= 360);
     221      // are we in a part of the projection covering the sky or not?
    201222      if (status) {
    202         V[ys*Nx + xs] = ShowDensity ?  0 : 2;
     223        switch (mode) {
     224          case COVERAGE:
     225            V[ys*Nx + xs] = 2;
     226            break;
     227          case DENSITY:
     228            V[ys*Nx + xs] = 0;
     229            break;
     230          case MIN_UBERCAL:
     231          case MIN_DMAG_SYS:
     232          case MIN_MCAL:
     233            V[ys*Nx + xs] = 1E6;
     234            break;
     235          case MAX_MCAL:
     236            V[ys*Nx + xs] = -1E6;
     237            break;
     238        }
    203239      } else {
    204         V[ys*Nx + xs] = ShowDensity ? NAN : 0;
     240        switch (mode) {
     241          case COVERAGE:
     242            V[ys*Nx + xs] = 0;
     243            break;
     244          case DENSITY:
     245          case MIN_UBERCAL:
     246          case MIN_DMAG_SYS:
     247          case MIN_MCAL:
     248          case MAX_MCAL:
     249            V[ys*Nx + xs] = NAN;
     250            break;
     251        }
    205252      }
    206253    }
     
    257304          xs = (int)Xs;
    258305          ys = (int)Ys;
    259           if (ShowDensity) {
     306          switch (mode) {
     307            case COVERAGE:
     308              V[ys*Nx + xs] = 1;
     309              break;
     310            case DENSITY:
    260311              V[ys*Nx + xs] += 1;
    261           } else {
    262               V[ys*Nx + xs] = 1;
     312              break;
     313            case MIN_UBERCAL:
     314              V[ys*Nx + xs] = MIN(V[ys*Nx + xs], image[i].ubercalDist);
     315              break;
     316            case MIN_DMAG_SYS:
     317              V[ys*Nx + xs] = MIN(V[ys*Nx + xs], image[i].dMagSys);
     318              break;
     319            case MIN_MCAL:
     320              V[ys*Nx + xs] = MIN(V[ys*Nx + xs], image[i].Mcal);
     321              break;
     322            case MAX_MCAL:
     323              V[ys*Nx + xs] = MAX(V[ys*Nx + xs], image[i].Mcal);
     324              break;
    263325          }
    264326        }
Note: See TracChangeset for help on using the changeset viewer.