IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 5, 2010, 10:04:42 PM (16 years ago)
Author:
eugene
Message:

handle errors in dvo I/O functions; better support for DIS images; merge in high-speed mods from Niall; systematic errors in astrometry (somewhat hackish); add fits I/O option to succeed reading a short file (padding as needed); various kapa improvements (frames consistent in X, PS, PNG; fix tick label signif digits; add function for image overlays; better thick box lines; PNG of the image); bDrawBuffer mods to drop static buffer and refer to passed through buffer; ResizeByImage; DefineSectionByImage; buutos to do png & jpeg; add program roc for raid over cluster; support for mosaic photcodes in dvo image plot; densify; section name [-image x y] : width based on current image; resize -by-image; threaded addstar -resort; threaded dvomerge; dvorepair; dvoverify; dvomerge continue; dvomerge from list (of regions)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/table/F_read_T.c

    r28241 r29938  
    3636    gfits_scan (header, "EXTNAME", "%s", 1, tname);
    3737    if (!strcmp (tname, extname)) {
    38       if (gfits_fread_ftable_data (f, table)) return (TRUE);
     38      if (gfits_fread_ftable_data (f, table, FALSE)) return (TRUE);
    3939      gfits_free_header (header);
    4040      return (FALSE);
     
    5050
    5151/*********************** fits read ftable data ***********************************/
    52 int gfits_fread_ftable_data (FILE *f, FTable *table) {
     52int gfits_fread_ftable_data (FILE *f, FTable *table, int padIfShort) {
    5353
    5454  off_t Nbytes, Nread;
     
    6565    if (Nread < gfits_data_min_size (table[0].header)) {
    6666      fprintf (stderr, "error: fits read error in %s, read "OFF_T_FMT", need "OFF_T_FMT"\n", __func__,  Nread,  gfits_data_min_size (table[0].header));
    67       gfits_free_table  (table);
    68       return (FALSE);
     67      if (padIfShort) {
     68        memset (&table[0].buffer[Nread], 0, Nbytes - Nread);
     69        fprintf (stderr, "warning: file missing data, padding with zeros: USE AT YOUR OWN RISK!\n");
     70        table[0].validsize = Nread;
     71        table[0].datasize = Nbytes;
     72        return (TRUE);
     73      } else {
     74        gfits_free_table  (table);
     75        return (FALSE);
     76      }
    6977    }
    7078    fprintf (stderr, "warning: file missing pad\n");
    7179  }
     80  table[0].validsize = Nread;
    7281  table[0].datasize = Nbytes;
    7382  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.