Skip to content
Snippets Groups Projects
Commit a70a830d authored by Ian Boyd's avatar Ian Boyd
Browse files

Replace geoms_tools.pro

parent b1782679
No related branches found
No related tags found
No related merge requests found
;Main Program Version: geoms_tools.pro v1.67, 20190506
;Main Program Version: geoms_tools.pro v1.68, 20190514
; Written by Ian Boyd for AVDC/EVDC - iboyd@astro.umass.edu
;
FUNCTION is_a_number_gt,value
......@@ -1129,6 +1129,7 @@ FUNCTION geoms_tools, optqh, tav, hdfqh, outdir, dataformat, DATETIME=o1, NOTC=o
; given in the FILE_META_VERSION global attribute. If this attribute is invalid
; or not present, or the TAV file can't be located, the input TAV file will
; be used for checks but an error code will be generated - Version 1.67
; 20190514, Update due to fix in idlcr8ascii - Version 1.68
;
; Input: optqh - Integer defining type of testing 0=QA, 1=Harmonization
; tav - Table Attribute Values file used to test Metadata
......@@ -1165,7 +1166,7 @@ FUNCTION geoms_tools, optqh, tav, hdfqh, outdir, dataformat, DATETIME=o1, NOTC=o
; The output from IDLCR8ASCII is then used in the call to:
; IDLCR8HDF - which performs the QA and Harmonization
gtver='geoms_tools version 1.67, 2019-05-06'
gtver='geoms_tools version 1.68, 2019-05-14'
gt_error_code=3 ;Integer to identify return error code (3 = Invalid input)
par1chk=0 & parchk=0
IF N_PARAMS() GE 1 THEN BEGIN ;test first parameter only
......@@ -1317,7 +1318,7 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
ELSE OPENR,hu,hdfdir+'idlcr8ascii.log',/GET_LUN
READF,hu,qh_s1
FREE_LUN,hu
IF optqh EQ 0 THEN BEGIN ;QA option so identify FILE_META_VERSION
;Identify input TAV file version and revision number
min_ver=4 ;minimum possible TAV and FMV version
......@@ -1333,16 +1334,16 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
ENDFOR
ENDIF
ENDIF
;Check FILE_META_VERSION to identify correct TAV file to check metadata against
fmv_vr_vals=INTARR(2)-1
tavdir=FILE_DIRNAME(tav,/MARK_DIRECTORY)
fmvi=WHERE(STRMID(ga,0,17) EQ 'FILE_META_VERSION',fmvcnt)
fmv_tav=''
invalid_fmv=0B
IF fmvcnt EQ 1 THEN BEGIN
res=STRSPLIT(ga[fmvi[0]],' =;',/EXTRACT,COUNT=rcnt)
res=STRSPLIT(ga[fmvi[0]],' =;',/EXTRACT,COUNT=rcnt)
IF rcnt GE 2 THEN BEGIN
fmv_val=STRTRIM(STRUPCASE(res[1]),2)
fmv_tav_chk=tavdir+'tableattrvalue_'+fmv_val+'.dat'
......@@ -1360,9 +1361,9 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
ENDIF
ENDIF ELSE invalid_fmv=1B
ENDIF ELSE invalid_fmv=1B
test1=fmv_tav NE '' ;i.e. tableattrvalue file identified in FMV is available
test2=fmv_vr_vals[0] GE min_ver
test2=fmv_vr_vals[0] GE min_ver
IF (test1) AND (test2) THEN tav=fmv_tav $
ELSE IF (invalid_fmv) OR (~test1) OR (~test2) THEN BEGIN
PRINTF,lu,''
......@@ -1375,7 +1376,7 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
ENDIF ELSE BEGIN
IF min_ver LT 10 THEN mvs='0'+STRTRIM(min_ver,2) ELSE mvs=STRTRIM(min_ver,2)
PRINTF,lu,'ERROR: FILE_META_VERSION metadata definitions must be version '+mvs+ $
' or greater. Metadata checks based on '+tav_ver+' definitions'
' or greater. Metadata checks based on '+tav_ver+' definitions'
ENDELSE
fmv_err=1B
ENDIF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment