Commit 59484541 authored by Ian Boyd's avatar Ian Boyd

Replace idlcr8ascii.pro

parent 937dfbae
;Main Program Version: idlcr8ascii.pro v4.0b22, 20190806
;Main Program Version: idlcr8ascii.pro v4.0b23, 20190821
; Written by Ian Boyd for the AVDC - iboyd@astro.umass.edu
;
;Sub-versions:
......@@ -81,7 +81,8 @@
; names; standard netCDF attribute names; empty attribute values that do not include a
; null termination character (which causes an error in the H5A_Read routine). New
; sub-routines include is_a_number_ascii, alpha_numeric_underscore, nc_dimension_chk,
; file_format_a.
; file_format_a.
; v4.0b23 20190821 - Fixed bugs associated with H5 TAG_NAMES checks introduced in v4.0b22.
PRO idlcr8ascii_common
;Procedure to define the data COMMON block WIDGET_WIN_A, containing common variables
......@@ -201,7 +202,7 @@ COMMON WIDGET_WIN_A
;procedure which provides an introduction message before starting the program.
nhdr=46 & errtxt=STRARR(nhdr)
vertxt=['idlcr8ascii-v4.0_Readme.pdf','v4.0b22 August 2019']
vertxt=['idlcr8ascii-v4.0_Readme.pdf','v4.0b23 August 2019']
errtxt[1]='Welcome to IDLcr8ASCII. This program reads GEOMS compliant HDF4, HDF5 and netCDF files and'
errtxt[2]='saves contents to either session memory, an output window (summary only) or to ASCII or formatted'
errtxt[3]='files (also refer to '+vertxt[0]+').'
......@@ -1087,6 +1088,7 @@ PRO read_hdf_sds, ifile, ga, sds, catinfo
; names; standard netCDF attribute names; empty attribute values that do not include a
; null termination character (which causes an error in the H5A_Read routine)
; - Version 4.0b22
; 20190821 Fixed bugs associated with H5 TAG_NAMES checks introduced in v4.0b22 - Version 4.0b23
;
; Inputs: ifile - a string containing the name of the input file to be read in.
; catinfo - a string array identifying the type of input file ('H4','H5','NC')
......@@ -1506,9 +1508,9 @@ ENDIF ELSE IF catinfo[0,0] EQ 'H5' THEN BEGIN ;HDF5 or netCDF4 format file
ga_name=H5A_GET_NAME(ga_id) & ga_name=STRTRIM(ga_name,2)
;test for valid attribute value - can be invalid if it is netCDF4 and equal to ''
gni=WHERE(TAG_NAMES(h5p) EQ ga_name)
gni=WHERE(TAG_NAMES(h5p) EQ STRUPCASE(ga_name))
attest=h5p.(gni[0])
IF attest._data EQ '<read error>' THEN ga_data='' $
IF STRTRIM(attest._data[0],2) EQ '<read error>' THEN ga_data='' $
ELSE BEGIN
ga_data=H5A_READ(ga_id) & ga_data=STRTRIM(ga_data,2)
ENDELSE
......@@ -1565,11 +1567,11 @@ ENDIF ELSE IF catinfo[0,0] EQ 'H5' THEN BEGIN ;HDF5 or netCDF4 format file
nc4i=WHERE(STRLOWCASE(da_name) EQ nc4_ignore,nc4icnt)
IF nc4icnt EQ 0 THEN BEGIN
;test for valid attribute value - can be invalid if it is netCDF4 and equal to ''
gni=WHERE(TAG_NAMES(h5p) EQ h5p_name) ;Tag index from h5_parse read
gni=WHERE(TAG_NAMES(h5p) EQ STRUPCASE(h5p_name)) ;Tag index from h5_parse read
attest=h5p.(gni[0])
gni=WHERE(TAG_NAMES(attest) EQ da_name)
gni=WHERE(TAG_NAMES(attest) EQ STRUPCASE(da_name))
attestx=attest.(gni[0])
IF STRTRIM(attestx._data,2) EQ '<read error>' THEN va_value='' $
IF STRTRIM(attestx._data[0],2) EQ '<read error>' THEN va_value='' $
ELSE va_value=H5A_READ(da_id)
IF SIZE(va_value,/TYPE) EQ 7 THEN va_type='STRING' ELSE va_type='NON_STRING'
schk=WHERE(STRUPCASE(da_name) EQ slabel,schkcnt)
......@@ -1670,11 +1672,11 @@ ENDIF ELSE IF catinfo[0,0] EQ 'H5' THEN BEGIN ;HDF5 or netCDF4 format file
nc4i=WHERE(STRLOWCASE(da_name) EQ nc4_ignore,nc4icnt)
IF nc4icnt EQ 0 THEN BEGIN
;test for valid attribute value - can be invalid if it is netCDF4 and equal to ''
gni=WHERE(TAG_NAMES(h5p) EQ h5p_name) ;Tag index from h5_parse read
gni=WHERE(TAG_NAMES(h5p) EQ STRUPCASE(h5p_name)) ;Tag index from h5_parse read
attest=h5p.(gni[0])
gni=WHERE(TAG_NAMES(attest) EQ da_name)
gni=WHERE(TAG_NAMES(attest) EQ STRUPCASE(da_name))
attestx=attest.(gni[0])
IF STRTRIM(attestx._data,2) EQ '<read error>' THEN va_value='' $
IF STRTRIM(attestx._data[0],2) EQ '<read error>' THEN va_value='' $
ELSE va_value=H5A_READ(da_id)
IF SIZE(va_value,/TYPE) EQ 7 THEN va_type='STRING' ELSE va_type='NON_STRING'
......@@ -2228,7 +2230,7 @@ PRO idlcr8ascii, ifile, ga, sds, reterr, $
;
;Program documentation, idlcr8ascii-v4.0_Readme.pdf, available on http://avdc.gsfc.nasa.gov.
;
;Program sub-version 4.0b22 (20190608)
;Program sub-version 4.0b23 (20190621)
; ----------
;Written by Ian Boyd for the AVDC - iboyd@astro.umass.edu
;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment