Commit c5d0760b authored by Ian Boyd's avatar Ian Boyd
Browse files

Replace idlcr8ascii.pro

parent 516ab96f
;Main Program Version: idlcr8ascii.pro v4.0b19, 20180218
;Main Program Version: idlcr8ascii.pro v4.0b20, 20181116
; Written by Ian Boyd for the AVDC - iboyd@astro.umass.edu
;
;Sub-versions:
......@@ -67,8 +67,12 @@
; than the number of datasets in the file.
; v4.0b19 20180218 - Fix bug that caused multi-dimensional array ordering to not be correctly identified
; if the datasets have the same VAR_SIZE i.e. rev_vd_vs stays as 2 through all the
; checks. Now rev_vd_vs changes to 1 (VAR_SIZE and VAR_DEPEND ordering is reversed) if
; rev_vd_vs=2 after all the checks.
; checks. Now rev_vd_vs changes to 1 (VAR_SIZE, VAR_DEPEND and dataset ordering is
; reversed) if rev_vd_vs=2 after all the checks.
; v4.0b20 20181116 - Fix bug that caused multi-dimensional array ordering to not be correctly written if
; not consistent through the file i.e. rev_vd_vs eq 3. Now rev_vd_vs changes to 1
; (VAR_SIZE, VAR_DEPEND and dataset ordering is reversed), but information message
; advising of the issue is still reported.
PRO idlcr8ascii_common
;Procedure to define the data COMMON block WIDGET_WIN_A, containing common variables
......@@ -188,7 +192,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.0b18 December 2016']
vertxt=['idlcr8ascii-v4.0_Readme.pdf','v4.0b20 November 2018']
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]+').'
......@@ -879,6 +883,10 @@ PRO read_hdf_sds, ifile, ga, sds, catinfo
; 20180218 Fix bug that caused multi-dimensional array ordering to not be correctly identified
; if the datasets have the same VAR_SIZE. Now rev_vd_vs changes to 1 (VAR_SIZE and
; VAR_DEPEND ordering is reversed) if rev_vd_vs=2 after all the checks - Version 4.0b19
; 20181116 Fix bug that caused multi-dimensional array ordering to not be correctly written if
; not consistent through the file i.e. rev_vd_vs eq 3. Now rev_vd_vs changes to 1
; (VAR_SIZE, VAR_DEPEND and dataset ordering is reversed), but information message
; advising of the issue is still reported - Version 4.0b20
;
; 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')
......@@ -924,7 +932,7 @@ ncsa_cal=['scale_factor','scale_factor_err','add_offset','add_offset_err','calib
;Initialize scalar to indicate whether VAR_DEPEND and VAR_SIZE values need to be reversed
rev_vd_vs=2 ;1 = reverse attribute values; 0 = no reverse (and will generate message);
;2 = no action required; 3 = rev_vd_vs changed between 0 and 1 during checking, therefore error
;Note if rev_vd_vs is still 2 after all the checks then it will be changed to 1 so that dimensions
;Note if rev_vd_vs is 2 or 3 after all the checks then it will be changed to 1 so that dimensions
;are swapped by default
;List of Standard GEOMS Variable Attributes
......@@ -1123,8 +1131,9 @@ IF catinfo[0,0] EQ 'H4' THEN BEGIN
IF max_atts EQ 0L THEN max_atts=3 ;Use information from HDF_SD_GETINFO call only
IF rev_vd_vs EQ 2 THEN rev_vd_vs=1 ;change default so that VAR_DEPEND and VAR_SIZE are reversed
;if not o/w changed in TEST_DIM_ORDER
rev_vd_vsh=rev_vd_vs ;keep original value in hold variable (required if rev_vd_vs eq 3)
IF (rev_vd_vs EQ 2) OR (rev_vd_vs EQ 3) THEN rev_vd_vs=1 ;change default so that VAR_DEPEND and VAR_SIZE
;are reversed if not o/w changed in TEST_DIM_ORDER
;Dimension the structure to the number of datasets x number of attributes
sds=REPLICATE(sds_set, n_sds_hold, max_atts)
......@@ -1400,8 +1409,9 @@ ENDIF ELSE IF catinfo[0,0] EQ 'H5' THEN BEGIN ;HDF5 format file
STOP_WITH_ERROR_A,o3[3]+proname,'No Datasets'+errtxt[0],lu & RETURN
ENDIF
IF rev_vd_vs EQ 2 THEN rev_vd_vs=1 ;change default so that VAR_DEPEND and VAR_SIZE are reversed
;if not o/w changed in TEST_DIM_ORDER
rev_vd_vsh=rev_vd_vs ;keep original value in hold variable (required if rev_vd_vs eq 3)
IF (rev_vd_vs EQ 2) OR (rev_vd_vs EQ 3) THEN rev_vd_vs=1 ;change default so that VAR_DEPEND and VAR_SIZE
;are reversed if not o/w changed in TEST_DIM_ORDER
;Dimension the structure to the size of the SDS datasets (with dimension n_sds)
sds=REPLICATE(sds_set, n_sds, max_atts)
......@@ -1611,8 +1621,9 @@ ENDIF ELSE BEGIN ;netCDF file
catinfo[li[0],*]=ci[*]
ENDFOR
IF rev_vd_vs EQ 2 THEN rev_vd_vs=1 ;change default so that VAR_DEPEND and VAR_SIZE are reversed
;if not o/w changed in TEST_DIM_ORDER
rev_vd_vsh=rev_vd_vs ;keep original value in hold variable (required if rev_vd_vs eq 3)
IF (rev_vd_vs EQ 2) OR (rev_vd_vs EQ 3) THEN rev_vd_vs=1 ;change default so that VAR_DEPEND and VAR_SIZE
;are reversed if not o/w changed in TEST_DIM_ORDER
;Dimension the structure to the size of the SDS datasets (with dimension n_sds)
sds=REPLICATE(sds_set, n_sds, max_atts)
......@@ -1783,6 +1794,7 @@ ENDELSE
IF (dv_order EQ 0) AND (n_vn NE 0L) THEN INFOTXT_OUTPUT_A,[6]
;If necessary write comment regarding VAR_SIZE and VAR_DEPEND dimension ordering
rev_vd_vs=rev_vd_vsh ;used for when rev_vd_vs eq 3
IF (rev_vd_vs MOD 10 EQ 0) OR (rev_vd_vs EQ 3) THEN INFOTXT_OUTPUT_A,[11,rev_vd_vs]
END ;Procedure Read_HDF_SDS
......@@ -1964,7 +1976,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.0b19 (20180218)
;Program sub-version 4.0b20 (20181116)
; ----------
;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