IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 31, 2015, 8:36:04 AM (11 years ago)
Author:
eugene
Message:

fix up compressed fits table I/O; add lrand, mrand, drand functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/opihi/lib.shell/VectorIO.c

    r38340 r38341  
    7171}
    7272 
     73# define VERBOSE 0
     74int dump_raw_table (FTable *table, char *message) {
     75# if (VERBOSE)
     76  int i;
     77  fprintf (stderr, "%s data: ", message);
     78  for (i = 0; i < table->header->Naxis[0]*table->header->Naxis[1]; i++) {
     79    fprintf (stderr, "0x%02hhx ", table->buffer[i]);
     80  }
     81  fprintf (stderr, "\n");
     82# endif
     83  return TRUE;
     84}
     85
     86int dump_cmp_table (FTable *table, char *message) {
     87# if (VERBOSE)
     88  int i;
     89  fprintf (stderr, "%s pntr: ", message);
     90  for (i = 0; i < table->header->Naxis[0]*table->header->Naxis[1]; i++) {
     91    fprintf (stderr, "0x%02hhx ", table->buffer[i]);
     92  }
     93  fprintf (stderr, "\n");
     94
     95  fprintf (stderr, "%s data: ", message);
     96  for (i = 0; i < table->header->pcount; i++) {
     97    fprintf (stderr, "0x%02hhx ", table->buffer[table->heap_start + i]);
     98  }
     99  fprintf (stderr, "\n");
     100# endif
     101  return TRUE;
     102}
     103
    73104// write a set of vectors to a FITS file (vectors names become fits column names)
    74105int WriteVectorTableFITS (char *filename, char *extname, Vector **vec, int Nvec, int append, char *compress, char *format) {
     
    106137  if (compress) {
    107138    cmptable.header = &cmpheader;
     139
     140    dump_raw_table (&rawtable, "wd raw");
    108141    if (!gfits_compress_table (&rawtable, &cmptable, 10, compress)) goto escape;
     142    dump_cmp_table (&cmptable, "wd cmp");
     143
    109144    outtable = &cmptable;
    110145    outheader = &cmpheader;
Note: See TracChangeset for help on using the changeset viewer.