IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
23 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/Ohana

  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/addstar/include/skycells.h

    r23352 r24244  
    9898int          sky_triangle_coords            PROTO((SkyTriangle *triangle));
    9999
    100 SkyRectangle *sky_rectangle_ring            PROTO((float dec, float dDEC, int *nring));
     100SkyRectangle *sky_rectangle_ring            PROTO((float dec, float dDEC, int *nring, char *format));
    101101
    102102SkyTriangle *sky_divide_triangles           PROTO((SkyTriangle *in, int *ntriangles));
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/addstar/src/args_skycells.c

    r23352 r24244  
    182182
    183183  fprintf (stderr, "  -mode (name)                : define the type of tessellation.  available options are:\n");
    184   fprintf (stderr, "     SQUARE                   : generate rectangular skycells using icosahedron base solid (default)\n");
     184  fprintf (stderr, "     SQUARE                   : generate rectangular skycells using base solid (default)\n");
    185185  fprintf (stderr, "     TRIANGLE                 : generate triangular skycells using icosahedron base solid\n");
     186  fprintf (stderr, "     RINGS                    : generate rectangular skycells using declination strips\n");
    186187  fprintf (stderr, "     LOCAL                    : generate a local tessellation around a spot on the sky\n");
    187188  fprintf (stderr, "                                 (Note that this tessellation does not cover the full sky)\n");
    188   fprintf (stderr, "  -solid (name)               : specify the base solid\n");
     189  fprintf (stderr, "  -solid (name)               : specify the base solid (default: ICOSAHEDRON)\n");
    189190  fprintf (stderr, "                                value may be one of: TETRAHEDRON, CUBE, OCTOHEDRON, DODECAHEDRON, ICOSAHEDRON\n");
    190191  fprintf (stderr, "                                for convenience, only the first 4 characters are required\n");
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/addstar/src/load_subpix.c

    r3376 r24244  
    2222
    2323  for (i = 0; i < Nsubpix; i++) {
    24     fscanf (f, "%*s %*s %lf %lf %lf %*s\n",
    25             &Subpix[i].Amp, &Subpix[i].Phase, &Subpix[i].dM);
     24      if (fscanf (f, "%*s %*s %lf %lf %lf %*s\n",
     25                  &Subpix[i].Amp, &Subpix[i].Phase, &Subpix[i].dM) != 3) {
     26          Shutdown("can't read subpix datafile %s", SubpixDatafile);
     27      }
    2628  }
    2729  fclose (f);
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/addstar/src/sky_tessalation.c

    r23352 r24244  
    231231int sky_tessellation_rings (FITS_DB *db, int level, int Nmax) {
    232232
    233   int j, nDEC, Nimage, Nring;
     233  int j, nDEC, Nimage, Nring, Ntotal, Ndigit;
    234234  float dec, dDEC;
    235235  SkyRectangle *ring;
    236236  Image *image;
     237  char format[16];
    237238
    238239  // The tessellation has one input parameter: the approximate cell size.  Starting with
     
    246247  nDEC += 2;
    247248
    248   // a test
    249   // for (dec = 0.0 + 0.5*dDEC; dec < +90.0; dec += dDEC) {
     249  // how many total projection cells for this realization?  divide sky area by cell area:
     250  // this is used to set the number of digits, so it does not need to be very accurate...
     251  Ntotal = 41254.2 / (dDEC*dDEC);
     252  Ndigit = (int)(log10(Ntotal)) + 1 ;
     253  snprintf (format, 16, "skycell.%%0%dd", Ndigit);
    250254
    251255  // generate the a collection of rectangles for each ring
    252256  for (dec = -90.0; dec < +90.0 + 0.5*dDEC; dec += dDEC) {
    253257
    254     ring = sky_rectangle_ring (dec, dDEC, &Nring);
     258    ring = sky_rectangle_ring (dec, dDEC, &Nring, format);
    255259    if (!ring) continue;
    256260
     
    534538
    535539// define the parameters of a single sky projection center
    536 SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring) {
    537 
     540SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring, char *format) {
     541
     542  static int Nname = 0;
    538543  int i, NX, NY, nRA;
    539544  SkyRectangle *ring;
     
    631636    strcpy (ring[i].coords.ctype, "DEC--TAN");
    632637
    633     ring[i].NX = NX;
    634     ring[i].NY = NY;
     638    ring[i].NX = NX*(1.0 + PADDING);
     639    ring[i].NY = NY*(1.0 + PADDING);
    635640    ring[i].photcode = 1; // this needs to be set more sensibly
    636641
     642    snprintf (ring[i].name, DVO_IMAGE_NAME_LEN, format, Nname);
     643    Nname++;
    637644
    638645    // fprintf (stderr, "%f %f  : %f %f\n",
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/getstar/src/Shutdown.c

    r7080 r24244  
    2121  va_end (argp);
    2222
     23  if (!db) { exit (2); }
    2324  SetProtect (TRUE);
    2425  gfits_db_close (db);
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libfits/Makefile

    r16093 r24244  
    6060$(EXT)/fits_hdecompress.$(ARCH).o \
    6161$(EXT)/pliocomp.$(ARCH).o \
    62 $(EXT)/ricecomp.$(ARCH).o
     62$(EXT)/ricecomp.$(ARCH).o \
     63$(EXT)/gzip.$(ARCH).o
    6364
    6465OBJS = $(HEADER_OBJ) $(MATRIX_OBJ) $(TABLE_OBJ) $(EXTERN_OBJ)
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libfits/matrix/F_compress_M.c

    r20652 r24244  
    248248    // XXX not certain this is the correct place to do the swap (or if zdata_pixsize is
    249249    // the correct size to guide the swap)
    250     if (!gfits_byteswap_zdata (zdata, Nzdata, zdata_pixsize)) return (FALSE);
     250
     251    if (strcasecmp(cmptype, "GZIP_1")) {
     252      if (!gfits_byteswap_zdata (zdata, Nzdata, zdata_pixsize)) return (FALSE);
     253    }
    251254
    252255    // gfits_uncompress_data uncompresses from zdata to the temporary output buffer which must be allocated
     
    496499
    497500  if (!strcasecmp(cmptype, "GZIP_1")) {
    498     return (4);
     501    if (out_bitpix == 8)  return (1);
     502    if (out_bitpix == 16) return (2);
     503    if (out_bitpix == 32) return (4);
     504    if (out_bitpix == -32) return (4);
     505    if (out_bitpix == -64) return (8);
     506    return (1);
    499507  }
    500508  if (!strcasecmp(cmptype, "RICE_1")) {
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libfits/matrix/F_uncompress_data.c

    r18272 r24244  
    2222int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix);
    2323
     24/* functions defined in gzip.c */
     25int gfits_gz_stripheader (unsigned char *data, int *ndata);
     26int gfits_uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
     27
    2428int gfits_uncompress_data (char *zdata, int Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *outdata, int *Nout, int out_pixsize) {
    2529
     
    3034  if (!strcasecmp(cmptype, "GZIP_1")) {
    3135    unsigned long tNout = *Nout * out_pixsize;
     36
     37    // for GZIP data, I need to check for and remove the header on the first block:
     38    gfits_gz_stripheader ((unsigned char *)zdata, &Nzdata);
     39
    3240    // uncompress does not require us to know the expected number of pixel; it tells us the number
    33     status = uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata);
     41    status = gfits_uncompress ((Bytef *) outdata, &tNout, (Bytef *) zdata, Nzdata);
    3442    if (status != Z_OK) {
    3543      fprintf (stderr, "error in uncompress (GZIP)\n");
    3644      return (FALSE);
    3745    }
    38     *Nout = tNout;
     46    *Nout = tNout / out_pixsize;
     47
     48    // the resulting uncompressed data is byteswapped
     49    if (!gfits_byteswap_zdata (outdata, *Nout, out_pixsize)) return (FALSE);
     50
    3951    return (TRUE);
    4052  }
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libohana/src/gaussj.c

    r16120 r24244  
    11# include <ohana.h>
     2# define GROWTHTEST 0
     3# define MAX_RANGE 1.0e7
    24
    35// Gauss-Jordan elimination using full pivots based on Press et al's description.  Substantially
    46// reworked for Ohana: major modifications to conform to C indexing, use a boolean to track the
    57// completed pivot rows and catch the singular matrix early on.  Also, much cleaner control loops
    6 // than their implementation.  XXX this really needs to check on round-off errors (see version by
    7 // William Kahan
     8// than their implementation.  (largely based on version by William Kahan)
     9
     10// MAX_RANGE is used to test for ill-conditioned input matrices.  For an ill-conditioned
     11// matrix, one or more of the pivots trends towards zero.  Rather than allow this to go to the
     12// numerical precision, I am raising an error if |growth| > 1e8
    813int dgaussjordan (double **A, double **B, int N, int M) {
    914
     
    1924  memset (pivot, 0, N*sizeof(int));
    2025
     26  double growth = 1.0;
     27
    2128  // determine underflow conditions
    2229  // double underFlow = DBL_MIN;
    23 # if (0)
     30# if (GROWTHTEST)
    2431  double roundTest = 4.0;
    2532  roundTest /= 3.0;
    2633  roundTest -= 1.0;
    2734  double epsilon = fabs(((roundTest+roundTest) - 1.0) + roundTest);
    28   double growth = 1.0;
    2935# endif
    3036
     
    5763    }
    5864
     65# if (GROWTHTEST)
     66    fprintf (stderr, "maxcol: %d\n", maxcol);
     67    fprintf (stderr, "full A matrix:\n");
     68    for (row = 0; row < N; row++) {
     69        for (col = 0; col < N; col++) {
     70            fprintf (stderr, "%10.3e ", A[row][col]);
     71        }
     72        fprintf (stderr, "\n");
     73    }
     74    fprintf (stderr, "\n");
     75# endif
     76
    5977    // if pivot[maxcol] is set, we have already done this row: this implies a singular matrix
    6078    if (pivot[maxcol]) goto escape;
     
    7694    for (col = 0; col < N; col++) A[maxcol][col] *= tmpval;
    7795    for (col = 0; col < M; col++) B[maxcol][col] *= tmpval;
    78     // XXX measure the pivot growth and trigger on over/under flow
    79     // growth *= tmpval;
    80     // fprintf (stderr, "column: %d, growth: %e, epsilon: %e\n", maxcol, growth, epsilon);
     96
     97    // check for ill-conditioned matrix
     98    growth *= tmpval;
     99
     100    // report the pivot growth
     101#   if (GROWTHTEST)
     102    fprintf (stderr, "column: %d, maxval : %f, growth: %e, epsilon: %e\n", maxcol, tmpval, growth, epsilon);
     103    fprintf (stderr, "A diagonal: ");
     104    for (col = 0; col < N; col++) fprintf (stderr, "%f ", A[col][col]);
     105    fprintf (stderr, "\n");
     106# endif
     107
     108    if (fabs(growth) > MAX_RANGE) goto escape;
    81109
    82110    /* adjust the elements above the pivot */
     
    122150  memset (pivot, 0, N*sizeof(int));
    123151
     152  float growth = 1.0;
     153
    124154  // determine underflow conditions
    125155  // float underFlow = FLT_MIN;
    126 # if (0)
     156# if (GROWTHTEST)
    127157  float roundTest = 4.0;
    128158  roundTest /= 3.0;
    129159  roundTest -= 1.0;
    130160  float epsilon = fabs(((roundTest+roundTest) - 1.0) + roundTest);
    131   float growth = 1.0;
    132161# endif
    133162
     
    179208    for (col = 0; col < N; col++) A[maxcol][col] *= tmpval;
    180209    for (col = 0; col < M; col++) B[maxcol][col] *= tmpval;
    181     // growth *= tmpval;
    182     // fprintf (stderr, "column: %d, growth: %e, epsilon: %e\n", maxcol, growth, epsilon);
     210
     211    // check for ill-conditioned matrix
     212    growth *= tmpval;
     213
     214    // report the pivot growth
     215#   if (GROWTHTEST)
     216    fprintf (stderr, "column: %d, maxval : %f, growth: %e, epsilon: %e\n", maxcol, tmpval, growth, epsilon);
     217    fprintf (stderr, "A diagonal: ");
     218    for (col = 0; col < N; col++) fprintf (stderr, "%f ", A[col][col]);
     219    fprintf (stderr, "\n");
     220# endif
     221
     222    if (fabs(growth) > MAX_RANGE) goto escape;
    183223
    184224    /* adjust the elements above the pivot */
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/cmd.astro/coord_systems.c

    r18122 r24244  
    123123  // atan2 returns -pi : +pi
    124124  *x = DEG_RAD * atan2 (sin_x, cos_x) + transform->xo;
    125   if ((*x) < 0.0) (*x) += 360;
     125  if ((*x) <   0.0) (*x) += 360;
     126  if ((*x) > 360.0) (*x) -= 360;
    126127
    127128  // should be in range -pi/2 : +pi/2
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/cmd.data/fit1d.c

    r21508 r24244  
    125125      }
    126126    }
    127     if (!dgaussjordan (c, b, nterm, 1)) goto escape;
     127    if (!dgaussjordan (c, b, nterm, 1)) {
     128        gprint (GP_ERR, "failed to fit data : ill-conditioned matrix\n");
     129        goto escape;
     130    }
    128131
    129132    /* generate fitted values */
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/cmd.data/gaussj.c

    r20936 r24244  
    4747  status = dgaussjordan (a, b, N, 1);
    4848
    49   // output vector needs to be float, so re-cast it
    50   ResetVector (B, OPIHI_FLT, N);
    51   vf = B[0].elements.Flt;
     49  // if dgaussjordan succeeds, replace the input values with the results
     50  if (status) {
     51    // output vector needs to be float, so re-cast it
     52    ResetVector (B, OPIHI_FLT, N);
     53    vf = B[0].elements.Flt;
    5254
    53   for (i = 0; i < N; i++) {
    54     for (j = 0; j < N; j++) {
    55        m[i+j*N] = a[i][j];
     55    for (i = 0; i < N; i++) {
     56      for (j = 0; j < N; j++) {
     57        m[i+j*N] = a[i][j];
     58      }
     59      vf[i] = b[i][0];
    5660    }
    57     vf[i] = b[i][0];
    5861  }
    5962
     
    6669
    6770  if (!status && !QUIET) {
    68       gprint (GP_ERR, "failure in matrix solution\n");
     71      gprint (GP_ERR, "gaussjordan: ill-conditioned matrix; input values are retained\n");
    6972  }
    7073  return (status);
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/cmd.data/init.c

    r21541 r24244  
    193193  {1, "iminterp",     minterp,          "interpolate image pixels"},
    194194  {1, "mkrgb",        mkrgb,            "convert 3 images to rgb jpeg (use Kapa for better control)"},
     195  {1, "mset",         mset,             "insert a vector in an image"},
    195196  {1, "imset",        mset,             "insert a vector in an image"},
    196197  {1, "parity",       parity,           "set image parity"},
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dimm/camera_cmds.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dimm/telescope_cmds.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dvo/avextract.c

    r21086 r24244  
    205205    gprint (GP_ERR, "  <photcode>:cal : first calibrated magnitude for <photcode> \n");
    206206    gprint (GP_ERR, "  <photcode>:err : magnitude error for photcode\n");
    207     gprint (GP_ERR, "  <photcode>:chipsq : chi-square of magnitude fit\n");
     207    gprint (GP_ERR, "  <photcode>:chisq : raw chi-square of magnitude fit\n");
    208208    gprint (GP_ERR, "  type : dophot type (unused)\n");
    209209    gprint (GP_ERR, "  typefrac : dophot type fraction (unused)\n");
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dvo/gstar.c

    r21508 r24244  
    1414  int Nstars, found, GetMeasures, Nlo, Nhi;
    1515  int SaveVectors;
    16   Vector *vec1, *vec2, *vec3, *vec4;
     16  Vector *vec1, *vec2, *vec3, *vec4, *vec5, *vec6;
    1717  SkyTable *sky;
    1818  SkyList *skylist;
     
    3737
    3838  NPTS = 0;
    39   vec1 = vec2 = vec3 = vec4 = NULL;
     39  vec1 = vec2 = vec3 = vec4 = vec5 = vec6 = NULL;
    4040  SaveVectors = FALSE;
    4141  if ((N = get_argument (argc, argv, "-save"))) {
     
    4646    if ((vec3 = SelectVector ("gs:z", ANYVECTOR, TRUE)) == NULL) return (FALSE);
    4747    if ((vec4 = SelectVector ("gs:f", ANYVECTOR, TRUE)) == NULL) return (FALSE);
     48    if ((vec5 = SelectVector ("gs:dr", ANYVECTOR, TRUE)) == NULL) return (FALSE);
     49    if ((vec6 = SelectVector ("gs:dd", ANYVECTOR, TRUE)) == NULL) return (FALSE);
    4850  }
    4951
     
    8789  /* lock, load, unlock catalog */
    8890  catalog.filename = skylist[0].filename[0];
    89   catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
     91  catalog.catflags = GetMeasures ? LOAD_AVES | LOAD_MEAS | LOAD_SECF : LOAD_AVES | LOAD_SECF;
    9092  catalog.Nsecfilt = 0;
    9193
     
    140142    ResetVector (vec3, OPIHI_FLT, NPTS);
    141143    ResetVector (vec4, OPIHI_FLT, NPTS);
     144    ResetVector (vec5, OPIHI_FLT, NPTS);
     145    ResetVector (vec6, OPIHI_FLT, NPTS);
    142146  }
    143147
     
    156160        gprint (GP_LOG, "%11.7f ", catalog.average[k].R);
    157161        gprint (GP_LOG, "%11.7f ", catalog.average[k].D);
     162        gprint (GP_LOG, "%5.2f ",   3600.0*sqrt(r));
    158163        gprint (GP_LOG, "%3d   ",  catalog.average[k].Nmeasure);
    159164        gprint (GP_LOG, "%4.1f ",  0.01*catalog.average[k].Xp);
    160         gprint (GP_LOG, "%5d",     catalog.average[k].flags);
    161 
     165        gprint (GP_LOG, "%5d ",     catalog.average[k].flags);
     166       
    162167        if (FULL_OUTPUT) {
    163             gprint (GP_LOG, "%f",     catalog.average[k].dR);
    164             gprint (GP_LOG, "%f",     catalog.average[k].dD);
    165             gprint (GP_LOG, "%f",     catalog.average[k].uR);
    166             gprint (GP_LOG, "%f",     catalog.average[k].uD);
    167             gprint (GP_LOG, "%f",     catalog.average[k].duR);
    168             gprint (GP_LOG, "%f",     catalog.average[k].duD);
    169             gprint (GP_LOG, "%f",     catalog.average[k].P);
    170             gprint (GP_LOG, "%f",     catalog.average[k].dP);
    171             gprint (GP_LOG, "%x",     catalog.average[k].objID);
    172             gprint (GP_LOG, "%x",     catalog.average[k].catID);
     168            gprint (GP_LOG, "%f ",     catalog.average[k].dR);
     169            gprint (GP_LOG, "%f ",     catalog.average[k].dD);
     170            gprint (GP_LOG, "%f ",     catalog.average[k].uR);
     171            gprint (GP_LOG, "%f ",     catalog.average[k].uD);
     172            gprint (GP_LOG, "%f ",     catalog.average[k].duR);
     173            gprint (GP_LOG, "%f ",     catalog.average[k].duD);
     174            gprint (GP_LOG, "%f ",     catalog.average[k].P);
     175            gprint (GP_LOG, "%f ",     catalog.average[k].dP);
     176            gprint (GP_LOG, "%x ",     catalog.average[k].objID);
     177            gprint (GP_LOG, "%x ",     catalog.average[k].catID);
    173178        }
    174179
     
    210215            gprint (GP_LOG, "%20s  ",  date);
    211216            gprint (GP_LOG, "%7.4f ",  catalog.measure[m].dR);
    212             gprint (GP_LOG, "%7.4f",   catalog.measure[m].dD);
     217            gprint (GP_LOG, "%7.4f ",  catalog.measure[m].dD);
    213218            gprint (GP_LOG, "%4x ",    catalog.measure[m].photFlags);
    214219            gprint (GP_LOG, "%3x ",    catalog.measure[m].dbFlags);
    215220            gprint (GP_LOG, "%5d ",    catalog.measure[m].photcode);
    216             gprint (GP_LOG, "%-20s  ", GetPhotcodeNamebyCode (catalog.measure[m].photcode));
    217             gprint (GP_LOG, "%5.2f ",  0.01*catalog.measure[m].FWx);
     221            gprint (GP_LOG, "%-20s ", GetPhotcodeNamebyCode (catalog.measure[m].photcode));
     222            gprint (GP_LOG, "%5.2f ",  0.01*catalog.measure[m].FWx);
    218223            gprint (GP_LOG, "%5.2f ",  0.01*catalog.measure[m].FWy);
    219224
    220225            if (FULL_OUTPUT) {
    221                 gprint (GP_LOG, "%f", catalog.measure[m].Mcal);
    222                 gprint (GP_LOG, "%f", catalog.measure[m].Map);
    223                 gprint (GP_LOG, "%f", pow(10.0, 0.4*catalog.measure[m].dt));
    224                 gprint (GP_LOG, "%f", 1.0 + catalog.measure[m].airmass);
    225                 gprint (GP_LOG, "%f", catalog.measure[m].az);
    226                 gprint (GP_LOG, "%f", catalog.measure[m].Xccd);
    227                 gprint (GP_LOG, "%f", catalog.measure[m].Yccd);
    228                 gprint (GP_LOG, "%d", catalog.measure[m].dXccd);
    229                 gprint (GP_LOG, "%d", catalog.measure[m].dYccd);
    230                 gprint (GP_LOG, "%f", catalog.measure[m].Sky);
    231                 gprint (GP_LOG, "%f", catalog.measure[m].dSky);
    232                 gprint (GP_LOG, "%d", catalog.measure[m].averef);
    233                 gprint (GP_LOG, "%d", catalog.measure[m].detID);
    234                 gprint (GP_LOG, "%d", catalog.measure[m].imageID);
    235                 gprint (GP_LOG, "%f", catalog.measure[m].psfQual);
    236                 gprint (GP_LOG, "%f", catalog.measure[m].psfChisq);
    237                 gprint (GP_LOG, "%f", catalog.measure[m].crNsigma);
    238                 gprint (GP_LOG, "%f", catalog.measure[m].extNsigma);
    239                 gprint (GP_LOG, "%f", 0.01*catalog.measure[m].FWx);
    240                 gprint (GP_LOG, "%f", 0.01*catalog.measure[m].FWy);
    241                 gprint (GP_LOG, "%f", (360.0/(float)0xffff)*catalog.measure[m].theta);
     226                gprint (GP_LOG, "%f ", catalog.measure[m].Mcal);
     227                gprint (GP_LOG, "%f ", catalog.measure[m].Map);
     228                gprint (GP_LOG, "%f ", pow(10.0, 0.4*catalog.measure[m].dt));
     229                gprint (GP_LOG, "%f ", 1.0 + catalog.measure[m].airmass);
     230                gprint (GP_LOG, "%f ", catalog.measure[m].az);
     231                gprint (GP_LOG, "%f ", catalog.measure[m].Xccd);
     232                gprint (GP_LOG, "%f ", catalog.measure[m].Yccd);
     233                gprint (GP_LOG, "%d ", catalog.measure[m].dXccd);
     234                gprint (GP_LOG, "%d ", catalog.measure[m].dYccd);
     235                gprint (GP_LOG, "%f ", catalog.measure[m].Sky);
     236                gprint (GP_LOG, "%f ", catalog.measure[m].dSky);
     237                gprint (GP_LOG, "%d ", catalog.measure[m].averef);
     238                gprint (GP_LOG, "%d ", catalog.measure[m].detID);
     239                gprint (GP_LOG, "%d ", catalog.measure[m].imageID);
     240                gprint (GP_LOG, "%f ", catalog.measure[m].psfQual);
     241                gprint (GP_LOG, "%f ", catalog.measure[m].psfChisq);
     242                gprint (GP_LOG, "%f ", catalog.measure[m].crNsigma);
     243                gprint (GP_LOG, "%f ", catalog.measure[m].extNsigma);
     244                gprint (GP_LOG, "%f ", 0.01*catalog.measure[m].FWx);
     245                gprint (GP_LOG, "%f ", 0.01*catalog.measure[m].FWy);
     246                gprint (GP_LOG, "%f ", (360.0/(float)0xffff)*catalog.measure[m].theta);
    242247            }
    243248            gprint (GP_LOG, "\n");
     
    251256            vec3[0].elements.Flt[N] = catalog.measure[m].airmass;
    252257            vec4[0].elements.Flt[N] = catalog.measure[m].photcode;
     258            vec5[0].elements.Flt[N] = catalog.measure[m].dR;
     259            vec6[0].elements.Flt[N] = catalog.measure[m].dD;
    253260            N ++;
    254261            if (N == NPTS - 1) {
     
    258265              REALLOCATE (vec3[0].elements.Flt, opihi_flt, NPTS);
    259266              REALLOCATE (vec4[0].elements.Flt, opihi_flt, NPTS);
     267              REALLOCATE (vec5[0].elements.Flt, opihi_flt, NPTS);
     268              REALLOCATE (vec6[0].elements.Flt, opihi_flt, NPTS);
    260269            }
    261270          }
     
    270279    vec3[0].Nelements = N;
    271280    vec4[0].Nelements = N;
     281    vec5[0].Nelements = N;
     282    vec6[0].Nelements = N;
    272283  }
    273284
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dvo/mextract.c

    r21086 r24244  
    226226    gprint (GP_ERR, "  <photcode>:cal :  calibrated magnitude for photcode \n");
    227227    gprint (GP_ERR, "  <photcode>:err : magnitude error for photcode\n");
    228     gprint (GP_ERR, "  <photcode>:chisq : chi-square of magnitude fit\n");
     228    gprint (GP_ERR, "  <photcode>:chisq : raw chi-square of magnitude fit\n");
    229229    gprint (GP_ERR, "  <photcode>:ncode : number of measurements in photcode\n");
    230230    gprint (GP_ERR, "  <photcode>:nphot : number of measurements used for average magnitude\n");
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dvo/mmextract.c

    r20936 r24244  
    348348    gprint (GP_ERR, "  photcode:cal :  calibrated magnitude for photcode \n");
    349349    gprint (GP_ERR, "  photcode:err : magnitude error for photcode\n");
    350     gprint (GP_ERR, "  photcode:chisq : chi-square of magnitude fit\n");
     350    gprint (GP_ERR, "  photcode:chisq : raw chi-square of magnitude fit\n");
    351351    gprint (GP_ERR, "  photcode:ncode : number of measurements in photcode\n");
    352352    gprint (GP_ERR, "  photcode:nphot : number of measurements used for average magnitude\n");
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/lib.shell/gprint.c

    r23594 r24244  
    306306    status = vfprintf (stream[0].file, format, argp);
    307307    if (status < 0) {
    308       abort();
     308      return (FALSE);
    309309    }
    310310  } else {
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/tools/src/fields.c

    r15905 r24244  
    6060  while (fscanf (stdin, "%s", filename) != EOF) {
    6161    if (!Extnum && !Extname) {
    62       GotFile &= gfits_read_header (filename, &header);
     62      if (!gfits_read_header (filename, &header)) continue;
     63      GotFile = TRUE;
    6364      GotField &= print_fields (filename, NULL, &header, argc, argv);
    6465      continue;
    6566    }
    6667    if (Extnum) {
    67       GotFile  &= gfits_read_Xheader (filename, &header, Nextend);
     68      if (!gfits_read_Xheader (filename, &header, Nextend)) continue;
     69      GotFile = TRUE;
    6870      GotField &= print_fields (filename, NULL, &header, argc, argv);
    6971      continue;
     
    98100        Nextend ++;
    99101
    100         GotFile = gfits_read_Xheader (filename, &header, Nextend);
     102        GotFile &= gfits_read_Xheader (filename, &header, Nextend);
    101103        continue;
    102104      }
Note: See TracChangeset for help on using the changeset viewer.