Commit 7fff07e0 authored by Ian Boyd's avatar Ian Boyd
Browse files

Replace geoms_tools.pro

parent 78b6310c
;Main Program Version: geoms_tools.pro v2.07, 20201026
;Main Program Version: geoms_tools.pro v2.08, 20201122
; Written by Ian Boyd for AVDC/EVDC - iboyd@astro.umass.edu
;
FUNCTION is_a_number_gt,value
......@@ -296,6 +296,189 @@ END ;Procedure GEOMS_One_Off_Check
PRO read_tav_dates, tavdir, min_ver, tavall, tavmjd2k
;Procedure to create arrays of all available TAV files and their creation dates
; ----------
;Written by Ian Boyd for AVDC/EVDC - iboyd@astro.umass.edu
;
;History:
; 20201122: Introduced to geoms_tools - Version 2.08
;
;Inputs: tavdir - Directory containing all the TAV files
; min_ver - Minimum version numner for valid TAV files
;
;Output: tavall - an array containing the fully qualified TAV file names
; tavmjd2k - an array containing the TAV file creation dates in MJD2K form
;
;Called by: TAV_Files_For_QA
;
;Subroutines Called: None
;
tavall=FILE_SEARCH(tavdir+'tableattrvalue_*.dat',COUNT=tcnt)
tavymd=[-1L] ;default TAVYMD array
dum=''
IF tcnt NE 0 THEN BEGIN
gdtav=BYTARR(tcnt) & tav_vr_vals=INTARR(2)-1
FOR i=0,tcnt-1 DO BEGIN
tavname=FILE_BASENAME(tavall[i])
tav_chk=STRSPLIT(tavname,'_.',/EXTRACT,COUNT=rcnt)
tav_chk=[tav_chk,''] ;ensure it has at least 2 values
;Determine version and revision values
IF STRLEN(tav_chk[1]) EQ 6 THEN BEGIN
tav_vr=[STRMID(tav_chk[1],0,2),STRMID(tav_chk[1],3)]
FOR fi=0,1 DO BEGIN
IF IS_A_NUMBER_GT(tav_vr[fi]) THEN tav_vr_vals[fi]=FIX(tav_vr[fi])
ENDFOR
;Check for valid TAV version and revision
IF (tav_vr_vals[0] GE min_ver) AND (tav_vr_vals[1] GE 0) THEN gdtav[i]=1B
ENDIF
ENDFOR
;Create list of all valid TAV files
gi=WHERE(gdtav,gcnt)
IF gcnt NE 0 THEN BEGIN
tavall=tavall[gi]
tavmjd2k=DBLARR(gcnt)
FOR i=0,gcnt-1 DO BEGIN
OPENR,tu,tavall[i],/GET_LUN
REPEAT READF,tu,dum UNTIL STRPOS(STRUPCASE(dum),'BASED') NE -1
FREE_LUN,tu
res=STRSPLIT(dum,' ',/EXTRACT,COUNT=rcnt)
IF rcnt GE 2 THEN BEGIN
tymd=STRSPLIT(res[rcnt-2],'-',/EXTRACT,COUNT=tycnt)
thms=STRSPLIT(res[rcnt-1],':',/EXTRACT,COUNT=thcnt)
IF (tycnt EQ 3) AND (thcnt EQ 3) THEN BEGIN
n_chk=1B
FOR j=0,2 DO IF ~IS_A_NUMBER_GT(tymd[j]) THEN n_chk=0B
FOR j=0,2 DO IF ~IS_A_NUMBER_GT(thms[j]) THEN n_chk=0B
tiso=tymd[0]+tymd[1]+tymd[2]+'T'+thms[0]+thms[1]+thms[2]+'Z'
IF n_chk THEN BEGIN
mjdcalc=JULIAN_DATE(tiso,/I,/M)
TAVMJD2k[i]=mjdcalc
ENDIF
ENDIF
ENDIF
ENDFOR
ENDIF
ENDIF
END
PRO tav_files_for_qa, tav, ga, lu, tavlist, gf_err, cur_tav
;Procedure to determine TAV file versions needed for definition checks when doing QA,
;based on FILE_GENERATION_DATE (FGD) and FILE_META_VERSION (FMV) values
; ----------
;Written by Ian Boyd for AVDC/EVDC - iboyd@astro.umass.edu
;
;History:
; 20201122: Introduced to geoms_tools - Version 2.08
;
;Inputs: tav - TAV file used in call to geoms_qa
; ga - Global attributes read in by idlcr8ascii
; lu - File unit for writing messages to file
;
;Output: tavlist - an array containing the file names of the TAV files needed for testing.
; The first index is the TAV determined from FGD if determined, or the input TAV
; The second index is the TAV determined from FMV, if different to the first TAV
; gf_err - returns 1B if an error occurs when determining TAV file versions
; cur_tav = reutrns 1B if using the input TAV rather than the one determined by FGD
;
;Called by: GEOMS_TOOLS
;
;Subroutines Called: Read_TAV_Dates
;
tavlist=STRARR(3)
tavdir=FILE_DIRNAME(tav,/MARK_DIRECTORY)
min_ver=4 ;minimum allowable TAV version
;Read in all the TAV filenames and definition creation dates
READ_TAV_DATES,tavdir,min_ver,tavall,tavmjd2k
;Identify input TAV file version and revision number
tav_vr_vals=INTARR(2)-1
tavfile=FILE_BASENAME(tav)
res=STRSPLIT(tavfile,'_.',/EXTRACT,COUNT=rcnt)
IF rcnt GE 2 THEN BEGIN
tav_ver=STRTRIM(STRUPCASE(res[1]),2)
IF STRLEN(tav_ver) EQ 6 THEN BEGIN
tav_vr=[STRMID(tav_ver,0,2),STRMID(tav_ver,3)]
FOR fi=0,1 DO BEGIN
IF IS_A_NUMBER_GT(tav_vr[fi]) THEN tav_vr_vals[fi]=FIX(tav_vr[fi])
ENDFOR
ENDIF
ENDIF
;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
FOR i=0,1 DO BEGIN
gf_tav=''
gf_vr_vals=INTARR(2)-1
invalid_gf=1B & test2=0B
gfi=WHERE(STRMID(ga,0,STRLEN(gf_chk[i])) EQ gf_chk[i],gfcnt)
IF gfcnt EQ 1 THEN BEGIN
res=STRSPLIT(ga[gfi[0]],' =;',/EXTRACT,COUNT=rcnt)
IF rcnt EQ n_spl[i]+1 THEN BEGIN
gf_val=STRTRIM(STRUPCASE(res[1]),2)
IF i EQ 0 THEN BEGIN
gf_valh=gf_val
fgd_chk=JULIAN_DATE(gf_valh,/I,/M)
systmjd2k=SYSTIME(/JULIAN,/UTC)-2451544.5D + 1.D ;current MJD2K + 1 day
IF (fgd_chk GE 0.D) AND (fgd_chk LE systmjd2k) THEN BEGIN
invalid_gf=0B
di=WHERE(fgd_chk GE tavmjd2k,dcnt)
IF dcnt NE 0 THEN BEGIN
gf_tav=tavall[di[dcnt-1]]
test2=1B ;version and revision values already checked in READ_TAV_DATES
ENDIF
ENDIF
ENDIF ELSE BEGIN
invalid_gf=0B
IF STRLEN(gf_val) EQ 6 THEN BEGIN
;Check version and revision values
gf_vr=[STRMID(gf_val,0,2),STRMID(gf_val,3)]
FOR fi=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)
gf_tav_chk=tavdir+'tableattrvalue_'+gf_val+'.dat'
IF FILE_TEST(gf_tav_chk) THEN gf_tav=gf_tav_chk
ENDIF
ENDELSE
ENDIF
ENDIF
test1=gf_tav NE '' ;i.e. tableattrvalue file identified is available
IF (test1) AND (test2) THEN tavlist[i]=gf_tav $
ELSE IF (invalid_gf) OR (~test1) OR (~test2) THEN BEGIN
IF i EQ 0 THEN BEGIN
itxtfgd='. Metadata checks based on '+tav_ver+' definitions'
tavlist[i]=tav & cur_tav=1B
ENDIF ELSE itxtfgd=''
PRINTF,lu,''
IF invalid_gf THEN BEGIN
IF i EQ 0 THEN 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'
ENDELSE
ENDIF ELSE IF ~test1 THEN BEGIN
IF i EQ 0 THEN itxt='corresponding to' ELSE itxt='matching'
PRINTF,lu,'ERROR: TAV file '+itxt+' the '+gf_chk[i]+' entry ('+gf_val+') not found'+itxtfgd
ENDIF ELSE BEGIN
;Can only occur with FILE_META_VERSION value
IF min_ver LT 10 THEN mvs='0'+STRTRIM(min_ver,2) ELSE mvs=STRTRIM(min_ver,2)
PRINTF,lu,'ERROR: '+gf_chk[i]+' metadata definitions must be version '+mvs+ $
' or greater'
ENDELSE
gf_err=1B
ENDIF
ENDFOR
IF STRUPCASE(tavlist[0]) EQ STRUPCASE(tavlist[1]) THEN tavlist[1]=''
END ;Procedure tav_files_for_QA
PRO ppv_check,sds,dvcnt,n_lab,template_change
;Procedure to convert ppv units to ppmv/ppbv/pptv
; ----------
......@@ -1048,7 +1231,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.06 (20201020)
;Program sub-version 2.08 (20201122)
; ----------
;Written by Ian Boyd for AVDC/EVDC - iboyd@astro.umass.edu
;
......@@ -1143,6 +1326,11 @@ 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
; 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
;
; Input: optqh - Integer defining type of testing 0=QA, 1=Harmonization
; tav - Table Attribute Values file used to test Metadata
......@@ -1175,11 +1363,11 @@ FUNCTION geoms_tools, optqh, tav, hdfqh, outdir, dataformat, DATETIME=o1, NOTC=o
; 2: QA - Failed
; 3: Incorrect input parameters
;
; 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 and Harmonization
; 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.07, 2020-10-26'
gtver='geoms_tools version 2.08, 2020-11-22'
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
......@@ -1202,7 +1390,7 @@ IF (N_PARAMS() GE 3) AND (parchk EQ 1) THEN BEGIN ;test remaining parameters
IF N_PARAMS() GE 4 THEN intype3=SIZE(outdir,/TYPE) ELSE intype3=-1
IF (intype1 EQ 7) AND (intype2 EQ 7) THEN BEGIN ;string input, so check for valid filenames
;check TAV file is present
tav=FILE_SEARCH(tav,/TEST_READ,/TEST_REGULAR,COUNT=tavcnt)
tav=FILE_SEARCH(tav,/TEST_READ,/TEST_REGULAR,/FULLY_QUALIFY_PATH,COUNT=tavcnt)
;create an array of valid HDF filenames
hdfqh=FILE_SEARCH(hdfqh,/TEST_READ,/TEST_REGULAR,/FULLY_QUALIFY_PATH,COUNT=hdfcnt)
ENDIF
......@@ -1303,7 +1491,7 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
ELSE IF HDF_ISHDF(hdfqh[i]) THEN h_type='H4' ELSE h_type='NC'
;Check whether HDF4, HDF5 or netCDF file to determine default output format of the HDF file
lc=0 & newstr='' & list_changes=[''] & fmv_err=0B
lc=0 & newstr='' & list_changes=[''] & gf_err=0B & cur_tav=0B
WHILE lc LT n_lc DO BEGIN
IF (lc EQ 0) AND (optqh EQ 1) THEN BEGIN
;If performing Harmonization, need to determine a new DATA_FILE_VERSION (DFV) value
......@@ -1333,68 +1521,9 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
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
tav_vr_vals=INTARR(2)-1
tavfile=FILE_BASENAME(tav)
res=STRSPLIT(tavfile,'_.',/EXTRACT,COUNT=rcnt)
IF rcnt GE 2 THEN BEGIN
tav_ver=STRTRIM(STRUPCASE(res[1]),2)
IF STRLEN(tav_ver) EQ 6 THEN BEGIN
tav_vr=[STRMID(tav_ver,0,2),STRMID(tav_ver,3)]
FOR fi=0,1 DO BEGIN
IF IS_A_NUMBER_GT(tav_vr[fi]) THEN tav_vr_vals[fi]=FIX(tav_vr[fi])
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)
IF rcnt GE 2 THEN BEGIN
fmv_val=STRTRIM(STRUPCASE(res[1]),2)
fmv_tav_chk=tavdir+'tableattrvalue_'+fmv_val+'.dat'
IF FILE_TEST(fmv_tav_chk) THEN fmv_tav=fmv_tav_chk $
ELSE BEGIN
fmv_tav_chk=tavdir+'tableattrvalue_'+fmv_val+'_idl.dat'
IF FILE_TEST(fmv_tav_chk) THEN fmv_tav=fmv_tav_chk
ENDELSE
;Check version and revision values
IF STRLEN(fmv_val) EQ 6 THEN BEGIN
fmv_vr=[STRMID(fmv_val,0,2),STRMID(fmv_val,3)]
FOR fi=0,1 DO BEGIN
IF IS_A_NUMBER_GT(fmv_vr[fi]) THEN fmv_vr_vals[fi]=FIX(fmv_vr[fi])
ENDFOR
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
IF (test1) AND (test2) THEN tav=fmv_tav $
ELSE IF (invalid_fmv) OR (~test1) OR (~test2) THEN BEGIN
PRINTF,lu,''
IF invalid_fmv THEN BEGIN
PRINTF,lu,'ERROR: TAV file version containing metadata definitions cannot be identified due to missing or'
PRINTF,lu,' invalid FILE_META_VERSION global attribute. Metadata checks based on '+tav_ver+' definitions'
ENDIF ELSE IF ~test1 THEN BEGIN
PRINTF,lu,'ERROR: TAV file matching the FILE_META_VERSION entry ('+fmv_val+') not found. '+ $
'Metadata checks based on '+tav_ver+' definitions'
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'
ENDELSE
fmv_err=1B
ENDIF
ENDIF
IF optqh EQ 0 THEN BEGIN ;QA option
;Identify TAV files needed for checks based on FILE_GENERATION_DATE and FILE_META_VERSION values
TAV_FILES_FOR_QA, tav, ga, lu, tavlist, gf_err, cur_tav
ti=WHERE(tavlist NE '',n_tav_chks) ;number of TAV files to do QA checks on (either 1 or 2)
;Change INFORMATION text in idlcr8ascii.log entries to ERROR
ei=WHERE(STRPOS(qh_s1,'INFORMATION:') NE -1,ecnt)
IF ecnt NE 0 THEN qh_s1[ei]=' ERROR:'+STRMID(qh_s1[ei],14)
......@@ -1437,15 +1566,17 @@ ENDIF ELSE BEGIN ;Commence QA or Harmonization on HDF files
;Delete log file if it is present in the output directory (a new file will be created by idlcr8hdf)
FILE_DELETE,qhdir+logname,/QUIET
IF optqh EQ 0 THEN BEGIN
IF o4 EQ '0' THEN BEGIN
IF h_type EQ 'H5' THEN IDLCR8HDF,ga,sds,tav,qhdir,reterr,/H5,/QA $
ELSE IF h_type EQ 'NC' THEN IDLCR8HDF,ga,sds,tav,qhdir,reterr,/NC,/QA $
ELSE IDLCR8HDF,ga,sds,tav,qhdir,reterr,/QA
ENDIF ELSE BEGIN
IF h_type EQ 'H5' THEN IDLCR8HDF,ga,sds,tav,qhdir,reterr,/H5,/QA,/D $
ELSE IF h_type EQ 'NC' THEN IDLCR8HDF,ga,sds,tav,qhdir,reterr,/NC,/QA,/D $
ELSE IDLCR8HDF,ga,sds,tav,qhdir,reterr,/QA,/D
ENDELSE
FOR j=0,n_tav_chks-1 DO BEGIN
IF o4 EQ '0' THEN BEGIN
IF h_type EQ 'H5' THEN IDLCR8HDF,ga,sds,tavlist[j],qhdir,reterr,/H5,/QA $
ELSE IF h_type EQ 'NC' THEN IDLCR8HDF,ga,sds,tavlist[j],qhdir,reterr,/NC,/QA $
ELSE IDLCR8HDF,ga,sds,tavlist[j],qhdir,reterr,/QA
ENDIF ELSE BEGIN
IF h_type EQ 'H5' THEN IDLCR8HDF,ga,sds,tavlist[j],qhdir,reterr,/H5,/QA,/D $
ELSE IF h_type EQ 'NC' THEN IDLCR8HDF,ga,sds,tavlist[j],qhdir,reterr,/NC,/QA,/D $
ELSE IDLCR8HDF,ga,sds,tavlist[j],qhdir,reterr,/QA,/D
ENDELSE
ENDFOR
ENDIF ELSE IF (intype3 EQ -1) OR (lc EQ 0) THEN BEGIN ;Do not create a new HDF file
IF o4 EQ '0' THEN BEGIN
IF h_type EQ 'H5' THEN IDLCR8HDF,ga,sds,tav,qhdir,reterr,/L,/H5,/NOHDF $
......@@ -1483,6 +1614,62 @@ 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)
tav_name=STRARR(tavcnt)
FOR j=0,tavcnt-1 DO tav_name[j]=STRMID(qh_s2[tavi[j]],15)
tav_inputs=['Input TAV file calculated from FILE_GENERATION_DATE:', $
'Input TAV file calculated from FILE_META_VERSION:', $
'Input TAV file calculated from FILE_GENERATION_DATE and FILE_META_VERSION:']
CASE 1 OF
(~gf_err) AND (~cur_tav) AND (n_tav_chks EQ 1): BEGIN
;TAV files determined from FGD and FMV are the same
qh_s2[tavi[0]]=tav_inputs[2]+tav_name[0]
END
(~gf_err) AND (~cur_tav) AND (n_tav_chks EQ 2): BEGIN
;TAV files determined from FGD and FMV are different
FOR j=0,1 DO qh_s2[tavi[j]]=tav_inputs[j]+tav_name[j]
END
n_tav_chks EQ 2: BEGIN
;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
ENDCASE
IF tavcnt EQ 2 THEN BEGIN
tav_err_chk=BYTARR(2)
tavrv=STRARR(2)
FOR j=0,1 DO tavrv[j]=STRMID(tav_name[j],STRPOS(tav_name[j],'_',/REVERSE_SEARCH)+1,6)
;Check QA using FGD or input TAV for errors
FOR j=0,tavi[1]-1 DO $
IF STRMID(STRTRIM(qh_s2[j],2),0,5) EQ 'ERROR' THEN tav_err_chk[0]=1B
;Check QA using FMV TAV for errors
FOR j=tavi[1],lq-1 DO $
IF STRMID(STRTRIM(qh_s2[j],2),0,5) EQ 'ERROR' THEN tav_err_chk[1]=1B
IF tav_err_chk[1] THEN BEGIN
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]=qh_s2[tavi[1]+1]+' Please update first FILE_META_VERSION value to '+ $
tavrv[0]
ENDELSE
ENDIF ELSE BEGIN
IF tav_err_chk[0] THEN BEGIN
qh_s2[tavi[1]+1]=' ERROR: Definitions based on FILE_META_VERSION='+tavrv[1]+' are out-of-date.'
qh_s2[tavi[1]+1]=qh_s2[tavi[1]+1]+' Please update first FILE_META_VERSION value to '+ $
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
;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
lc=lc+1
IF (optqh EQ 1) AND (intype3 NE -1) AND (lc EQ 1) THEN BEGIN
......@@ -1735,10 +1922,19 @@ 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
qh_strm0=qh_str[j] & qh_strm1=qh_str[j-1]
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,''
IF (acnt NE 0) OR (bcnt NE 0) OR (fmv_err) THEN ei=2 $
IF (acnt NE 0) OR (bcnt NE 0) OR (gf_err) THEN ei=2 $
ELSE IF ccnt NE 0 THEN ei=1 $
ELSE ei=0
PRINTF,lu,gtcode[ei]
......
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