source: trunk/SRC/ToBeReviewed/LECTURE/GRIB/scan_grib_nbits.pro @ 262

Last change on this file since 262 was 262, checked in by pinsard, 17 years ago

corrections of some headers and parameters and keywords case. change of pro2href to replace proidl

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1;+
2; @file_comments
3;
4;
5; @categories
6;
7;
8; @param NUM
9;
10;
11; @param RECSTART
12;
13;
14; @returns
15;
16;
17; @restrictions
18;
19;
20; @examples
21;
22;
23; @history
24;
25;
26; @version
27; $Id$
28;-
29;
30FUNCTION scan_grib_nbits, num, recstart
31;
32  compile_opt idl2, strictarrsubs
33;
34
35;
36  nrec =  n_elements(recstart)
37  nbits = bytarr(nrec)
38;
39  FOR i = 0L, nrec-1 DO BEGIN
40    offset = recstart[i]+8
41    a = assoc(num, bytarr(1, /nozero), offset-1)
42    sizepds = bit2int([binary(a[1]), binary(a[2]), binary(a[3])])
43    flag = binary(a[8])
44    gdsnotomitted = flag[0]
45    bmsnotomitted = flag[1]
46    ddd =  bit2int([binary(a[27]), binary(a[28])], /checkneg)
47;
48    offset = offset+sizepds
49;
50    IF gdsnotomitted THEN BEGIN
51      a = assoc(num, bytarr(1, /nozero), offset-1)
52      sizedds = bit2int([binary(a[1]), binary(a[2]), binary(a[3])])
53      offset = offset+sizedds
54    ENDIF
55;
56    IF bmsnotomitted THEN BEGIN
57      a = assoc(num, bytarr(1, /nozero), offset-1)
58      sizebms = bit2int([binary(a[1]), binary(a[2]), binary(a[3])])
59      offset = offset+sizebms
60    ENDIF
61
62    a = assoc(num, bytarr(1, /nozero), offset-1)
63    nbits[i] = a[11]
64
65  ENDFOR
66;
67  RETURN, nbits
68END
Note: See TracBrowser for help on using the repository browser.