Commit 36cf2ecc authored by Ian Boyd's avatar Ian Boyd
Browse files

Replace geoms_tools.pro

parent ce3a5a14
;Main Program Version: geoms_tools.pro v2.09, 20201211
;Main Program Version: geoms_tools.pro v2.10, 20210617
; Written by Ian Boyd for AVDC/EVDC - iboyd@astro.umass.edu
;
FUNCTION is_a_number_gt,value
......@@ -304,7 +304,7 @@ PRO read_tav_dates, tavdir, min_ver, tavall, tavmjd2k, tavver
;History:
; 20201122: Introduced to geoms_tools - Version 2.08
; 20201211: Add tavver; include search for '_idl' versions of the TAV files and
; make searches case insensitive; ensure TAV files are saved in
; make searches case insensitive; ensure TAV files are saved in
; chronological order - Version 2.09
;
;Inputs: tavdir - Directory containing all the TAV files
......@@ -384,7 +384,7 @@ PRO tav_files_for_qa, tav, ga, lu, tavlist, gf_err, cur_tav
;
;History:
; 20201122: Introduced to geoms_tools - Version 2.08
; 20201211: Include search for '_idl' versions of the TAV files and make searches
; 20201211: Include search for '_idl' versions of the TAV files and make searches
; case insensitive - Version 2.09
;
;Inputs: tav - TAV file used in call to geoms_qa
......@@ -421,7 +421,7 @@ IF rcnt GE 2 THEN BEGIN
ENDIF
ENDIF
;Check FILE_GENERATION_DATE and FILE_META_VERSION to identify correct TAV
;Check FILE_GENERATION_DATE and FILE_META_VERSION to identify correct TAV
;file to check metadata against
gf_chk=['FILE_GENERATION_DATE','FILE_META_VERSION']
n_spl=[1,2] ;expected number of (sub-)values in the attribute
......@@ -455,11 +455,11 @@ FOR i=0,1 DO BEGIN
; IF IS_A_NUMBER_GT(gf_vr[fi]) THEN gf_vr_vals[fi]=FIX(gf_vr[fi])
;ENDFOR
;test2=(gf_vr_vals[0] GE min_ver) AND (gf_vr_vals[1] GE 0)
test2=1B ;test is redundant because tavver version and revision values already checked
test2=1B ;test is redundant because tavver version and revision values already checked
gi=WHERE(gf_val EQ tavver,gcnt) ;case sensitive check
IF gcnt EQ 0 THEN $
gi=WHERE(STRUPCASE(gf_val) EQ STRUPCASE(tavver),gcnt) ;case insensitive check
IF gcnt NE 0 THEN gf_tav=tavall[gi[0]]
IF gcnt NE 0 THEN gf_tav=tavall[gi[0]]
ENDIF
ENDELSE
ENDIF
......@@ -478,7 +478,7 @@ FOR i=0,1 DO BEGIN
PRINTF,lu,'ERROR: TAV file version containing metadata definitions cannot be identified due to missing or'
PRINTF,lu,' invalid '+gf_chk[i]+' global attribute'+itxtfgd
ENDIF ELSE BEGIN
PRINTF,lu,'ERROR: TAV file version cannot be identified due to missing or invalid '+gf_chk[i]+' global attribute'
PRINTF,lu,'ERROR: TAV file version cannot be identified due to missing or invalid '+gf_chk[i]+' global attribute'
ENDELSE
ENDIF ELSE IF ~test1 THEN BEGIN
IF i EQ 0 THEN itxt='corresponding to' ELSE itxt='matching'
......@@ -1248,7 +1248,7 @@ FUNCTION geoms_tools, optqh, tav, hdfqh, outdir, dataformat, DATETIME=o1, NOTC=o
; geoms-harmon-v1.0_Readme.pdf, available from http://avdc.gsfc.nasa.gov.
; idlcr8ascii-v4.0_Readme.pdf, available from http://avdc.gsfc.nasa.gov.
; idlcr8hdf-v4.0_Readme.pdf, available from http://avdc.gsfc.nasa.gov.
;Program sub-version 2.09 (20201211)
;Program sub-version 2.10 (20210617)
; ----------
;Written by Ian Boyd for AVDC/EVDC - iboyd@astro.umass.edu
;
......@@ -1343,13 +1343,13 @@ FUNCTION geoms_tools, optqh, tav, hdfqh, outdir, dataformat, DATETIME=o1, NOTC=o
; checks - Version 2.05
; 20201020, Update due to fixes to idlcr8hdf - Version 2.06
; 20201026, Update due to fix to idlcr8hdf - Version 2.07
; 20201122, QA checks carried out using the metadata definitions in the TAV version
; determined by the FILE_GENERATION_DATE (FGD), in the first instance, then the
; FILE_META_VERSION (FMV), if different. This adds a check for the FMV TAV version
; 20201122, QA checks carried out using the metadata definitions in the TAV version
; determined by the FILE_GENERATION_DATE (FGD), in the first instance, then the
; FILE_META_VERSION (FMV), if different. This adds a check for the FMV TAV version
; using definitions that are out-of-date. If either TAV can't be determined or found
; then the input TAV will be used for checks and an error generated - Version 2.08
; 20201211: Apply fixes and improvements to procedures identifying correct TAV version(s) to
; use for checks; Fix IDL Math Error (Floating Illegal Operand) in idlcr8hdf
; use for checks; Fix IDL Math Error (Floating Illegal Operand) in idlcr8hdf
; - Version 2.09
;
; Input: optqh - Integer defining type of testing 0=QA, 1=Harmonization
......@@ -1383,11 +1383,11 @@ FUNCTION geoms_tools, optqh, tav, hdfqh, outdir, dataformat, DATETIME=o1, NOTC=o
; 2: QA - Failed
; 3: Incorrect input parameters
;
; External Routines Called: IDLCR8ASCII - to read the contents of the HDF file into session
; External Routines Called: IDLCR8ASCII - to read the contents of the HDF file into session
; memory. The output from IDLCR8ASCII is then used in the call to:
; IDLCR8HDF - which performs the QA
gtver='geoms_tools version 2.09, 2020-12-11'
gtver='geoms_tools version 2.10, 2021-06-17'
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
......@@ -1634,7 +1634,7 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
qh_s2=[qh_s2[0:5],list_changes,qh_s2[6:N_ELEMENTS(qh_s2)-1]]
lq=N_ELEMENTS(qh_s2)
ENDIF
IF optqh EQ 0 THEN BEGIN
;Edit messages regarding the TAV file types
tavi=WHERE(STRMID(qh_s2,0,14) EQ 'Input TAV File',tavcnt)
......@@ -1656,7 +1656,7 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
;TAV files are input TAV (error generated) and one from FMV
qh_s2[tavi[1]]=tav_inputs[1]+tav_name[1]
END
ELSE: ;Only check is with input TAV file so no change needed to qh_s2
ELSE: ;Only check is with input TAV file so no change needed to qh_s2
ENDCASE
IF tavcnt EQ 2 THEN BEGIN
tav_err_chk=BYTARR(2)
......@@ -1677,7 +1677,7 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
IF tav_err_chk[0] THEN $
qh_s2[tavi[1]+1]=' ERROR: QA errors also generated using '+tavrv[1]+' definitions' $
ELSE BEGIN
qh_s2[tavi[1]+1]=' ERROR: QA errors generated using '+tavrv[1]+' definitions.'
qh_s2[tavi[1]+1]=' ERROR: QA errors generated using '+tavrv[1]+' definitions.'
qh_s2[tavi[1]+1]=qh_s2[tavi[1]+1]+' Please update first FILE_META_VERSION value to '+ $
tavrv[0]
ENDELSE
......@@ -1688,13 +1688,13 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
tavrv[0]+' and use these TAV definitions'
ENDIF ELSE BEGIN
qh_s2[tavi[1]+1]=' INFORMATION: GEOMS file passed using '+tavrv[1]+' definitions'
ENDELSE
ENDELSE
ENDELSE
;Don't want to keep additional mesasages from 2nd TAV check
;Don't want to keep additional mesasages from 2nd TAV check
qh_s2=qh_s2[0:tavi[1]+1]
lq=N_ELEMENTS(qh_s2)
ENDIF
ENDIF
ENDIF
lc=lc+1
IF (optqh EQ 1) AND (intype3 NE -1) AND (lc EQ 1) THEN BEGIN
......@@ -1947,7 +1947,7 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
ai=WHERE(STRMID(qh_str,0,8) EQ ' ERROR ',acnt)
bi=WHERE(STRMID(qh_str,0,8) EQ ' ERROR:',bcnt)
ci=WHERE(STRMID(qh_str,0,8) EQ ' NON-ST',ccnt)
;One last check for more than one consecutive empty line (happens when checking two different TAVs (20201119))
qh_strx=[qh_str[0]]
FOR j=1,N_ELEMENTS(qh_str)-1 DO BEGIN
......@@ -1955,7 +1955,7 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
IF (qh_strm0 NE '') OR ((qh_strm0 EQ '') AND (qh_strm1 NE '')) THEN qh_strx=[qh_strx,qh_strm0]
ENDFOR
qh_str=qh_strx
;PRINTF,lu,gttxt
FOR j=0,N_ELEMENTS(qh_str)-1 DO PRINTF,lu,qh_str[j]
PRINTF,lu,''
......
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