Commit 85aedb6d authored by Ian Boyd's avatar Ian Boyd

Replace cds_tools.pro

parent b902de9a
;Main Program Version: cds_tools.pro Release v2.0b56, 20181116
;Main Program Version: cds_tools.pro Release v2.0b59, 20190514
; Written by Ian Boyd for the AVDC/EVDC - iboyd@astro.umass.edu
;Sub-versions:
; 20090828: Initial Release for testing - v0.1
......@@ -152,7 +152,12 @@
; in Celcius (affected NDACC NASA Ames only) - v2.0b54
; 20180901, Previous fix caused crash when checking non-NDACC measurements. Fixed in
; this version - v2.0b55
; 20181116 Update due to fix in idlcr8ascii - v2.0b56
; 20181116, Update due to fix in idlcr8ascii - v2.0b56
; 20190314, Add 'LON360E TO GEOMS' to conv_chk array so that program can convert longitude
; values using the 0-360E convention to GEOMS convention. Compiled with
; latest idlcr8hdf that allows for HDF5 compression - v2.0b57
; 20190506, Update due to fix in idlcr8hdf - v2.0b58
; 20190514, Update due to fix in idlcr8ascii - v2.0b59
;Program to read in a file or string array created by CDS_Match (or equivalent) and,
;based on the input information, convert NDACC NASA/AMES, WOUDC CSV, SHADOZ, NOAA-ESRL or
......@@ -1960,6 +1965,8 @@ PRO write_data, si, dv_arr, ndhse, holddata, vat, res, sectionb, ndacc, dyear, d
; in Celcius (affected NDACC NASA Ames only) - v2.0b54
; 20180901: Previous fix caused crash when checking non-NDACC measurements. Fixed in
; this version - v2.0b55
; 20190314: Add 'LON360E TO GEOMS' to conv_chk array so that program can convert longitude
; values using the 0-360E convention to GEOMS convention - v2.0b57
;
; Input: si - index (or indices) of NDACC/WOUDC header line describing the data being searched for
; dv_arr - string array holding the DATA_VARIABLE values
......@@ -1983,7 +1990,7 @@ PRO write_data, si, dv_arr, ndhse, holddata, vat, res, sectionb, ndacc, dyear, d
; Called by: Convert
mv=STRTRIM(LONG(colsclfill[1]),2) ;'-90000' ;dummy value in holddata (if changing need to also change value in CONVERT routine)
conv_chk=['%','PP TO MR','PP TO ND','C TO K','INTERPOLATE_LOG_VALUES','TK TO T','F TO M'] ;Possible conversion factors
conv_chk=['%','PP TO MR','PP TO ND','C TO K','INTERPOLATE_LOG_VALUES','TK TO T','F TO M','LON360E TO GEOMS'] ;Possible conversion factors
dsize=datasize ;holding array for the data
vdt=SIZE(datasize,/TYPE)
......@@ -2598,6 +2605,11 @@ ENDIF ELSE IF res[3] EQ conv_chk[3] THEN BEGIN ;Convert C to K
IF mcnt NE 0 THEN dsize[mi]=dsize[mi]+273.15
ENDIF ELSE IF res[3] EQ conv_chk[6] THEN BEGIN ;Convert ft to m
IF mcnt NE 0 THEN dsize[mi]=dsize[mi]*0.3048
ENDIF ELSE IF res[3] EQ conv_chk[7] THEN BEGIN ;Convert longitude 360 E convention to GEOMS
IF mcnt NE 0 THEN BEGIN
lonhi=WHERE(dsize[mi] GT 180.,lonhcnt)
IF lonhcnt NE 0 THEN dsize[mi[lonhi]]=dsize[mi[lonhi]]-360.
ENDIF
ENDIF ELSE BEGIN
;Apply Metadata Scale factor to the data (given in Section (b) of the Translation Table)
IF mcnt NE 0 THEN dsize[mi]=dsize[mi]*DOUBLE(res[3])
......@@ -3677,7 +3689,7 @@ FUNCTION cds_tools, listf, tav, outdir, dataformat, DATETIME=o1
;Initialize statusflag, and exit_code
statusflag='' & dum='' & exit_code=3
cdver='cds_tools version 2.0b56, 2018-11-16'
cdver='cds_tools version 2.0b59, 2019-05-14'
;Check input parameters
IF N_PARAMS() LT 3 THEN $
......
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