IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 16, 2009, 11:33:52 AM (17 years ago)
Author:
eugene
Message:

merge changes from eam_branch_20090208: add PS1_V1 formats; rename average.code to flags, image.code to flags; some opihi function name clarification; drop Stars as autocode struct; rework addstar to isolate input -> Measure conversions

Location:
trunk/Ohana/src/opihi
Files:
5 added
5 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/Makefile

    r17579 r21508  
    2020$(SRC)/accum.$(ARCH).o          \
    2121$(SRC)/applyfit2d.$(ARCH).o     \
    22 $(SRC)/applyfit.$(ARCH).o       \
     22$(SRC)/applyfit1d.$(ARCH).o     \
    2323$(SRC)/box.$(ARCH).o            \
    2424$(SRC)/book.$(ARCH).o           \
     
    2626$(SRC)/center.$(ARCH).o \
    2727$(SRC)/clear.$(ARCH).o          \
    28 $(SRC)/clip.$(ARCH).o           \
     28$(SRC)/imclip.$(ARCH).o         \
    2929$(SRC)/close.$(ARCH).o          \
    3030$(SRC)/concat.$(ARCH).o \
     
    4444$(SRC)/fft1d.$(ARCH).o          \
    4545$(SRC)/fft2d.$(ARCH).o          \
     46$(SRC)/fit1d.$(ARCH).o          \
    4647$(SRC)/fit2d.$(ARCH).o          \
    47 $(SRC)/fit.$(ARCH).o            \
    4848$(SRC)/gaussj.$(ARCH).o \
    4949$(SRC)/gaussdeviate.$(ARCH).o   \
     
    107107$(SRC)/spline_apply.$(ARCH).o   \
    108108$(SRC)/spline_construct.$(ARCH).o \
    109 $(SRC)/stats.$(ARCH).o             \
     109$(SRC)/imstats.$(ARCH).o           \
    110110$(SRC)/style.$(ARCH).o             \
    111111$(SRC)/subraster.$(ARCH).o         \
     
    131131$(SRC)/vroll.$(ARCH).o             \
    132132$(SRC)/vsmooth.$(ARCH).o        \
    133 $(SRC)/vstat.$(ARCH).o             \
     133$(SRC)/vstats.$(ARCH).o            \
    134134$(SRC)/wd.$(ARCH).o                \
    135135$(SRC)/write_vectors.$(ARCH).o     \
  • trunk/Ohana/src/opihi/cmd.data/init.c

    r21064 r21508  
    33int accum            PROTO((int, char **));
    44int applyfit         PROTO((int, char **));
     5int applyfit1d       PROTO((int, char **));
    56int applyfit2d       PROTO((int, char **));
    67int box              PROTO((int, char **));
     
    1112int clear            PROTO((int, char **));
    1213int clip             PROTO((int, char **));
     14int imclip           PROTO((int, char **));
    1315int close_device     PROTO((int, char **));
    1416int concat           PROTO((int, char **));
     
    2931int fft1d            PROTO((int, char **));
    3032int fft2d            PROTO((int, char **));
     33int fit              PROTO((int, char **));
     34int fit1d            PROTO((int, char **));
    3135int fit2d            PROTO((int, char **));
    32 int fit              PROTO((int, char **));
    3336int gaussjordan      PROTO((int, char **));
    3437int gaussdeviate     PROTO((int, char **));
     
    9295int spline_construct_cmd PROTO((int, char **));
    9396int stats            PROTO((int, char **));
     97int imstats          PROTO((int, char **));
    9498int style            PROTO((int, char **));
    9599int subraster        PROTO((int, char **));
     
    113117int vload            PROTO((int, char **));
    114118int vzload           PROTO((int, char **));
    115 int vstat            PROTO((int, char **));
     119int vstats           PROTO((int, char **));
    116120int vroll            PROTO((int, char **));
    117121int vpop             PROTO((int, char **));
     
    124128static Command cmds[] = { 
    125129  {1, "accum",        accum,            "accumulate vector values in another vector"},
    126   {1, "applyfit",     applyfit,         "apply fit to new vector"},
     130  {1, "applyfit",     applyfit1d,       "apply 1-d fit to new vector"},
     131  {1, "applyfit1d",   applyfit1d,       "apply 1-d fit to new vector"},
    127132  {1, "applyfit2d",   applyfit2d,       "apply 2-d fit to new vector"},
     133  {1, "book",         book_command,     "commands to manipulate book/page/word data"},
    128134  {1, "box",          box,              "draw a box on the plot"},
    129   {1, "book",         book_command,     "commands to manipulate book/page/word data"},
     135  {1, "buffers",      list_buffers,     "list the currently allocated buffers (images)"},
     136  {1, "images",       list_buffers,     "list the currently allocated images"},
    130137  {1, "center",       center,           "center image on coords"},
    131   {1, "parity",       parity,           "set image parity"},
    132138  {1, "circstats",    circstats,        "circular statistics"},
    133139  {1, "clear",        clear,            "erase plot"},
    134   {1, "clip",         clip,             "clip values in a buffer to be within a range"},
     140  {1, "clip",         imclip,           "clip values in an image to be within a range"},
    135141  {1, "close",        close_device,     "close the current display device"},
    136   {1, "concat",       concat,           "reduce vector dimension"},
     142  {1, "concat",       concat,           "append values to the end of a vector"},
    137143  {1, "contour",      contour,          "create contour from image"},
    138144  {1, "create",       create,           "create a new vector"},
     145  {1, "vcreate",      create,           "create a new vector"},
    139146  {1, "cumulative",   cumulative,       "build a cumulative histogram from a specific histogram"},
    140147  {1, "cursor",       cursor,           "get coords from cursor"},
     
    143150  {1, "dbconnect",    dbconnect,        "setup mysql db connection"},
    144151  {1, "dbselect",     dbselect,         "extract vectors from mysql database table"},
    145   {1, "delete",       delete,           "delete vectors or matrices"},
     152  {1, "delete",       delete,           "delete vectors or images"},
    146153  {1, "device",       device,           "set / get current graphics device"},
    147   {1, "dimendown",    dimendown,        "convert matrix to vector"},
    148   {1, "dimenup",      dimenup,          "convert vector to matrix"},
    149   {1, "erase",        erase,            "erase objects on an overlay"},
    150   {1, "extract",      extract,          "extract a portion of a buffer into another buffer"},
    151   {1, "fft1d",        fft1d,            "fft on the pixel-stream in an image"},
     154  {1, "dimendown",    dimendown,        "convert image to vector"},
     155  {1, "dimenup",      dimenup,          "convert vector to image"},
     156  {1, "dot",          dot,              "plot a single point"},
     157  {1, "erase",        erase,            "erase objects on an image overlay"},
     158  {1, "extract",      extract,          "extract a portion of a image into another image"},
     159  {1, "fft1d",        fft1d,            "fft on a vector"},
    152160  {1, "fft2d",        fft2d,            "fft on an image"},
    153   {1, "fit",          fit,              "fit polynomial to vector pair"},
     161  {1, "fit",          fit1d,            "fit polynomial to vector pair"},
     162  {1, "fit1d",        fit1d,            "fit polynomial to vector pair"},
    154163  {1, "fit2d",        fit2d,            "fit 2-d polynomial to vector triplet"},
    155   {1, "gaussj",       gaussjordan,      "solve Ax = B (N-D)"},
    156164  {1, "gaussdev",     gaussdeviate,     "generate a gaussian deviate vector"},
    157165  {1, "gaussint",     gaussintegral,    "return the integrated gaussian vector"},
    158   {1, "grid",         grid,             "plot cartesian grid"},
    159   {1, "gridify",      gridify,          "convert vector triplet to buffer"},
     166  {1, "gaussj",       gaussjordan,      "solve Ax = B (N-Dimensional)"},
     167  {1, "grid",         grid,             "plot cartesian grid on graph"},
     168  {1, "gridify",      gridify,          "convert vector triplet to image (same as vgrid?)"},
    160169  {1, "grow",         grow,             "grow a mask"},
    161   {1, "ungridify",    ungridify,        "convert buffer region to vector triplet"},
    162   {1, "header",       header,           "print buffer header"},
     170  {1, "header",       header,           "print image header"},
    163171  {1, "histogram",    histogram,        "generate histogram from vector"},
     172  {1, "imbin",        rebin,            "rebin image data by factor of N"},
     173  {1, "imclip",       imclip,           "clip values in an image to be within a range"},
    164174  {1, "imcut",        imcut,            "linear image cut between arbitrary coords"},
    165   {1, "imhist",       imhist,           "histogram of an image region"},
     175  {1, "imhistogram",  imhist,           "histogram of an image region"},
    166176  {1, "imsmooth",     imsmooth,         "circular gaussian smoothing"},
     177  {1, "imstats",      imstats,          "statistics on a portion of an image"},
    167178  {1, "integrate",    integrate,        "integrate a vector"},
    168179  {1, "interpolate",  interpolate,      "interpolate between vector pairs"},
    169   {1, "jpeg",         jpeg,             "write text line on graph"},
    170   {1, "png",          jpeg,             "write text line on graph"},
    171   {1, "ppm",          jpeg,             "write text line on graph"},
     180  {1, "jpeg",         jpeg,             "convert display image to JPEG"},
    172181  {1, "kern",         kern,             "convolve with 3x3 kernel"},
    173   {1, "keyword",      keyword,          "extract a FITS keyword from buffer header"},
     182  {1, "keyword",      keyword,          "extract a FITS keyword from image header"},
    174183  {1, "labels",       labels,           "define labels for plot"},
    175184  {1, "limits",       limits,           "define plot limits"},
    176   {1, "line",         line,             "plot line"},
    177   {1, "buffers",      list_buffers,     "list the currently allocated buffers"},
    178   {1, "vectors",      list_vectors,     "list vectors"},
    179   {1, "load",         load,             "load an SAOimage style overlay"},
     185  {1, "line",         line,             "plot a line"},
     186  {1, "load",         load,             "load an SAOimage/DS9 style overlay"},
    180187  {1, "lookup",       lookup,           "convert vector via lookup table (vector pair)"},
    181   {1, "mkrgb",        mkrgb,            "convert 3 images to rgb jpeg"},
    182   {1, "mcreate",      mcreate,          "create a matrix"},
     188  {1, "mcreate",      mcreate,          "create an image"},
     189  {1, "imcreate",     mcreate,          "create an image"},
    183190  {1, "medacc",       medacc,           "accumulate vector values in another vector"},
    184   {1, "mget",         mget,             "extract a vector from a matrix"},
     191  {1, "mget",         mget,             "extract a vector from an image"},
     192  {1, "imget",        mget,             "extract a vector from an image"},
    185193  {1, "minterp",      minterp,          "interpolate image pixels"},
    186   {1, "mset",         mset,             "insert a vector in a matrix"},
     194  {1, "iminterp",     minterp,          "interpolate image pixels"},
     195  {1, "mkrgb",        mkrgb,            "convert 3 images to rgb jpeg (use Kapa for better control)"},
     196  {1, "imset",        mset,             "insert a vector in an image"},
     197  {1, "parity",       parity,           "set image parity"},
    187198  {1, "peak",         peak,             "find vector peak in range"},
    188199  {1, "periodogram",  periodogram,      "measure periods in unevenly sampled data"},
    189200  {1, "plot",         plot,             "plot a pair of vectors"},
    190   {1, "dot",          dot,              "plot a single point"},
    191   {1, "point",        point,            "load overlay with single point"},
    192   {1, "ps",           ps,               "define labels for plot"},
     201  {1, "png",          jpeg,             "convert display graphic to PNG"},
     202  {1, "point",        point,            "load image overlay with a single point"},
     203  {1, "ppm",          jpeg,             "convert display graphic to PPM"},
     204  {1, "ps",           ps,               "convert display to PostScript"},
     205  {1, "queuedelete",  queuedelete,      "delete a queue"},
     206  {1, "queuedrop",    queuedrop,        "drop values from queue matching a key"},
     207  {1, "queueinit",    queueinit,        "create an empty queue"},
     208  {1, "queuelist",    queuelist,        "list defined queues"},
     209  {1, "queueload",    queueload,        "load queue from command"},
    193210  {1, "queuepop",     queuepop,         "pop value from queue to variable"},
    194   {1, "queuedrop",    queuedrop,        "drop values from queue matching a key"},
    195211  {1, "queueprint",   queueprint,       "print the contents of a queue"},
    196212  {1, "queuepush",    queuepush,        "push value onto queue"},
    197   {1, "queueinit",    queueinit,        "create an empty queue"},
    198   {1, "queuedelete",  queuedelete,      "delete a queue"},
    199   {1, "queuelist",    queuelist,        "list defined queues"},
    200   {1, "queueload",    queueload,        "load queue from command"},
     213  {1, "queuesize",    queuesize,        "show queue size"},
    201214  {1, "queuesubstr",  queuesubstr,      "bulk replace strings in queue"},
    202   {1, "queuesize",    queuesize,        "show queue size"},
    203215  {1, "rd",           rd,               "load fits image"},
    204216  {1, "rdseg",        rdseg,            "read a segment of an image from a file"},
    205217  {1, "read",         read_vectors,     "read vectors from datafile"},
    206   {1, "rebin",        rebin,            "rebin data by factor of N"},
     218  {1, "rebin",        rebin,            "rebin image data by factor of N"},
    207219  {1, "resize",       resize,           "set graphics/image window size"},
    208220  {1, "roll",         roll,             "roll image to new start point"},
    209221  {1, "rotate",       rotate,           "rotate image"},
    210   {1, "save",         save,             "save an SAOimage style overlay"},
     222  {1, "save",         save,             "save an SAOimage style image overlay"},
    211223  {1, "section",      section,          "define section of graph"},
    212   {1, "set",          set,              "vector math"},
     224  {1, "select",       vect_select,      "selective vector assignment"},
     225  {1, "set",          set,              "image and vector math"},
    213226  {1, "shift",        shift,            "shift data in an image"},
    214227  {1, "sort",         sort_vectors,     "sort list of vectors"},
    215228  {1, "spline.apply", spline_apply_cmd, "apply spline fit to generate an image"},
    216229  {1, "spline.const", spline_construct_cmd, "create spline 2nd deriv. terms"},
    217   {1, "stats",        stats,            "give statistics on a portion of a buffer"},
     230  {1, "stats",        imstats,          "statistics on a portion of an image"},
    218231  {1, "style",        style,            "set the style for graph plots"},
    219232  {1, "subraster",    subraster,        "subraster of fits image"},
    220   {1, "subset",       subset,           "expand vector dimension"},
    221   {1, "svd",          svd,              "singular value decomposition of a matrix"},
     233  {1, "subset",       subset,           "generate a vector from a portion of another vector"},
     234  {1, "svd",          svd,              "singular value decomposition of a matrix (image)"},
    222235  {1, "swapbytes",    swapbytes,        "byte swap thing"},
    223236  {1, "textline",     textline,         "write text line on graph"},
     
    225238  {1, "tvchannel",    tvchannel,        "set the current tv channel"},
    226239  {1, "tvcolors",     tvcolors,         "set the tv colormap"},
    227   {1, "tvcontour",    tvcontour,        "send contour to overlay"},
    228   {1, "tvgrid",       tvgrid,           "wait until return is typed"},
     240  {1, "tvcontour",    tvcontour,        "send contour to image overlay"},
     241  {1, "tvgrid",       tvgrid,           "RA/DEC grid on an image"},
     242  {1, "ungridify",    ungridify,        "convert image region to vector triplet"},
    229243  {1, "uniq",         uniq,             "create a uniq vector subset from a vector"},
    230244  {1, "unsign",       unsign,           "toggle the UNSIGN status"},
    231   {1, "vbin",         vbin,             "bin values in a vector to be within a range"},
     245  {1, "vbin",         vbin,             "rebin vector data by a fector of N"},
    232246  {1, "vclip",        vclip,            "clip values in a vector to be within a range"},
    233   {1, "select",       vect_select,      "selective vector assignment"},
    234   {1, "vgauss",       vgauss,           ""},
    235   {1, "vmaxwell",     vmaxwell,         ""},
    236   {1, "vgrid",        vgrid,            ""},
    237   {1, "vload",        vload,            "load vectors on Kii"},
    238   {1, "vzload",       vzload,           "load vectors on Kii"},
    239   {1, "vstat",        vstat,            "get info from imreg database"},
    240   {1, "vsmooth",      vsmooth,          "gaussian smooth of a vector"},
     247  {1, "vectors",      list_vectors,     "list vectors"},
     248  {1, "vgauss",       vgauss,           "fit a Gaussian to a vector"},
     249  {1, "vgrid",        vgrid,            "generate an image from a triplet of vectors"},
     250  {1, "vhistogram",   histogram,        "generate histogram from vector"},
     251  {1, "vload",        vload,            "load vectors as overlay on image display"},
     252  {1, "vmaxwell",     vmaxwell,         "fit a Maxwellian to a vector"},
     253  {1, "vpop",         vpop,             "remove first element of a vector"},
    241254  {1, "vroll",        vroll,            "roll vector elements"},
    242   {1, "vpop",         vpop,             "remove first element"},
     255  {1, "vsmooth",      vsmooth,          "Gaussian smooth of a vector"},
     256  {1, "vstats",       vstats,           "statistics on a vector"},
     257  {1, "vzload",       vzload,           "load vectors as overlay on image display (scaled points)"},
    243258  {1, "wd",           wd,               "write an image to a file"},
    244259  {1, "write",        write_vectors,    "write vectors to datafile"},
    245   {1, "zap",          zap,              "delete pixels"},
     260  {1, "zap",          zap,              "assign values to pixel regions"},
    246261  {1, "zplot",        zplot,            "plot x y with size scaled by z"},
    247262};
  • trunk/Ohana/src/opihi/dvo/dbExtractAverages.c

    r21153 r21508  
    121121      break;
    122122    case AVE_FLAG:
    123       value.Int = average[0].code;
     123      value.Int = average[0].flags;
    124124      break;
    125125    case AVE_OBJID:
  • trunk/Ohana/src/opihi/dvo/dbExtractImages.c

    r20936 r21508  
    247247      break;
    248248    case IMAGE_FLAG:
    249       value.Int = image[N].code;
     249      value.Int = image[N].flags;
    250250      break;
    251251    case IMAGE_CCDNUM:
  • trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c

    r21153 r21508  
    146146        case MAG_NPHOT:
    147147          if (equiv == NULL) {
    148             value.Int = NAN;
     148            value.Int = 0;
    149149            break;
    150150          }
     
    260260      break;
    261261    case MEAS_OBJFLAGS: /* OK */
    262       value.Int = average[0].code;
     262      value.Int = average[0].flags;
    263263      break;
    264264    // note that these represent the ra displacement relative to the average, not
     
    312312      break;
    313313    case MEAS_DOPHOT: /* OK */
    314       value.Flt = measure[0].dophot;
     314      value.Int = (measure[0].photFlags >> 16);
    315315      break;
    316316    case MEAS_DB_FLAGS: /* ? */
     
    394394      break;
    395395    case MEAS_PSF_QF: /* OK */
    396       value.Flt = measure[0].qPSF;
     396      value.Flt = measure[0].psfQual;
    397397      break;
    398398    case MEAS_PSF_CHISQ: /* OK */
     
    404404    case MEAS_EXT_NSIGMA: /* OK */
    405405      value.Flt = measure[0].extNsigma;
    406       break;
    407     case MEAS_STARGAL: /* OK */
    408       value.Flt = measure[0].stargal;
    409406      break;
    410407
  • trunk/Ohana/src/opihi/dvo/dbFields.c

    r21153 r21508  
    170170  if (!strcasecmp (fieldName, "FWHM_MIN"))   ESCAPE (MEAS_FWHM_MIN,       MAG_NONE, OPIHI_FLT);
    171171  if (!strcasecmp (fieldName, "THETA"))      ESCAPE (MEAS_THETA,          MAG_NONE, OPIHI_FLT);
    172   if (!strcasecmp (fieldName, "DOPHOT"))     ESCAPE (MEAS_DOPHOT,         MAG_NONE, OPIHI_FLT);
     172  if (!strcasecmp (fieldName, "DOPHOT"))     ESCAPE (MEAS_DOPHOT,         MAG_NONE, OPIHI_INT);
    173173  if (!strcasecmp (fieldName, "DB_FLAGS"))   ESCAPE (MEAS_DB_FLAGS,       MAG_NONE, OPIHI_INT);
    174174  if (!strcasecmp (fieldName, "PHOT_FLAGS")) ESCAPE (MEAS_PHOT_FLAGS,     MAG_NONE, OPIHI_INT);
     
    193193  if (!strcasecmp (fieldName, "SKY"))        ESCAPE (MEAS_SKY,            MAG_NONE, OPIHI_FLT);
    194194  if (!strcasecmp (fieldName, "SKY_ERR"))    ESCAPE (MEAS_dSKY,           MAG_NONE, OPIHI_FLT);
    195   if (!strcasecmp (fieldName, "STARGAL"))    ESCAPE (MEAS_STARGAL,        MAG_NONE, OPIHI_FLT);
    196195
    197196  // for words that don't parse, try a photcode
  • trunk/Ohana/src/opihi/dvo/gimages.c

    r21153 r21508  
    220220    if (PixelCoords) {
    221221      gprint (GP_LOG, "%3d %s %6.1f %6.1f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n",
    222                Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].code);
     222               Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].flags);
    223223    } else {
    224224      XY_to_RD (&ra, &dec, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
    225225      gprint (GP_LOG, "%3d %s %8.4f %8.4f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n",
    226                Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].code);
     226               Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].flags);
    227227    }
    228228    sprintf (name, "IMAGEx:%d", Nfound);
  • trunk/Ohana/src/opihi/dvo/gstar.c

    r20936 r21508  
    158158        gprint (GP_LOG, "%3d   ",  catalog.average[k].Nmeasure);
    159159        gprint (GP_LOG, "%4.1f ",  0.01*catalog.average[k].Xp);
    160         gprint (GP_LOG, "%5d",     catalog.average[k].code);
     160        gprint (GP_LOG, "%5d",     catalog.average[k].flags);
    161161
    162162        if (FULL_OUTPUT) {
     
    211211            gprint (GP_LOG, "%7.4f ",  catalog.measure[m].dR);
    212212            gprint (GP_LOG, "%7.4f",   catalog.measure[m].dD);
    213             gprint (GP_LOG, "%2d ",    catalog.measure[m].dophot);
     213            gprint (GP_LOG, "%4x ",    catalog.measure[m].photFlags);
    214214            gprint (GP_LOG, "%3x ",    catalog.measure[m].dbFlags);
    215215            gprint (GP_LOG, "%5d ",    catalog.measure[m].photcode);
     
    233233                gprint (GP_LOG, "%d", catalog.measure[m].detID);
    234234                gprint (GP_LOG, "%d", catalog.measure[m].imageID);
    235                 gprint (GP_LOG, "%f", catalog.measure[m].qPSF);
     235                gprint (GP_LOG, "%f", catalog.measure[m].psfQual);
    236236                gprint (GP_LOG, "%f", catalog.measure[m].psfChisq);
    237237                gprint (GP_LOG, "%f", catalog.measure[m].crNsigma);
     
    240240                gprint (GP_LOG, "%f", 0.01*catalog.measure[m].FWy);
    241241                gprint (GP_LOG, "%f", (360.0/(float)0xffff)*catalog.measure[m].theta);
    242 
    243                 gprint (GP_LOG, "%x", catalog.measure[m].photFlags);
    244                 gprint (GP_LOG, "%d", catalog.measure[m].stargal);
    245242            }
    246243            gprint (GP_LOG, "\n");
  • trunk/Ohana/src/opihi/dvo/paverage.c

    r20936 r21508  
    122122    /* project stars to screen display coords */
    123123    for (i = 0; (i < catalog.Naverage) && !interrupt; i++) {
    124       if (IDclip && (average[i].code != IDchoice)) continue;
     124      if (IDclip && (average[i].flags != IDchoice)) continue;
    125125      average[i].R = ohana_normalize_angle (average[i].R);
    126126      while (average[i].R < Rmin) average[i].R += 360.0;
  • trunk/Ohana/src/opihi/dvo/photometry.c

    r17200 r21508  
    22
    33/* match code to measure  */
    4 # define TESTCODE(C,M) \
    5   if (C != NULL) { \
    6     switch (C[0].type) { \
    7     case PHOT_DEP: \
    8     case PHOT_REF: \
    9       if (C[0].code != M.photcode) continue; \
    10       break; \
    11     case PHOT_SEC: \
    12       if (C[0].code != GetPhotcodeEquivCodebyCode (M.photcode)) continue; \
    13       break; \
    14     default: \
    15       break; \
    16   } }
     4# define TESTCODE(C,M)                                                  \
     5  if (C != NULL) {                                                      \
     6    switch (C[0].type) {                                                \
     7      case PHOT_DEP:                                                    \
     8      case PHOT_REF:                                                    \
     9        if (C[0].code != M.photcode) continue;                          \
     10        break;                                                          \
     11      case PHOT_SEC:                                                    \
     12        if (C[0].code != GetPhotcodeEquivCodebyCode (M.photcode)) continue; \
     13        break;                                                          \
     14      default:                                                          \
     15        break;                                                          \
     16    } }
    1717
    1818/* exclusions based on measure.params  */
    19 # define TESTMEASURE(M) \
    20   if (ApplySelections[SelectionParam]) { \
    21     if (TimeSelect && (M.t < tzero)) continue; \
    22     if (TimeSelect && (M.t > tend)) continue; \
    23     if (ErrSelect  && (M.dM > ErrValue)) continue; \
     19# define TESTMEASURE(M)                                                 \
     20  if (ApplySelections[SelectionParam]) {                                \
     21    if (TimeSelect && (M.t < tzero)) continue;                          \
     22    if (TimeSelect && (M.t > tend)) continue;                           \
     23    if (ErrSelect  && (M.dM > ErrValue)) continue;                      \
     24    if (iMagSelect && (PhotInst (&M) < iMagMin)) continue;              \
     25    if (FlagSelect && (M.dbFlags != FlagValue)) continue;               \
    2426    if (TypeSelect && (TypeValue != GetMeasureTypeCode (&M))) continue; \
    25     if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \
    26     if (FlagSelect && (M.dbFlags != FlagValue)) continue; \
    27   }
    28 
    29 # define SETMAG(MOUT,MEAS,MODE) \
    30   MOUT = NAN; \
    31   if (MODE == MAG_INST) MOUT = PhotInst (&MEAS);  \
    32   if (MODE == MAG_CAT)  MOUT = PhotCat  (&MEAS); \
    33   if (MODE == MAG_SYS)  MOUT = PhotSys  (&MEAS, average, secfilt); \
    34   if (MODE == MAG_REL)  MOUT = PhotRel  (&MEAS, average, secfilt); \
     27  }
     28
     29# define SETMAG(MOUT,MEAS,MODE)                                         \
     30  MOUT = NAN;                                                           \
     31  if (MODE == MAG_INST) MOUT = PhotInst (&MEAS);                        \
     32  if (MODE == MAG_CAT)  MOUT = PhotCat  (&MEAS);                        \
     33  if (MODE == MAG_SYS)  MOUT = PhotSys  (&MEAS, average, secfilt);      \
     34  if (MODE == MAG_REL)  MOUT = PhotRel  (&MEAS, average, secfilt);      \
    3535  if (MODE == MAG_CAL)  MOUT = PhotCal  (&MEAS, average, secfilt, measure, GetPhotcodeEquivbyCode (MEAS.photcode)); \
    3636  if (MODE == MAG_AVE)  MOUT = PhotAve  (GetPhotcodeEquivbyCode (MEAS.photcode), average, secfilt); \
    3737  if (MODE == MAG_REF)  MOUT = PhotRef  (GetPhotcodeEquivbyCode (MEAS.photcode), average, secfilt, measure); \
    38   if (ApplySelections[SelectionParam]) { \
    39     if (MagSelect && (MOUT > MagMax)) continue; \
    40     if (MagSelect && (MOUT < MagMin)) continue; \
     38  if (ApplySelections[SelectionParam]) {                                \
     39    if (MagSelect && (MOUT > MagMax)) continue;                         \
     40    if (MagSelect && (MOUT < MagMin)) continue;                         \
    4141  }
    4242
     
    182182  if (!strcasecmp (parname, "dec"))      param = MEAS_DEC;
    183183  if (!strcasecmp (parname, "mag"))      param = MEAS_MAG;
    184   // if (!strcasecmp (parname, "dmag"))          param = MEAS_dMAG;
    185184  if (!strcasecmp (parname, "airmass"))  param = MEAS_AIRMASS;
    186185  if (!strcasecmp (parname, "exptime"))  param = MEAS_EXPTIME;
     
    190189  if (!strcasecmp (parname, "dD"))       param = MEAS_DEC_OFFSET;
    191190  if (!strcasecmp (parname, "fwhm"))     param = MEAS_FWHM;
    192   // if (!strcasecmp (parname, "dophot"))        param = MEAS_DOPHOT;
    193191  if (!strcasecmp (parname, "FLAGS"))    param = MEAS_DB_FLAGS;
    194192  if (!strcasecmp (parname, "XCCD"))     param = MEAS_XCCD;
     
    198196  if (!strcasecmp (parname, "help")) {
    199197    gprint (GP_ERR, "value may be one of the following:\n");
    200     gprint (GP_ERR, " ra dR dec dD mag dmag Mrel Mcal photcode time fwhm dophot xccd yccd xmosaic ymosaic flags\n");
     198    gprint (GP_ERR, " ra dR dec dD mag dmag Mrel Mcal photcode time fwhm xccd yccd xmosaic ymosaic flags\n");
    201199    gprint (GP_ERR, "value may also be a valid photcode\n");
    202200    gprint (GP_ERR, "photcodes or 'mag' may have optional magnitude type: mag,[Minst, Mcat, Msys, Mrel, Mcal]\n");
     
    311309
    312310  if (VarConfig ("ZERO_PT", "%lf", &ZERO_POINT) == (char *) NULL) {
    313       gprint (GP_ERR, "ZERO_PT undefined in config\n");
    314       return (FALSE);
     311    gprint (GP_ERR, "ZERO_PT undefined in config\n");
     312    return (FALSE);
    315313  }
    316314  SetZeroPoint (ZERO_POINT);
     
    324322
    325323  if (VarConfig ("PHOTCODE_FILE", "%s", MasterPhotcodeFile) == (char *) NULL) {
    326       gprint (GP_ERR, "PHOTCODE_FILE undefined in config\n");
    327       return (FALSE);
     324    gprint (GP_ERR, "PHOTCODE_FILE undefined in config\n");
     325    return (FALSE);
    328326  }
    329327  if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile)) {
     
    642640      break;
    643641    case AVE_FLAG:
    644       value = average[0].code;
     642      value = average[0].flags;
    645643      break;
    646644    case AVE_MAG:
     
    659657          value = NAN;
    660658          for (i = 0; i < average[0].Nmeasure; i++) {
    661               if (code[0].code != measure[i].photcode) continue;
    662               value = measure[i].M;
     659            if (code[0].code != measure[i].photcode) continue;
     660            value = measure[i].M;
    663661          }
    664662          break;
     
    675673      break;
    676674    case AVE_TYPEFRAC:
    677       value = DetermineTypefrac (average, measure, code);
     675      // value = DetermineTypefrac (average, measure, code);
     676      value = NAN;
    678677      break;
    679678    case AVE_NCODE:
     
    719718    if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[k].photcode))) continue;
    720719    Nc ++;
    721     if (measure[k].dophot != TypefracType) continue;
     720    if ((measure[k].photFlags >> 16) != TypefracType) continue;
    722721    Nt ++;
    723722  }
     
    744743
    745744int GetMeasureTypeCode (Measure *measure) {
    746   switch (measure[0].dophot) {
     745  switch ((measure[0].photFlags >> 16)) {
    747746    case 0:
    748747    case 1:
     
    770769  if (IsDophot) {
    771770   
    772     if (measure[0].dophot == 4) return (FALSE);
     771    if ((measure[0].photFlags >> 16) == 4) return (FALSE);
    773772    return (TRUE);
    774773 
     
    866865  if (ErrSelect) {
    867866    dM = PhotdM (code, average, secfilt);
    868     if (dM > ErrValue) return (NAN);
     867    if (dM > ErrValue) return (FALSE);
    869868  }
    870869 
     
    11371136      value = average[0].D - measure[0].dD / 3600.0;
    11381137      break;
    1139 # if (0)
    1140     case MEAS_dMAG: /* OK */
    1141       value = measure[0].dM;
    1142       break;
    11431138    case MEAS_DOPHOT: /* OK */
    1144       value = measure[0].dophot;
    1145       break;
    1146 # endif
     1139      value = (measure[0].photFlags >> 16);
     1140      break;
    11471141    case MEAS_AIRMASS: /* OK */
    11481142      value = measure[0].airmass;
  • trunk/Ohana/src/opihi/dvo/pmeasure.c

    r20936 r21508  
    192192    /* project stars to screen display coords */
    193193    for (i = 0; (i < catalog.Naverage) && !interrupt; i++) {
    194       if (IDclip && (catalog.average[i].code != IDchoice)) continue;
     194      if (IDclip && (catalog.average[i].flags != IDchoice)) continue;
    195195      catalog.average[i].R = ohana_normalize_angle (catalog.average[i].R);
    196196      while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0;
  • trunk/Ohana/src/opihi/include/dvoshell.h

    r21153 r21508  
    106106      MEAS_CR_NSIGMA,
    107107      MEAS_EXT_NSIGMA,
    108       MEAS_STARGAL,
    109108};
    110109
Note: See TracChangeset for help on using the changeset viewer.