Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
geoms
cds_convert
Commits
c5d0760b
Commit
c5d0760b
authored
Nov 16, 2018
by
Ian Boyd
Browse files
Replace idlcr8ascii.pro
parent
516ab96f
Changes
1
Hide whitespace changes
Inline
Side-by-side
idlcr8ascii.pro
View file @
c5d0760b
;
Main
Program
Version
:
idlcr8ascii
.
pro
v4
.
0
b
19
,
2018
0218
;
Main
Program
Version
:
idlcr8ascii
.
pro
v4
.
0
b
20
,
2018
1116
;
Written
by
Ian
Boyd
for
the
AVDC
-
iboyd
@
astro
.
umass
.
edu
;
Written
by
Ian
Boyd
for
the
AVDC
-
iboyd
@
astro
.
umass
.
edu
;
;
;
Sub
-
versions
:
;
Sub
-
versions
:
...
@@ -67,8 +67,12 @@
...
@@ -67,8 +67,12 @@
; than the number of datasets in the file.
; than the number of datasets in the file.
; v4.0b19 20180218 - Fix bug that caused multi-dimensional array ordering to not be correctly identified
; 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
; 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
; checks. Now rev_vd_vs changes to 1 (VAR_SIZE, VAR_DEPEND and dataset ordering is
; rev_vd_vs=2 after all the checks.
; 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
PRO idlcr8ascii_common
;Procedure to define the data COMMON block WIDGET_WIN_A, containing common variables
;Procedure to define the data COMMON block WIDGET_WIN_A, containing common variables
...
@@ -188,7 +192,7 @@ COMMON WIDGET_WIN_A
...
@@ -188,7 +192,7 @@ COMMON WIDGET_WIN_A
;procedure which provides an introduction message before starting the program.
;procedure which provides an introduction message before starting the program.
nhdr=46 & errtxt=STRARR(nhdr)
nhdr=46 & errtxt=STRARR(nhdr)
vertxt=['idlcr8ascii
-
v4
.
0
_Readme
.
pdf','v4
.
0
b
18
Dec
ember
201
6
']
vertxt=['idlcr8ascii
-
v4
.
0
_Readme
.
pdf','v4
.
0
b
20
Nov
ember
201
8
']
errtxt[1]='
Welcome
to
IDLcr8ASCII
.
This
program
reads
GEOMS
compliant
HDF4
,
HDF5
and
netCDF
files
and'
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[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]+'
).
'
errtxt[3]='files
(
also
refer
to
'+vertxt[0]+'
).
'
...
@@ -879,6 +883,10 @@ PRO read_hdf_sds, ifile, ga, sds, catinfo
...
@@ -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
; 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
; 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
; 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.
; 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
')
; 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
...
@@ -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
;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);
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
;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
;are swapped by default
;List of Standard GEOMS Variable Attributes
;List of Standard GEOMS Variable Attributes
...
@@ -1122,10 +1130,11 @@ IF catinfo[0,0] EQ 'H4' THEN BEGIN
...
@@ -1122,10 +1130,11 @@ IF catinfo[0,0] EQ 'H4' THEN BEGIN
ENDFOR
ENDFOR
IF
max_atts
EQ
0
L
THEN
max_atts
=
3
;
Use
information
from
HDF_SD_GETINFO
call
only
IF
max_atts
EQ
0
L
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
rev_vd_vsh
=
rev_vd_vs
;
keep
original
value
in
hold
variable
(
required
if
rev_vd_vs
eq
3
)
;
if
not
o
/
w
changed
in
TEST_DIM_ORDER
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
;
Dimension
the
structure
to
the
number
of
datasets
x
number
of
attributes
sds
=
REPLICATE
(
sds_set
,
n_sds_hold
,
max_atts
)
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
...
@@ -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
STOP_WITH_ERROR_A
,
o3
[
3
]
+
proname
,
'No Datasets'
+
errtxt
[
0
],
lu
&
RETURN
ENDIF
ENDIF
IF
rev_vd_vs
EQ
2
THEN
rev_vd_vs
=
1
;
change
default
so
that
VAR_DEPEND
and
VAR_SIZE
are
reversed
rev_vd_vsh
=
rev_vd_vs
;
keep
original
value
in
hold
variable
(
required
if
rev_vd_vs
eq
3
)
;
if
not
o
/
w
changed
in
TEST_DIM_ORDER
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
)
;
Dimension
the
structure
to
the
size
of
the
SDS
datasets
(
with
dimension
n_sds
)
sds
=
REPLICATE
(
sds_set
,
n_sds
,
max_atts
)
sds
=
REPLICATE
(
sds_set
,
n_sds
,
max_atts
)
...
@@ -1611,9 +1621,10 @@ ENDIF ELSE BEGIN ;netCDF file
...
@@ -1611,9 +1621,10 @@ ENDIF ELSE BEGIN ;netCDF file
catinfo
[
li
[
0
],
*
]
=
ci
[
*
]
catinfo
[
li
[
0
],
*
]
=
ci
[
*
]
ENDFOR
ENDFOR
IF
rev_vd_vs
EQ
2
THEN
rev_vd_vs
=
1
;
change
default
so
that
VAR_DEPEND
and
VAR_SIZE
are
reversed
rev_vd_vsh
=
rev_vd_vs
;
keep
original
value
in
hold
variable
(
required
if
rev_vd_vs
eq
3
)
;
if
not
o
/
w
changed
in
TEST_DIM_ORDER
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
)
;
Dimension
the
structure
to
the
size
of
the
SDS
datasets
(
with
dimension
n_sds
)
sds
=
REPLICATE
(
sds_set
,
n_sds
,
max_atts
)
sds
=
REPLICATE
(
sds_set
,
n_sds
,
max_atts
)
;
Put
datasets
and
attributes
into
sds
structure
;
Put
datasets
and
attributes
into
sds
structure
...
@@ -1783,6 +1794,7 @@ ENDELSE
...
@@ -1783,6 +1794,7 @@ ENDELSE
IF
(
dv_order
EQ
0
)
AND
(
n_vn
NE
0
L
)
THEN
INFOTXT_OUTPUT_A
,[
6
]
IF
(
dv_order
EQ
0
)
AND
(
n_vn
NE
0
L
)
THEN
INFOTXT_OUTPUT_A
,[
6
]
;
If
necessary
write
comment
regarding
VAR_SIZE
and
VAR_DEPEND
dimension
ordering
;
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
]
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
END
;
Procedure
Read_HDF_SDS
...
@@ -1964,7 +1976,7 @@ PRO idlcr8ascii, ifile, ga, sds, reterr, $
...
@@ -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
documentation
,
idlcr8ascii
-
v4
.
0
_Readme
.
pdf
,
available
on
http
://
avdc
.
gsfc
.
nasa
.
gov
.
;
;
;
Program
sub
-
version
4.0
b
19
(
2018
0218
)
;
Program
sub
-
version
4.0
b
20
(
2018
1116
)
;
----------
;
----------
;
Written
by
Ian
Boyd
for
the
AVDC
-
iboyd
@
astro
.
umass
.
edu
;
Written
by
Ian
Boyd
for
the
AVDC
-
iboyd
@
astro
.
umass
.
edu
;
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment