FUNCTION read_grib_is, num, offset ; compile_opt idl2, strictarrsubs ; infofile = fstat(num) a = assoc(num, bytarr(4, /nozero), offset) typefile = string(a[0]) IF typefile NE 'GRIB' THEN stop ; a = assoc(num, bytarr(1, /nozero), offset+4) sizerecord = bit2int([binary(a[0]), binary(a[1]), binary(a[2])]) ; a = assoc(num, bytarr(1, /nozero), offset+7) gribed = a[0] IF gribed NE 1 THEN stop ; RETURN, {typefile:typefile, sizerecord:sizerecord, gribed:gribed[0]} END