Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NCL produces errors when reading ICESat-2 HDF5 files #27

Open
marylhaley opened this issue Dec 12, 2018 · 0 comments
Open

NCL produces errors when reading ICESat-2 HDF5 files #27

marylhaley opened this issue Dec 12, 2018 · 0 comments

Comments

@marylhaley
Copy link
Contributor

Amy Steikder of NSIDC came across some ICESat-2 HDF5 files that ncl_filedump produces errors on. These files are not yet public, but I have them and will make them available.

Here's a sample script to read each of the files and print some information. The error message is included in the comments.

  h5_files = (/"ATL03_20181018033532_02980106_201_01.h5",\
               "ATL04_20181018030401_02980101_201_01.h5",\
               "ATL09_20181018012943_02970101_201_01.h5"/)
  nh5 = dimsizes(h5_files)

  numeric_types = (/"integer","float","double"/)

;
;  Loop through each ATL file and print some information about the 
;  variables. Using NCL V6.5.0, this script produces the following
;  error for the ATL09 file:
;
;     Snow Ice Flag (1) : min=0   max=3
;       var name : /profile_2/high_rate/solar_azimuth
;       var type : float
;       var atts : DIMENSION_LIST,contentType,coordinates,description,long_name,source,units
;     solar azimuth (degrees_east) : min=64.6875   max=295.HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
;  #000: H5Dio.c line 159 in H5Dread(): selection+offset not within extent
;      major: Dataspace
;      minor: Out of range
;
;  Error in file: NclNewHDF5.c, line: 4586
;  HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
;  #000: H5Dio.c line 159 in H5Dread(): selection+offset not within extent
;      major: Dataspace
;      minor: Out of range
;
  do nh=0,nh5-1
    print("======================================================================")
    print("File      : " + h5_files(nh))
    a = addfile(h5_files(nh),"r")
    vnames := getfilevarnames(a)
    vtypes := getfilevartypes(a,vnames)
    nvars = dimsizes(vnames)
    do nv=0,nvars-1
      vatts := getfilevaratts(a,vnames(nv))
      print("  var name : " + vnames(nv))
      print("  var type : " + vtypes(nv))
      print("  var atts : " + str_join(vatts,","))
      if(any(vtypes(nv).eq.numeric_types))
        printMinMax(a->$vnames(nv)$,0)
      end if
    end do
  end do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants