- Timestamp:
- Jun 7, 2015, 11:42:53 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/matrix/F_matrix.c
r38329 r38425 1 1 # include <ohana.h> 2 2 # include <gfitsio.h> 3 4 off_t gfits_data_size (Header *header) {5 6 int i;7 off_t Nrec, size;8 9 if (header[0].Naxes == 0) return (0);10 11 size = abs(header[0].bitpix / 8);12 13 for (i = 0; i < header[0].Naxes; i++)14 size *= header[0].Naxis[i];15 16 // XXX do I multiply this times gcount?17 size += header[0].pcount;18 19 /* round up to next complete block */20 if (size % FT_RECORD_SIZE) {21 Nrec = 1 + (int) (size / FT_RECORD_SIZE);22 size = FT_RECORD_SIZE * Nrec;23 }24 25 return (size);26 }27 3 28 4 off_t gfits_heap_start (Header *header) { … … 43 19 off_t gfits_data_min_size (Header *header) { 44 20 45 int i;46 off_t size;21 off_t size = gfits_heap_start (header); 22 size += header[0].pcount; 47 23 48 if (header[0].Naxes == 0) return (0); 49 50 size = abs(header[0].bitpix / 8); 51 52 for (i = 0; i < header[0].Naxes; i++) 53 size *= header[0].Naxis[i]; 54 55 // XXX do I multiply this times gcount? 56 size += header[0].pcount; 24 // XXX what do I do with gcount? 57 25 58 26 return (size); … … 61 29 off_t gfits_data_pad_size (off_t rawsize) { 62 30 63 off_t Nrec, size; 64 65 size = rawsize; 31 off_t size = rawsize; 66 32 67 33 /* round up to next complete block */ 68 34 if (rawsize % FT_RECORD_SIZE) { 69 Nrec = 1 + (int) (rawsize / FT_RECORD_SIZE);35 off_t Nrec = 1 + (int) (rawsize / FT_RECORD_SIZE); 70 36 size = FT_RECORD_SIZE * Nrec; 71 37 } … … 73 39 return (size); 74 40 } 41 42 off_t gfits_data_size (Header *header) { 43 off_t rawsize = gfits_data_min_size(header); 44 off_t size = gfits_data_pad_size (rawsize); 45 46 return (size); 47 } 48
Note:
See TracChangeset
for help on using the changeset viewer.
