IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38344


Ignore:
Timestamp:
Jun 1, 2015, 8:56:11 AM (11 years ago)
Author:
eugene
Message:

extending gfits_table_get_ APIs to allow separate scaling from swapping, in prep of using compression on tables

Location:
branches/eam_branches/ohana.20150429/src
Files:
66 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/addstar/src/ReadStarsFITS.c

    r37995 r38344  
    153153  off_t Nstars;
    154154  unsigned int i;
    155   char swapped;
    156155  double ZeroPt;
    157156  Stars *stars = NULL;
    158157  SMPData *smpdata = NULL;
    159158
    160   swapped = FALSE;
    161   smpdata = gfits_table_get_SMPData (table, &Nstars, &swapped);
     159  smpdata = gfits_table_get_SMPData (table, &Nstars, NULL, NULL);
    162160  if (!smpdata) {
    163161    fprintf (stderr, "skipping inconsistent entry\n");
     
    229227  PS1_DEV_0 *ps1data;
    230228
    231   ps1data = gfits_table_get_PS1_DEV_0 (table, &Nstars, NULL);
     229  ps1data = gfits_table_get_PS1_DEV_0 (table, &Nstars, NULL, NULL);
    232230  if (!ps1data) {
    233231    fprintf (stderr, "skipping inconsistent entry\n");
     
    300298  PS1_DEV_1 *ps1data;
    301299
    302   ps1data = gfits_table_get_PS1_DEV_1 (table, &Nstars, NULL);
     300  ps1data = gfits_table_get_PS1_DEV_1 (table, &Nstars, NULL, NULL);
    303301  if (!ps1data) {
    304302    fprintf (stderr, "skipping inconsistent entry\n");
     
    383381  }
    384382
    385   ps1data = gfits_table_get_CMF_PS1_V1 (table, &Nstars, NULL);
     383  ps1data = gfits_table_get_CMF_PS1_V1 (table, &Nstars, NULL, NULL);
    386384  if (!ps1data) {
    387385    fprintf (stderr, "skipping inconsistent entry\n");
     
    545543  CMF_PS1_V2 *ps1data;
    546544
    547   ps1data = gfits_table_get_CMF_PS1_V2 (table, &Nstars, NULL);
     545  ps1data = gfits_table_get_CMF_PS1_V2 (table, &Nstars, NULL, NULL);
    548546  if (!ps1data) {
    549547    fprintf (stderr, "skipping inconsistent entry\n");
     
    622620  CMF_PS1_V3 *ps1data;
    623621
    624   ps1data = gfits_table_get_CMF_PS1_V3 (table, &Nstars, NULL);
     622  ps1data = gfits_table_get_CMF_PS1_V3 (table, &Nstars, NULL, NULL);
    625623  if (!ps1data) {
    626624    fprintf (stderr, "skipping inconsistent entry\n");
     
    706704  CMF_PS1_V4 *ps1data;
    707705
    708   ps1data = gfits_table_get_CMF_PS1_V4 (table, &Nstars, NULL);
     706  ps1data = gfits_table_get_CMF_PS1_V4 (table, &Nstars, NULL, NULL);
    709707  if (!ps1data) {
    710708    fprintf (stderr, "skipping inconsistent entry\n");
     
    12591257  }
    12601258
    1261   ps1data = gfits_table_get_CMF_PS1_SV1 (table, &Nstars, NULL);
     1259  ps1data = gfits_table_get_CMF_PS1_SV1 (table, &Nstars, NULL, NULL);
    12621260  if (!ps1data) {
    12631261    fprintf (stderr, "skipping inconsistent entry\n");
     
    14231421  CMF_PS1_SV2 *ps1data;
    14241422
    1425   ps1data = gfits_table_get_CMF_PS1_SV2 (table, &Nstars, NULL);
     1423  ps1data = gfits_table_get_CMF_PS1_SV2 (table, &Nstars, NULL, NULL);
    14261424  if (!ps1data) {
    14271425    fprintf (stderr, "skipping inconsistent entry\n");
     
    17531751  CMF_PS1_DV4 *ps1data;
    17541752
    1755   ps1data = gfits_table_get_CMF_PS1_DV4 (table, &Nstars, NULL);
     1753  ps1data = gfits_table_get_CMF_PS1_DV4 (table, &Nstars, NULL, NULL);
    17561754  if (!ps1data) {
    17571755    fprintf (stderr, "skipping inconsistent entry\n");
     
    18391837  CMF_PS1_DV5 *ps1data;
    18401838
    1841   ps1data = gfits_table_get_CMF_PS1_DV5 (table, &Nstars, NULL);
     1839  ps1data = gfits_table_get_CMF_PS1_DV5 (table, &Nstars, NULL, NULL);
    18421840  if (!ps1data) {
    18431841    fprintf (stderr, "skipping inconsistent entry\n");
  • branches/eam_branches/ohana.20150429/src/addstar/src/findskycell.c

    r37116 r38344  
    183183  // convert database table to internal structure (binary to Image)
    184184  // 'image' points to the same memory as db->ftable->buffer
    185   image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     185  image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    186186  if (!image) {
    187187      fprintf (stderr, "ERROR: failed to read images\n");
     
    567567  // convert database table to internal structure (binary to Image)
    568568  // 'image' points to the same memory as db->ftable->buffer
    569   image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     569  image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    570570  if (!image) {
    571571    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/addstar/src/skycells_to_mdc.c

    r33720 r38344  
    55    // Convert FITS_DB to images structure
    66    off_t NdbImages;
    7     Image *dbImages = gfits_table_get_Image(&db->ftable, &NdbImages, &db->swapped);
     7    Image *dbImages = gfits_table_get_Image(&db->ftable, &NdbImages, &db->scaledValue, &db->nativeOrder);
    88
    99    // If tess_id was not supplied assume that it is the basename of the CATDIR
  • branches/eam_branches/ohana.20150429/src/checkastro/src/load_images.c

    r37807 r38344  
    1010
    1111  // convert database table to internal structure
    12   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     12  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1313  if (!image) {
    1414      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/delstar/src/delete_duplicate_images.c

    r36833 r38344  
    1616  Image *image, *outimage;
    1717
    18   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     18  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1919  if (!image) {
    2020    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/delstar/src/delete_image_photcodes.c

    r34749 r38344  
    1212  PhotCode **photcodes = ParsePhotcodeList (PHOTCODE_LIST, &Nphotcodes, FALSE);
    1313
    14   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     14  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1515  if (!image) {
    1616    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/delstar/src/delete_imagename.c

    r37807 r38344  
    1818  SkyTableSetFilenames (sky, CATDIR, "cpt");
    1919
    20   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     20  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    2121  if (!image) {
    2222    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/delstar/src/delete_times.c

    r37807 r38344  
    2525  skylist[0].ownElements = FALSE; // free these elements when freeing the list
    2626
    27   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     27  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    2828  if (!image) {
    2929    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/delstar/src/delstar.c

    r35837 r38344  
    3030    case MODE_FIX_LAP: {
    3131        off_t Nimage;
    32         Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     32        Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    3333        if (!image) {
    3434          fprintf (stderr, "ERROR: failed to read images\n");
     
    6767    case MODE_FIX_LAP_STATS: {
    6868        off_t Nimage;
    69         Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     69        Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    7070        if (!image) {
    7171          fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/delstar/src/find_image_db.c

    r29001 r38344  
    1616  }
    1717
    18   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     18  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1919  if (!image) {
    2020    fprintf (stderr, "ERROR: failed to read images\n");
     
    4646  int code;
    4747
    48   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     48  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    4949
    5050  start = timage[0].tzero - MAX(0.01*timage[0].trate*timage[0].NY, 1);
     
    7676  Image *image;
    7777
    78   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     78  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    7979
    8080  Nlist = 0;
  • branches/eam_branches/ohana.20150429/src/dvomerge/src/LoadImages.c

    r29938 r38344  
    3434  }
    3535
    36   image = gfits_table_get_Image (&db->ftable, Nimage, &db->swapped);
     36  image = gfits_table_get_Image (&db->ftable, Nimage, &db->scaledValue, &db->nativeOrder);
    3737  if (!image) {
    3838    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/dvomerge/src/dvo_image_merge_dbs.c

    r37807 r38344  
    1616  short  *TgtCodes;
    1717 
    18   imagesSrc = gfits_table_get_Image (&src[0].ftable, &NimagesSrc, &src[0].swapped);
     18  imagesSrc = gfits_table_get_Image (&src[0].ftable, &NimagesSrc, &src[0].scaledValue, &src[0].nativeOrder);
    1919  if (!imagesSrc) {
    2020    fprintf (stderr, "ERROR: failed to read images from src\n");
     
    2222  }
    2323
    24   imagesTgt = gfits_table_get_Image (&tgt[0].ftable, &NimagesTgt, &tgt[0].swapped);
     24  imagesTgt = gfits_table_get_Image (&tgt[0].ftable, &NimagesTgt, &tgt[0].scaledValue, &tgt[0].nativeOrder);
    2525  if (!imagesTgt) {
    2626    fprintf (stderr, "ERROR: failed to read images from tgt\n");
     
    8383  }
    8484
    85   images = gfits_table_get_Image (&in[0].ftable, &Nimages, &in[0].swapped);
     85  images = gfits_table_get_Image (&in[0].ftable, &Nimages, &in[0].scaledValue, &in[0].nativeOrder);
    8686  if (!images) {
    8787    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/dvomerge/src/dvoconvert.c

    r33657 r38344  
    149149
    150150  // convert the raw image table to Image type (byteswap if needed)
    151   images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.swapped);
     151  images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.scaledValue, &inDB.nativeOrder);
    152152  if (!images) {
    153153    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/dvomerge/src/dvorepairFixImages.c

    r37807 r38344  
    280280  memset (&db.ftable.buffer[Nx*Nout], ' ', nbytes - Nx*Nout);
    281281
    282   db.swapped = TRUE; // internal representation
     282  db.nativeOrder = TRUE; // internal representation
     283  db.scaledValue = TRUE; // internal representation
    283284
    284285  gfits_modify (&db.header, "NIMAGES", OFF_T_FMT, 1,  Nout);
  • branches/eam_branches/ohana.20150429/src/dvomerge/src/dvoutils_load_image_index.c

    r37807 r38344  
    8787
    8888  off_t Nimage;
    89   Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     89  Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    9090  if (!image) {
    9191    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/dvomerge/src/dvoverify_utils.c

    r37807 r38344  
    484484  }
    485485
    486   images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.swapped);
     486  images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.scaledValue, &inDB.nativeOrder);
    487487  if (!images) {
    488488    fprintf (stderr, "ERROR: failed to read images from src\n");
  • branches/eam_branches/ohana.20150429/src/fakeastro/src/load_template_images.c

    r37807 r38344  
    2424
    2525  off_t Nimage;
    26   Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     26  Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    2727  if (!image) {
    2828    fprintf (stderr, "ERROR: no template images in %s (though db exists)\n", IMAGES_INPUT);
  • branches/eam_branches/ohana.20150429/src/gastro2/src/rfits.c

    r29001 r38344  
    1414  if (!gfits_fread_ftable (f, &table, "SMPFILE")) goto escape;
    1515
    16   stars = gfits_table_get_SMPData (&table, &Nstars, NULL);
     16  stars = gfits_table_get_SMPData (&table, &Nstars, NULL, NULL);
    1717  if (!stars) {
    1818    fprintf (stderr, "ERROR: failed to read stars\n");
  • branches/eam_branches/ohana.20150429/src/getstar/src/dvoImageExtract.c

    r29001 r38344  
    3131
    3232  // convert database table to internal structure
    33   images = gfits_table_get_Image (&db.ftable, &Nimages, &db.swapped);
     33  images = gfits_table_get_Image (&db.ftable, &Nimages, &db.scaledValue, &db.nativeOrder);
    3434  if (!images) {
    3535    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/getstar/src/dvoImageOverlaps.c

    r29001 r38344  
    3434
    3535  // convert database table to internal structure
    36   dbImages = gfits_table_get_Image (&db.ftable, &NdbImages, &db.swapped);
     36  dbImages = gfits_table_get_Image (&db.ftable, &NdbImages, &db.scaledValue, &db.nativeOrder);
    3737  if (!dbImages) {
    3838    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/getstar/src/dvoImagesAtCoords.c

    r36131 r38344  
    6060
    6161    // convert database table to internal structure
    62     dbImages = gfits_table_get_Image (&db.ftable, &NdbImages, &db.swapped);
     62    dbImages = gfits_table_get_Image (&db.ftable, &NdbImages, &db.scaledValue, &db.nativeOrder);
    6363    if (!dbImages) {
    6464      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/imregister/src/detsearch.c

    r29001 r38344  
    3535
    3636  if (!output.Modify && !output.Delete && !output.Altpath) gfits_db_close (&db);
    37   detrend = gfits_table_get_DetReg (&db.ftable, &Ndetrend, &db.swapped);
     37  detrend = gfits_table_get_DetReg (&db.ftable, &Ndetrend, &db.scaledValue, &db.nativeOrder);
    3838  if (!detrend) {
    3939    fprintf (stderr, "ERROR: failed to read detrend info\n");
  • branches/eam_branches/ohana.20150429/src/imregister/src/imphotsearch.c

    r29001 r38344  
    3232  if (!options.modify) gfits_db_close (&db);
    3333
    34   image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     34  image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    3535  if (!image) {
    3636    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/imregister/src/imregtable.c

    r29001 r38344  
    3333  gfits_read_ftable  (infile, &ftable, "IMAGE_DATABASE");
    3434
    35   image = gfits_table_get_RegImage (&ftable, &Nimage, NULL);
     35  image = gfits_table_get_RegImage (&ftable, &Nimage, NULL, NULL);
    3636  if (!image) {
    3737    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/imregister/src/imsearch.c

    r29001 r38344  
    2929  if (!output.modify && !output.delete) gfits_db_close (&db);
    3030
    31   image = gfits_table_get_RegImage (&db.ftable, &Nimage, &db.swapped);
     31  image = gfits_table_get_RegImage (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    3232  if (!image) {
    3333    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/imregister/src/imstatreg.c

    r29001 r38344  
    6666      exit (1);
    6767    }
    68     subset = gfits_table_get_RegImage (&temp_db.ftable, &Nsubset, &temp_db.swapped);
     68    subset = gfits_table_get_RegImage (&temp_db.ftable, &Nsubset, &temp_db.scaledValue, &temp_db.nativeOrder);
    6969    if (!subset) {
    7070      fprintf (stderr, "ERROR: failed to read images\n");
     
    9696         we will just drop the temp db data */
    9797    }
    98     image = gfits_table_get_RegImage (&image_db.ftable, &Nimage, &image_db.swapped);
     98    image = gfits_table_get_RegImage (&image_db.ftable, &Nimage, &image_db.scaledValue, &image_db.nativeOrder);
    9999    if (!image) {
    100100      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/imregister/src/photsearch.c

    r29001 r38344  
    4141  /* add test to EXTNAME? */
    4242  if (output.convert) {
    43     photpars_old = gfits_table_get_PhotParsOld (&db.ftable, &Nphotpars, &db.swapped);
     43    photpars_old = gfits_table_get_PhotParsOld (&db.ftable, &Nphotpars, &db.scaledValue, &db.nativeOrder);
    4444    if (!photpars_old) {
    4545      fprintf (stderr, "ERROR: failed to read photometry parameters\n");
     
    4848    photpars = PhotParsOld_to_PhotPars (photpars_old, Nphotpars);
    4949  } else {
    50     photpars = gfits_table_get_PhotPars (&db.ftable, &Nphotpars, &db.swapped);
     50    photpars = gfits_table_get_PhotPars (&db.ftable, &Nphotpars, &db.scaledValue, &db.nativeOrder);
    5151    if (!photpars) {
    5252      fprintf (stderr, "ERROR: failed to read photometry parameters\n");
  • branches/eam_branches/ohana.20150429/src/imregister/src/spsearch.c

    r29001 r38344  
    2929  if (!output.modify && !output.delete) gfits_db_close (&db);
    3030
    31   spectrum = gfits_table_get_Spectrum (&db.ftable, &Nspectrum, &db.swapped);
     31  spectrum = gfits_table_get_Spectrum (&db.ftable, &Nspectrum, &db.scaledValue, &db.nativeOrder);
    3232  if (!spectrum) {
    3333    fprintf (stderr, "ERROR: failed to read spectrum\n");
  • branches/eam_branches/ohana.20150429/src/libautocode/def/autocode.c

    r29537 r38344  
    2727/*** add test of EXTNAME and header-defined columns? ***/
    2828/* return internal structure representation */
    29 $STRUCT *gfits_table_get_$STRUCT (FTable *ftable, off_t *Ndata, char *swapped) {
     29/* scaledData & nativeBytes describe the current state of the ftable.buffer */
     30$STRUCT *gfits_table_get_$STRUCT (FTable *ftable, off_t *Ndata, char *scaledValue, char *nativeOrder) {
    3031
    3132  int Ncols;
     
    4041  *Ndata = ftable[0].header[0].Naxis[1];
    4142  data = ($STRUCT *) ftable[0].buffer;
    42   if ((swapped == NULL) || (*swapped == FALSE)) {
     43
     44  // if the pointer is not passed, we need to swap
     45  if (!nativeOrder || !*nativeOrder) {
    4346    if (!gfits_convert_$STRUCT (data, sizeof ($STRUCT), *Ndata)) {
    4447      return NULL;
    4548    }
     49    if (nativeOrder) *nativeOrder = TRUE;
     50  }
     51  // if the pointer is not passed, we need to scale
     52  if (!scaledValue || !*scaledValue) {
    4653    gfits_table_scale_data (ftable);
    47     if (swapped != NULL) *swapped = TRUE;
     54    if (scaledValue) *scaledValue = TRUE;
    4855  }
    4956  return (data);
  • branches/eam_branches/ohana.20150429/src/libautocode/def/autocode.h

    r27435 r38344  
    22/** STRUCT DEFINITION **/
    33
    4 $STRUCT *gfits_table_get_$STRUCT (FTable *table, off_t *Ndata, char *swapped);
     4$STRUCT *gfits_table_get_$STRUCT (FTable *table, off_t *Ndata, char *scaledValue, char *nativeOrder);
    55int      gfits_table_set_$STRUCT (FTable *ftable, $STRUCT *data, off_t Ndata);
    66int      gfits_table_mkheader_$STRUCT (Header *header);
  • branches/eam_branches/ohana.20150429/src/libdvo/Makefile

    r37992 r38344  
    1010MAN     =       $(HOME)/doc
    1111INC     =       $(HOME)/include
     12TEST    =       $(HOME)/test
     13TESTBIN =       $(HOME)/test
    1214ASRC    =       $(AUTO)/src
    1315AINC    =       $(AUTO)/include
     
    153155        rm -f $@
    154156        cp $< $@
     157        echo "done making autocode.h"
    155158
    156159$(AINC)/autocode.h: $(AINCS) $(ADEF)/autocode.h $(ADEF)/common.h
  • branches/eam_branches/ohana.20150429/src/libdvo/include/dvo.h

    r38331 r38344  
    230230  char   format;        /* what data format is used for disk file? */
    231231  char   virtual;       /* is table in ftable or vtable? */
    232   char   swapped;       /* is table in internal byte-order? */
     232  char   nativeOrder;   /* is table in internal byte-order? */
     233  char   scaledValue;   /* is table in internal byte-order? */
    233234} FITS_DB;
    234235
     
    966967DVOTableFormat FtableGetFormat (FTable *ftable);
    967968
    968 Average *FtableToAverage (FTable *ftable, off_t *Naverage, char *format, SecFilt **primary);
     969Average *FtableToAverage (FTable *ftable, off_t *Naverage, char *format, SecFilt **primary, char nativeBytes);
    969970Measure *FtableToMeasure (FTable *ftable, Average *average, off_t *Nmeasure, char *format);
    970971SecFilt *FtableToSecFilt (FTable *ftable, off_t *Nsecfilt, char *format);
     
    10171018int gfits_table_set_Image (FTable *ftable);
    10181019int gfits_table_mkheader_Image (Header *header);
    1019 Image *gfits_table_get_Image (FTable *ftable, off_t *Ndata, char *swapped);
     1020Image *gfits_table_get_Image (FTable *ftable, off_t *Ndata, char *scaledValue, char *nativeOrder);
    10201021
    10211022/* flatcorr APIs */
  • branches/eam_branches/ohana.20150429/src/libdvo/src/AstromOffsetMapIO.c

    r37807 r38344  
    3939    return (NULL);
    4040  }
    41   AstromOffsetMap_Disk_6x6 *map_disk = gfits_table_get_AstromOffsetMap_Disk_6x6 (&ftable, &Nmap, NULL);
     41  AstromOffsetMap_Disk_6x6 *map_disk = gfits_table_get_AstromOffsetMap_Disk_6x6 (&ftable, &Nmap, NULL, NULL);
    4242  if (!map_disk) {
    4343    fprintf (stderr, "ERROR: failed to read Astrom Offset Map\n");
  • branches/eam_branches/ohana.20150429/src/libdvo/src/LoadImages.c

    r37807 r38344  
    6565  }
    6666
    67   image = gfits_table_get_Image (&db.ftable, Nimage, &db.swapped);
     67  image = gfits_table_get_Image (&db.ftable, Nimage, &db.scaledValue, &db.nativeOrder);
    6868  if (!image) {
    6969    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/libdvo/src/LoadPhotcodesFITS.c

    r37035 r38344  
    4343# define CONVERT_FORMAT(NAME, FORMAT)                                   \
    4444  if (!strcmp (extname, NAME)) {                                        \
    45     PhotCode_##FORMAT *photcode_input = gfits_table_get_PhotCode_##FORMAT (&db.ftable, &Ncode, &db.swapped); \
     45    PhotCode_##FORMAT *photcode_input = gfits_table_get_PhotCode_##FORMAT (&db.ftable, &Ncode, &db.scaledValue, &db.nativeOrder); \
    4646    if (!photcode_input) {                                                      \
    4747      fprintf (stderr, "ERROR: failed to read photcodes in LoadPhotcodesFITS.c\n");             \
  • branches/eam_branches/ohana.20150429/src/libdvo/src/dvo_catalog_mef.c

    r38331 r38344  
    7777    }
    7878    /* old versions of DVO stored one of the average magnitudes in Average. we save this if needed */
    79     catalog[0].average = FtableToAverage (&ftable, &Naverage, &catalog[0].catformat, &primary);
     79    catalog[0].average = FtableToAverage (&ftable, &Naverage, &catalog[0].catformat, &primary, FALSE);
    8080    if (Naverage != catalog[0].Naves_disk) {
    8181      fprintf (stderr, "Warning: mismatch between Naverage in PHU and Table headers ("OFF_T_FMT" vs "OFF_T_FMT")\n",  Naverage,  catalog[0].Naves_disk);
     
    131131    }
    132132    /* no conversions currently defined */
    133     catalog[0].missing = gfits_table_get_Missing (&ftable, &catalog[0].Nmissing, NULL);
     133    catalog[0].missing = gfits_table_get_Missing (&ftable, &catalog[0].Nmissing, NULL, NULL);
    134134    if (!catalog[0].missing) {
    135135      fprintf (stderr, "ERROR: failed to read missing\n");
  • branches/eam_branches/ohana.20150429/src/libdvo/src/dvo_catalog_split.c

    r38331 r38344  
    311311  /* read Average table header */
    312312  if (!gfits_fread_header (catalog[0].f, &header)) {
    313     if (VERBOSE) fprintf (stderr, "can't read table average header");
     313    if (VERBOSE) fprintf (stderr, "can't read table average header\n");
    314314    return (FALSE);
    315315  }
    316316  if (catalog[0].catflags & LOAD_AVES) {
     317    Header rawheader;
     318    FTable rawtable;
     319    rawtable.header = &rawheader;
     320    FTable *outtable = &ftable;
     321    char nativeOrder = FALSE;
     322
    317323    /* read Average table data : format is irrelevant here */
    318324    if (!gfits_fread_ftable_data (catalog[0].f, &ftable, FALSE)) {
    319       if (VERBOSE) fprintf (stderr, "can't read table average data");
    320       return (FALSE);
    321     }
     325      if (VERBOSE) fprintf (stderr, "can't read table average data\n");
     326      return (FALSE);
     327    }
     328    if (gfits_extension_is_compressed_table (ftable.header)) {
     329      if (!gfits_uncompress_table (&ftable, &rawtable)) {
     330        if (VERBOSE) fprintf (stderr, "failed to uncompress table\n");
     331        return (FALSE);
     332      }
     333      gfits_free_table (&ftable);
     334      outtable = &rawtable;
     335      nativeOrder = TRUE;
     336    }
     337    // NOTE: fread_ftable returns an unswapped table; uncompress swaps the bytes into native order
     338
    322339    /* convert the saved version of the table to the internal version.  Old versions of DVO stored
    323340     * one of the average magnitudes in Average.  We save this in case it is needed below.  NOTE:
    324341     * primary is only used if we read in the secfilt table, otherwise it should be freed */
    325     catalog[0].average = FtableToAverage (&ftable, &Naverage, &catalog[0].catformat, &primary);
     342    catalog[0].average = FtableToAverage (outtable, &Naverage, &catalog[0].catformat, &primary, nativeOrder);
    326343    if (Naverage != catalog[0].Naves_disk) {
    327344      fprintf (stderr, "Warning: mismatch between Naverage in PHU and Table headers ("OFF_T_FMT" vs "OFF_T_FMT")\n",  Naverage,  catalog[0].Naves_disk);
     
    393410    }
    394411    /* no conversions currently defined : this just does the byte swap */
    395     catalog[0].missing = gfits_table_get_Missing (&ftable, &Nmissing, NULL);
     412    catalog[0].missing = gfits_table_get_Missing (&ftable, &Nmissing, NULL, NULL);
    396413    if (!catalog[0].missing) {
    397414      fprintf (stderr, "ERROR: failed to read missing\n");
     
    652669     * one of the average magnitudes in Average.  We save this in case it is needed below.  NOTE:
    653670     * primary is only used if we read in the secfilt table, otherwise it should be freed */
    654     catalog[0].average = FtableToAverage (&ftable, &Naverage, &catalog[0].catformat, &primary);
     671    catalog[0].average = FtableToAverage (&ftable, &Naverage, &catalog[0].catformat, &primary, FALSE);
    655672    if (Naverage != Nrows) {
    656673      // XXX this condition denotes the eof has been reached; not an error or a warning
     
    747764
    748765    /* no conversions currently defined : this just does the byte swap */
    749     catalog[0].missing = gfits_table_get_Missing (&ftable, &Nmissing, NULL);
     766    catalog[0].missing = gfits_table_get_Missing (&ftable, &Nmissing, NULL, NULL);
    750767    if (!catalog[0].missing) {
    751768      fprintf (stderr, "ERROR: failed to read missing\n");
  • branches/eam_branches/ohana.20150429/src/libdvo/src/dvo_convert.c

    r38219 r38344  
    5252/*** Average / FTable conversion functions ***/
    5353
    54 Average *FtableToAverage (FTable *ftable, off_t *Naverage, char *format, SecFilt **primary) {
     54Average *FtableToAverage (FTable *ftable, off_t *Naverage, char *format, SecFilt **primary, char nativeBytes) {
    5555
    5656  Average *average;
     
    9898  if (!strcmp (extname, NAME)) { \
    9999    Average_##TYPE *tmpAverage; \
    100     tmpAverage = gfits_table_get_Average_##TYPE (ftable, Naverage, NULL); \
     100      tmpAverage = gfits_table_get_Average_##TYPE (ftable, Naverage, NULL, &nativeBytes); \
    101101    if (!tmpAverage) { \
    102102      fprintf (stderr, "ERROR: failed to read averages\n"); \
     
    109109
    110110  if (!strcmp (extname, "DVO_AVERAGE")) {
    111     average = gfits_table_get_Average (ftable, Naverage, NULL);
     111    average = gfits_table_get_Average (ftable, Naverage, NULL, NULL);
    112112    if (!average) {
    113113      fprintf (stderr, "ERROR: failed to read averages\n");
     
    226226  if (!strcmp (extname, NAME)) {                                        \
    227227    Measure_##TYPE *tmpMeasure;                                         \
    228     tmpMeasure = gfits_table_get_Measure_##TYPE (ftable, Nmeasure, NULL); \
    229     if (!tmpMeasure) {                                                  \
    230       fprintf (stderr, "ERROR: failed to read measures\n");             \
    231       exit (2);                                                         \
    232     }                                                                   \
    233     myAssert (ABS_COORDS || average, "conversion to internal needs average table"); \
     228      tmpMeasure = gfits_table_get_Measure_##TYPE (ftable, Nmeasure, NULL, NULL); \
     229        if (!tmpMeasure) {                                              \
     230          fprintf (stderr, "ERROR: failed to read measures\n");         \
     231          exit (2);                                                     \
     232        }                                                               \
     233        myAssert (ABS_COORDS || average, "conversion to internal needs average table"); \
    234234    measure = Measure_##TYPE##_ToInternal (average, tmpMeasure, *Nmeasure); \
    235235    free (tmpMeasure);                                                  \
     
    238238
    239239  if (!strcmp (extname, "DVO_MEASURE")) {
    240     measure = gfits_table_get_Measure (ftable, Nmeasure, NULL);
     240    measure = gfits_table_get_Measure (ftable, Nmeasure, NULL, NULL);
    241241    if (!measure) {
    242242      fprintf (stderr, "ERROR: failed to read measures\n");
     
    339339  if (!strcmp (extname, NAME)) { \
    340340    SecFilt_##TYPE *tmpSecFilt; \
    341     tmpSecFilt = gfits_table_get_SecFilt_##TYPE (ftable, Nsecfilt, NULL); \
     341    tmpSecFilt = gfits_table_get_SecFilt_##TYPE (ftable, Nsecfilt, NULL, NULL); \
    342342    if (!tmpSecFilt) { \
    343343      fprintf (stderr, "ERROR: failed to read secfilts\n"); \
     
    350350
    351351  if (!strcmp (extname, "DVO_SECFILT")) {
    352     secfilt = gfits_table_get_SecFilt (ftable, Nsecfilt, NULL);
     352    secfilt = gfits_table_get_SecFilt (ftable, Nsecfilt, NULL, NULL);
    353353    if (!secfilt) {
    354354      fprintf (stderr, "ERROR: failed to read secfilts\n");
     
    433433  if (!strcmp (extname, "DVO_LENSING_PS1_V5") && (ftable[0].header[0].Naxis[0] == 128)) {
    434434    Lensing_PS1_V5_R0 *tmpLensing;                                             
    435     tmpLensing = gfits_table_get_Lensing_PS1_V5_R0 (ftable, Nlensing, NULL);
     435    tmpLensing = gfits_table_get_Lensing_PS1_V5_R0 (ftable, Nlensing, NULL, NULL);
    436436    if (!tmpLensing) {                                                 
    437437      fprintf (stderr, "ERROR: failed to read lensings\n");             
     
    445445  if (!strcmp (extname, "DVO_LENSING_PS1_V5") && (ftable[0].header[0].Naxis[0] == 136)) {
    446446    Lensing_PS1_V5_R1 *tmpLensing;                                             
    447     tmpLensing = gfits_table_get_Lensing_PS1_V5_R1 (ftable, Nlensing, NULL);
     447    tmpLensing = gfits_table_get_Lensing_PS1_V5_R1 (ftable, Nlensing, NULL, NULL);
    448448    if (!tmpLensing) {                                                 
    449449      fprintf (stderr, "ERROR: failed to read lensings\n");             
     
    457457  if (!strcmp (extname, "DVO_LENSING_PS1_V5") && (ftable[0].header[0].Naxis[0] == 144)) {
    458458    Lensing_PS1_V5_R2 *tmpLensing;                                             
    459     tmpLensing = gfits_table_get_Lensing_PS1_V5_R2 (ftable, Nlensing, NULL);
     459    tmpLensing = gfits_table_get_Lensing_PS1_V5_R2 (ftable, Nlensing, NULL, NULL);
    460460    if (!tmpLensing) {                                                 
    461461      fprintf (stderr, "ERROR: failed to read lensings\n");             
     
    477477  if (!strcmp (extname, NAME)) {                                        \
    478478    Lensing_##TYPE *tmpLensing;                                         \
    479     tmpLensing = gfits_table_get_Lensing_##TYPE (ftable, Nlensing, NULL); \
     479    tmpLensing = gfits_table_get_Lensing_##TYPE (ftable, Nlensing, NULL, NULL); \
    480480    if (!tmpLensing) {                                                  \
    481481      fprintf (stderr, "ERROR: failed to read lensings\n");             \
     
    488488
    489489  if (!strcmp (extname, "DVO_LENSING")) {
    490     lensing = gfits_table_get_Lensing (ftable, Nlensing, NULL);
     490    lensing = gfits_table_get_Lensing (ftable, Nlensing, NULL, NULL);
    491491    if (!lensing) {
    492492      fprintf (stderr, "ERROR: failed to read lensings\n");
     
    572572  if (!strcmp (extname, "DVO_LENSOBJ_PS1_V5") && (ftable[0].header[0].Naxis[0] == 136)) {
    573573    Lensobj_PS1_V5_R0 *tmpLensobj;                                             
    574     tmpLensobj = gfits_table_get_Lensobj_PS1_V5_R0 (ftable, Nlensobj, NULL);
     574    tmpLensobj = gfits_table_get_Lensobj_PS1_V5_R0 (ftable, Nlensobj, NULL, NULL);
    575575    if (!tmpLensobj) {                                                 
    576576      fprintf (stderr, "ERROR: failed to read lensobjs\n");             
     
    592592  if (!strcmp (extname, NAME)) {                                        \
    593593    Lensobj_##TYPE *tmpLensobj;                                         \
    594     tmpLensobj = gfits_table_get_Lensobj_##TYPE (ftable, Nlensobj, NULL); \
     594    tmpLensobj = gfits_table_get_Lensobj_##TYPE (ftable, Nlensobj, NULL, NULL); \
    595595    if (!tmpLensobj) {                                                  \
    596596      fprintf (stderr, "ERROR: failed to read lensobjs\n");             \
     
    603603
    604604  if (!strcmp (extname, "DVO_LENSOBJ")) {
    605     lensobj = gfits_table_get_Lensobj (ftable, Nlensobj, NULL);
     605    lensobj = gfits_table_get_Lensobj (ftable, Nlensobj, NULL, NULL);
    606606    if (!lensobj) {
    607607      fprintf (stderr, "ERROR: failed to read lensobjs\n");
     
    695695  if (!strcmp (extname, NAME)) {                                        \
    696696    StarPar_##TYPE *tmpStarPar;                                         \
    697     tmpStarPar = gfits_table_get_StarPar_##TYPE (ftable, Nstarpar, NULL); \
     697    tmpStarPar = gfits_table_get_StarPar_##TYPE (ftable, Nstarpar, NULL, NULL); \
    698698    if (!tmpStarPar) {                                                  \
    699699      fprintf (stderr, "ERROR: failed to read starpar\n");              \
     
    706706
    707707  if (!strcmp (extname, "DVO_STARPAR")) {
    708     starpar = gfits_table_get_StarPar (ftable, Nstarpar, NULL);
     708    starpar = gfits_table_get_StarPar (ftable, Nstarpar, NULL, NULL);
    709709    if (!starpar) {
    710710      fprintf (stderr, "ERROR: failed to read starpar\n");
     
    799799  if (!strcmp (extname, NAME)) {                                        \
    800800    GalShape_##TYPE *tmpGalShape;                                               \
    801     tmpGalShape = gfits_table_get_GalShape_##TYPE (ftable, Ngalshape, NULL); \
     801    tmpGalShape = gfits_table_get_GalShape_##TYPE (ftable, Ngalshape, NULL, NULL); \
    802802    if (!tmpGalShape) {                                                 \
    803803      fprintf (stderr, "ERROR: failed to read galshapes\n");            \
     
    810810
    811811  if (!strcmp (extname, "DVO_GALSHAPE")) {
    812     galshape = gfits_table_get_GalShape (ftable, Ngalshape, NULL);
     812    galshape = gfits_table_get_GalShape (ftable, Ngalshape, NULL, NULL);
    813813    if (!galshape) {
    814814      fprintf (stderr, "ERROR: failed to read galshapes\n");
     
    891891  if (*format == DVO_FORMAT_ELIXIR) {             // special case for ELIXIR
    892892    Image_Elixir *tmpimage;
    893     tmpimage = gfits_table_get_Image_Elixir (ftable, &Nimage, NULL);
     893    tmpimage = gfits_table_get_Image_Elixir (ftable, &Nimage, NULL, NULL);
    894894    if (!tmpimage) {
    895895      fprintf (stderr, "ERROR: failed to read images\n");
     
    917917    Image_##TYPE *tmpimage; \
    918918    *format = DVO_FORMAT_##FORMAT; \
    919     tmpimage = gfits_table_get_Image_##TYPE (ftable, &Nimage, NULL); \
     919    tmpimage = gfits_table_get_Image_##TYPE (ftable, &Nimage, NULL, NULL); \
    920920    if (!tmpimage) { \
    921921      fprintf (stderr, "ERROR: failed to read images\n"); \
  • branches/eam_branches/ohana.20150429/src/libdvo/src/dvo_image.c

    r37807 r38344  
    8989  // so when we later do a gfits_copy_ftable, we stomp on bad memory
    9090  FtableToImage (&db[0].ftable, &db[0].theader, &db[0].format);
    91   db[0].swapped = TRUE;  /* table has internal byte-order */
     91  db[0].nativeOrder = TRUE;  /* table has internal byte-order */
     92  db[0].scaledValue = TRUE;  /* table has internal byte-order */
    9293  return (TRUE);
    9394}
     
    100101  /* convert from internal to requested external format */
    101102  ImageToFtable (&db[0].ftable, &db[0].theader, db[0].format);
    102   db[0].swapped = FALSE;
     103  db[0].nativeOrder = FALSE;
     104  db[0].scaledValue = FALSE;
    103105
    104106  /* write data in appropriate mode */
     
    149151  /* theader is modified to match output format */
    150152  ImageToVtable (&db[0].vtable, &db[0].theader, db[0].format);
    151   db[0].swapped = FALSE;
     153  db[0].scaledValue = FALSE;
     154  db[0].nativeOrder = FALSE;
    152155
    153156  /* write data in appropriate mode */
     
    363366
    364367/* return internal structure representation */
    365 Image *gfits_table_get_Image (FTable *ftable, off_t *Ndata, char *swapped) {
     368Image *gfits_table_get_Image (FTable *ftable, off_t *Ndata, char *scaledValue, char *nativeOrder) {
    366369
    367370  int Ncols;
     
    377380  data = (Image *) ftable[0].buffer;
    378381
    379   if (!swapped) {
    380     myAbort ("invalid to call this without suppying 'swapped'");
    381   }
    382   if (*swapped == FALSE) {
    383     myAbort ("invalid for table to be swapped");
     382  if (!scaledValue) {
     383    myAbort ("invalid to call this without suppying 'scaledValue'");
     384  }
     385  if (*scaledValue == FALSE) {
     386    myAbort ("invalid for table NOT to be scaledValue");
     387  }
     388  if (!nativeOrder) {
     389    myAbort ("invalid to call this without suppying 'nativeOrder'");
     390  }
     391  if (*nativeOrder == FALSE) {
     392    myAbort ("invalid for table NOT to be nativeOrder");
    384393  }
    385394   
  • branches/eam_branches/ohana.20150429/src/libdvo/src/dvo_image_raw.c

    r37807 r38344  
    107107  db[0].theader.Naxis[1] = Nimage;
    108108  db[0].ftable.datasize = gfits_data_size (&db[0].theader);
    109   db[0].swapped = FALSE;  /* table does not have internal byte-order */
     109
     110  db[0].nativeOrder = FALSE;  /* table does not have internal byte-order */
     111  db[0].scaledValue = FALSE;  /* table does not have internal byte-order */
    110112  return (TRUE);
    111113}
  • branches/eam_branches/ohana.20150429/src/libdvo/src/dvo_util.c

    r37807 r38344  
    127127    }
    128128
    129     dvoConfig->images = gfits_table_get_Image (&dvoConfig->imageDB.ftable, &dvoConfig->nImages, &dvoConfig->imageDB.swapped);
     129    dvoConfig->images = gfits_table_get_Image (&dvoConfig->imageDB.ftable, &dvoConfig->nImages, &dvoConfig->imageDB.scaledValue, &dvoConfig->imageDB.nativeOrder);
    130130    if (!dvoConfig->images) {
    131131        fprintf (stderr, "problem loading images\n");
  • branches/eam_branches/ohana.20150429/src/libdvo/src/fits_db.c

    r35755 r38344  
    66  db[0].f             = NULL;
    77  db[0].filename      = NULL;
     8  db[0].dbstate       = 0;
     9  db[0].lockstate     = 0;
     10  db[0].mode          = 0;
     11  db[0].format        = 0;
     12  db[0].virtual       = 0;
     13  db[0].nativeOrder   = 0;
     14  db[0].scaledValue   = 0;
    815 
    9 # if (1)
    1016  gfits_init_header (&db->header);
    1117  gfits_init_matrix (&db->matrix);
    1218  gfits_init_header (&db->theader);
    13   gfits_init_table (&db->ftable);
     19  gfits_init_table  (&db->ftable);
    1420  db->ftable.header = &db->theader;
    1521  gfits_init_vtable (&db->vtable);
    16 # else 
    17   db[0].header.buffer = NULL;
    18   db[0].matrix.buffer = NULL;
    19   db[0].theader.buffer = NULL;
    20   db[0].ftable.buffer = NULL;
    21   db[0].ftable.header = &db[0].theader;
    22   db[0].vtable.header = NULL;
    23   db[0].vtable.buffer = NULL;
    24   db[0].vtable.row    = NULL;
    25 # endif
    2622  return (TRUE);
    2723}
     
    9793    return (FALSE);
    9894  }
    99   db[0].swapped = FALSE;  /* table does not have internal byte-order */
     95  db[0].nativeOrder = FALSE;  /* table does not have internal byte-order */
     96  db[0].scaledValue = FALSE;  /* table has not been scaled by BZERO,BSCALE */
    10097  return (TRUE);
    10198}
  • branches/eam_branches/ohana.20150429/src/libdvo/src/flatcorr_io.c

    r37807 r38344  
    4949    return (NULL);
    5050  }
    51   flatcorrTable->image = gfits_table_get_FlatCorrectionImage (&ftable, &flatcorrTable->Nimage, NULL);
     51  flatcorrTable->image = gfits_table_get_FlatCorrectionImage (&ftable, &flatcorrTable->Nimage, NULL, NULL);
    5252  if (!flatcorrTable->image) {
    5353    fprintf (stderr, "ERROR: failed to read Flat Correction Images\n");
     
    6464    return (NULL);
    6565  }
    66   flatcorrTable->corr = gfits_table_get_FlatCorrection (&ftable, &flatcorrTable->Ncorr, NULL);
     66  flatcorrTable->corr = gfits_table_get_FlatCorrection (&ftable, &flatcorrTable->Ncorr, NULL, NULL);
    6767  if (!flatcorrTable->corr) {
    6868    fprintf (stderr, "ERROR: failed to read Flat Corrections\n");
  • branches/eam_branches/ohana.20150429/src/libdvo/src/skyregion_io.c

    r36833 r38344  
    4040  ALLOCATE (skytable, SkyTable, 1);
    4141  memset (skytable->hosts, 0, 80);
    42   skytable[0].regions = gfits_table_get_SkyRegion (&ftable, &skytable[0].Nregions, NULL);
     42  skytable[0].regions = gfits_table_get_SkyRegion (&ftable, &skytable[0].Nregions, NULL, NULL);
    4343  if (!skytable[0].regions) {
    4444    fprintf (stderr, "ERROR: failed to read sky regions\n");
  • branches/eam_branches/ohana.20150429/src/markstar/src/find_images.c

    r29001 r38344  
    2525  }
    2626
    27   timage = gfits_table_get_Image (&db[0].ftable, &Ntimage, &db[0].swapped);
     27  timage = gfits_table_get_Image (&db[0].ftable, &Ntimage, &db[0].scaledValue, &db[0].nativeOrder);
    2828  if (!timage) {
    2929    fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/mosastro/src/rfits.c

    r29001 r38344  
    3131
    3232  off_t Nstars;
    33   stars = gfits_table_get_SMPData (&table, &Nstars, NULL);
     33  stars = gfits_table_get_SMPData (&table, &Nstars, NULL, NULL);
    3434  if (!stars) {
    3535    fprintf (stderr, "ERROR: failed to read stars\n");
  • branches/eam_branches/ohana.20150429/src/opihi/dvo/cmpReadFile.c

    r29001 r38344  
    1919  if (!gfits_fread_ftable (f, &table, "SMPFILE")) goto escape;
    2020
    21   smpdata = gfits_table_get_SMPData (&table, &Nstars, NULL);
     21  smpdata = gfits_table_get_SMPData (&table, &Nstars, NULL, NULL);
    2222  if (!smpdata) {
    2323    fprintf (stderr, "ERROR: failed to read stars\n");
  • branches/eam_branches/ohana.20150429/src/photdbc/src/copy_images.c

    r37807 r38344  
    4646  dvo_image_create (&out, ZERO_POINT);
    4747   
    48   image = gfits_table_get_Image (&in.ftable, &Nimage, &in.swapped);
     48  image = gfits_table_get_Image (&in.ftable, &Nimage, &in.scaledValue, &in.nativeOrder);
    4949  if (!image) {
    5050      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/photdbc/src/find_images.c

    r37807 r38344  
    2424  tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0;
    2525
    26   timage = gfits_table_get_Image (&db[0].ftable, &Ntimage, &db[0].swapped);
     26  timage = gfits_table_get_Image (&db[0].ftable, &Ntimage, &db[0].scaledValue, &db[0].nativeOrder);
    2727  if (!timage) {
    2828      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/photdbc/src/flag_measures.c

    r29001 r38344  
    1515  if (VERBOSE) fprintf (stderr, "flagging bad measurements\n");
    1616
    17   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     17  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1818  if (!image) {
    1919      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/relastro/src/ImageTable.c

    r36630 r38344  
    2727  // convert database table to internal structure (binary to Image)
    2828  // 'image' points to the same memory as db->ftable->buffer
    29   Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     29  Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    3030  if (!image) {
    3131    Shutdown ("ERROR: failed to read images");
  • branches/eam_branches/ohana.20150429/src/relastro/src/assign_images.c

    r37807 r38344  
    1111  // convert database table to internal structure (binary to Image)
    1212  // 'image' points to the same memory as db->ftable->buffer
    13   Image *image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     13  Image *image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1414  if (!image) {
    1515      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/relastro/src/load_images.c

    r37807 r38344  
    1616
    1717  // convert database table to internal structure
    18   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     18  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1919  if (!image) {
    2020      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/relphot/src/ImageTable.c

    r37807 r38344  
    2727  // convert database table to internal structure (binary to Image)
    2828  // 'image' points to the same memory as db->ftable->buffer
    29   Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     29  Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    3030  if (!image) {
    3131    Shutdown ("ERROR: failed to read images");
  • branches/eam_branches/ohana.20150429/src/relphot/src/assign_images.c

    r37807 r38344  
    1111  // convert database table to internal structure (binary to Image)
    1212  // 'image' points to the same memory as db->ftable->buffer
    13   Image *image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     13  Image *image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1414  if (!image) {
    1515      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/relphot/src/load_images.c

    r37807 r38344  
    2121  // convert database table to internal structure (binary to Image)
    2222  // 'image' points to the same memory as db->ftable->buffer
    23   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     23  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    2424  if (!image) {
    2525      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/relphot/src/relphot_images.c

    r37037 r38344  
    185185      // convert database table to internal structure (binary to Image)
    186186      // 'image' points to the same memory as db->ftable->buffer
    187       image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     187      image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    188188      if (!image) {
    189189        fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/find_image_sgroups.c

    r37807 r38344  
    1212
    1313  imlink = *Imlink;
    14   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     14  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1515  if (!image) {
    1616      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/find_image_tgroups.c

    r31160 r38344  
    1111  ImageLink *imlink;
    1212
    13   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     13  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1414  if (!image) {
    1515      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/load_images.c

    r33654 r38344  
    2121
    2222  /* use a vtable to keep the images to be calibrated */
    23   image = gfits_table_get_Image (&db[0].ftable, Nimage, &db[0].swapped);
     23  image = gfits_table_get_Image (&db[0].ftable, Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    2424  if (!image) {
    2525      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/load_images_fiximids.c

    r37043 r38344  
    2020
    2121  /* use a vtable to keep the images to be calibrated */
    22   image = gfits_table_get_Image (&db[0].ftable, Nimage_load, &db[0].swapped);
     22  image = gfits_table_get_Image (&db[0].ftable, Nimage_load, &db[0].scaledValue, &db[0].nativeOrder);
    2323  if (!image) {
    2424      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/load_images_fixstkids.c

    r37043 r38344  
    1919
    2020  /* use a vtable to keep the images to be calibrated */
    21   image = gfits_table_get_Image (&db[0].ftable, Nimage_load, &db[0].swapped);
     21  image = gfits_table_get_Image (&db[0].ftable, Nimage_load, &db[0].scaledValue, &db[0].nativeOrder);
    2222  if (!image) {
    2323      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/load_images_setphot.c

    r33654 r38344  
    1111
    1212  /* use a vtable to keep the images to be calibrated */
    13   image = gfits_table_get_Image (&db[0].ftable, Nimage, &db[0].swapped);
     13  image = gfits_table_get_Image (&db[0].ftable, Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1414  if (!image) {
    1515      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/load_images_setposangle.c

    r34749 r38344  
    1919
    2020  /* use a vtable to keep the images to be calibrated */
    21   image = gfits_table_get_Image (&db[0].ftable, Nimage, &db[0].swapped);
     21  image = gfits_table_get_Image (&db[0].ftable, Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    2222  if (!image) {
    2323      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/subset_images.c

    r31160 r38344  
    88
    99  // convert from the binary I/O format to the internal structure (Image)
    10   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     10  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1111  if (!image) {
    1212      fprintf (stderr, "ERROR: failed to read images\n");
  • branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_uniphot.c

    r37807 r38344  
    1414  Coords coords;
    1515
    16   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     16  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1717  if (!image) {
    1818      fprintf (stderr, "ERROR: failed to read images\n");
Note: See TracChangeset for help on using the changeset viewer.