; Input the name of a Radarsat image file (.D) from Gatineau. ; Return the number of bytes (pixels) per record of data. ; The .D file has a header of 16252 bytes. ; The number of bytes per record is a 4 digit number at bytes 189-192. ; (index first bytes as byte 1) ; This number is extracted and returned. ; Then you can figure out the number of data records: ; ((file size in bytes) - 16252) / (bytes per record) ; Sample usage: ; IDL> f='NSS.R1.CA.D97034.T113006.P46N084.P40N076.A.D' ; IDL> print, gatineau1(f) ; 5752 pro canItOpen forward_function gatineau1 ; Here is the name of a file that can not be opened f = 'NSS.R1.GT.D00114.T214126.P59N065.P53N055.A.D' ; Number of data records = ((File Size in bytes) - 16252) / (bytes per record) print, 'File: ', f c = gatineau1 (f) print, 'Returned: ', c end ; ******************************************** function gatineau1, data_file_name a = bytarr(192) openr, input, data_file_name, /get_lun readu, input, a ; print out the 192 bytes just so we can see them print, 'a: ' print, a free_lun, input b = fix(string(a(188:191))) return, b end