IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37901


Ignore:
Timestamp:
Feb 6, 2015, 12:11:09 PM (11 years ago)
Author:
eugene
Message:

add new functions tdhistogram and squash3d

Location:
branches/eam_branches/ipp-20150112/Ohana/src/opihi
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150112/Ohana/src/opihi/cmd.astro/cdhistogram.c

    r37850 r37901  
    22
    33# define CHECKVAL(ARG) if (!isfinite(ARG)) { gprint (GP_ERR, "illegal value for %s: %f\n", #ARG, ARG); return (FALSE); }
    4 enum {IS_DOT, IS_SQUARE, IS_CIRCLE, IS_GAUSS};
    54
    65int cdhistogram (int argc, char **argv) {
  • branches/eam_branches/ipp-20150112/Ohana/src/opihi/cmd.data/Makefile

    r37853 r37901  
    6161$(SRC)/ungridify.$(ARCH).o     \
    6262$(SRC)/histogram.$(ARCH).o      \
     63$(SRC)/tdhistogram.$(ARCH).o    \
    6364$(SRC)/hermitian1d.$(ARCH).o    \
    6465$(SRC)/hermitian2d.$(ARCH).o    \
     
    131132$(SRC)/imspline_apply.$(ARCH).o \
    132133$(SRC)/imspline_construct.$(ARCH).o \
     134$(SRC)/squash3d.$(ARCH).o          \
    133135$(SRC)/imstats.$(ARCH).o           \
    134136$(SRC)/style.$(ARCH).o             \
  • branches/eam_branches/ipp-20150112/Ohana/src/opihi/cmd.data/init.c

    r37850 r37901  
    5151int ungridify        PROTO((int, char **));
    5252int histogram        PROTO((int, char **));
     53int tdhistogram      PROTO((int, char **));
    5354int hermitian1d      PROTO((int, char **));
    5455int hermitian2d      PROTO((int, char **));
     
    118119int imspline_apply   PROTO((int, char **));
    119120int imspline_construct PROTO((int, char **));
     121int squash3d         PROTO((int, char **));
    120122int stats            PROTO((int, char **));
    121123int imstats          PROTO((int, char **));
     
    218220  {1, "header",       header,           "print image header"},
    219221  {1, "histogram",    histogram,        "generate histogram from vector"},
     222  {1, "tdhistogram",  tdhistogram,      "generate 2D histogram image from vector set"},
    220223  {1, "hermitian1d",  hermitian1d,      "generate 1-D Hermitian Polynomial"},
    221224  {1, "hermitian2d",  hermitian2d,      "generate 2-D Hermitian Polynomial"},
     
    291294  {1, "imspline.apply", imspline_apply, "apply spline fit to generate an image"},
    292295  {1, "imspline.const", imspline_construct, "create spline 2nd deriv. terms"},
     296  {1, "squash3d",     squash3d,         "squash 3d buffer to 2d"},
    293297  {1, "stats",        imstats,          "statistics on a portion of an image"},
    294298  {1, "style",        style,            "set the style for graph plots"},
  • branches/eam_branches/ipp-20150112/Ohana/src/opihi/cmd.data/read_vectors.c

    r37807 r37901  
    372372  }
    373373
     374  int VERBOSE = FALSE;
     375  if ((N = get_argument (argc, argv, "-v"))) {
     376    remove_argument (N, &argc, argv);
     377    VERBOSE = TRUE;
     378  }
     379
    374380  int start = 0;
    375381  int Nrows = -1; // -1 : read entire table
     
    399405  // }
    400406
    401   if (argc < 2) ESCAPE ("USAGE: read -fits extension [-extnum] [-keyword key] name name ...\n");
     407  if ((argc < 2) && !getSizes) ESCAPE ("USAGE: read -fits extension [-extnum] [-keyword key] name name ...\n");
     408  if ((argc != 1) && getSizes) ESCAPE ("USAGE: read -sizes -fits extension [-extnum] (does not read data values)\n");
    402409
    403410  if (f == NULL) ESCAPE ("file not found\n");
     
    436443    if (start >= header.Naxis[1]) ESCAPE ("invalid range: start >= Ny (%d)\n", header.Naxis[1]);
    437444    if (Nrows < 0) ESCAPE ("invalid range: Nrows < 0\n");
    438     if (start + Nrows > header.Naxis[1]) ESCAPE ("invalid range: start + Nrows > Ny (%d)\n", header.Naxis[1]);
     445
     446    // just a warning:
     447    if (start + Nrows > header.Naxis[1]) {
     448      if (VERBOSE) gprint (GP_ERR, "NOTE: reading last block will return only %d rows\n", header.Naxis[1] - start);
     449    }
    439450
    440451    // Ny = 100, start = 0, Nrows = -1 -> Nrows => 100
     
    472483      }
    473484
     485      if (getSizes) {
     486        read_table_sizes (&header);
     487        if (CCDKeyword != NULL) free (CCDKeyword);
     488        gfits_free_header (&header);
     489        return TRUE;
     490      }
     491
    474492      if (Nrows == -1) {
    475493        Nrows = header.Naxis[1] - start;
     
    478496      if (start >= header.Naxis[1]) ESCAPE ("invalid range: start >= Ny (%d)\n", header.Naxis[1]);
    479497      if (Nrows < 0) ESCAPE ("invalid range: Nrows < 0\n");
    480       if (start + Nrows > header.Naxis[1]) ESCAPE ("invalid range: start + Nrows > Ny (%d)\n", header.Naxis[1]);
     498
     499      // just a warning:
     500      if (start + Nrows > header.Naxis[1]) {
     501        if (VERBOSE) gprint (GP_ERR, "NOTE: reading last block will return only %d rows\n", header.Naxis[1] - start);
     502      }
    481503
    482504      if (!gfits_fread_ftable_range (f, padIfShort, &table, start, Nrows)) ESCAPE ("error reading table for extension %d\n", Nextend);
     
    603625
    604626  set_int_variable ("table:Nx", header->Naxis[0]);
    605   set_int_variable ("table:Nx", header->Naxis[0]);
     627  set_int_variable ("table:Ny", header->Naxis[1]);
    606628  set_int_variable ("table:Nfields", Nfields);
    607629
Note: See TracChangeset for help on using the changeset viewer.