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

Upload New File

parent 48cb058f
No related branches found
No related tags found
No related merge requests found
;---------------------------------------------------------------------------------------------------
;
; name: geoms_harmon.pro
; description: Wrapper for AVDC/EVDC QA tool
;
; 2010-12-23, v0.1 Christian Retscher initial implementation
; 2010-12-21, v0.5 Christian Retscher rename to geoms_qa
; 2011-03-03, v0.6 Christian Retscher dim ordering support
; 2011-03-29, v0.7 Christian Retscher dialog; high level error checks
; 2011-04-26, v0.8 Christian Retscher geoms_tc support added
; 2011-06-07, v1.0 Christian Retscher code refactored; hdf/h5 option added; change in interface
; 2012-03-26, v1.2 Ian Boyd add template checker option to DATAFORMAT, to stop Template
; Checking during post-processing (input needs to carry through to
; geoms_tools.pro call); Add support for netCDF
; 2013-10-23, v1.3 Ian Boyd align version with geoms_tools
; 2013-10-28, v1.31 Ian Boyd align version with geoms_tools
; 2013-11-21, v1.32 Ian Boyd align version with geoms_tools
; 2013-12-06, v1.33 Ian Boyd align version with geoms_tools
; 2014-01-28, v1.34 Ian Boyd align geoms_tools version due to change in geoms_tctools
; 2014-03-11, v1.35 Ian Boyd align version with geoms_tools
; 2014-03-25, v1.36 Ian Boyd update due to modification to idlcr8ascii
; 2014-03-29, v1.37 Ian Boyd update due to modification to idlcr8hdf
; 2014-05-22, v1.38 Ian Boyd update due to modification to idlcr8hdf
; 2014-08-06, v1.39 Ian Boyd update due to modification to idlcr8hdf and geoms_tools
; 2014-09-09, v1.40 Ian Boyd update due to modification to idlcr8hdf and geoms_tools
; 2014-11-10, v1.41 Ian Boyd update due to modification to idlcr8hdf and idlcr8ascii
; 2015-01-27, v1.42 Ian Boyd update due to modification to idlcr8hdf and idlcr8ascii
; 2015-02-17, v1.43 Ian Boyd update due to modification to idlcr8hdf and idlcr8ascii
; 2015-03-02, v1.44 Ian Boyd update due to bug fix in idlcr8hdf
; 2015-04-09, v1.45 Ian Boyd update due to bug fix in idlcr8hdf
; 2015-08-11, v1.46 Ian Boyd update due to bug fixes and improvements in idlcr8hdf
; 2015-09-26, v1.47 Ian Boyd update due to bug fixes and improvements in idlcr8hdf
; 2015-10-21, v1.48 Ian Boyd update due to bug fixes and improvements in idlcr8hdf
; 2015-11-04, v1.49 Ian Boyd update due to fix in idlcr8hdf
; 2015-11-09, v1.50 Ian Boyd update due to bug fixes and improvements in idlcr8hdf and idlcr8ascii
; 2015-11-16, v1.51 Ian Boyd update due to fix in idlcr8hdf
; 2015-12-15, v1.52 Ian Boyd update due to fix in idlcr8hdf
; 2016-02-13, v1.53 Ian Boyd Add extra satellite instruments to the obsolete list for DATA_SOURCE
; in idlcr8hdf. Modifications to idlcr8hdf and idlc8ascii
; 2016-06-14, v1.54 Ian Boyd update due to fix in idlcr8ascii
; 2016-07-25, v1.55 Ian Boyd update due to fix in idlcr8ascii and idlcr8hdf
; 2016-11-16, v1.56 Ian Boyd update due to fix in idlcr8hdf
; 2016-11-30, v1.57 Ian Boyd update due to fix in idlcr8ascii and idlcr8hdf and account for
; non-GEOMS variable attributes (ptr_valid check) in geoms_tctools
; 2016-12-17, v1.58 Ian Boyd update due to fixes in idlcr8ascii
; 2016-12-30, v1.59 Ian Boyd Add FV keyword to geoms_tools (options 20-22 in geoms_harmon call).
; If called then forces the DATA_FILE_VERSION not to increment when
; performing harmonization; Incorporates fixes made to idlcr8hdf
; 2017-03-31, v1.60 Ian Boyd update due to improvements to idlcr8hdf
; 2017-11-21, v1.61 Ian Boyd update due to fixes in idlcr8hdf
; 2018-02-18, v1.62 Ian Boyd update due to fix in idlcr8ascii and idlcr8hdf
; 2018-03-14, v1.63 Ian Boyd update due to fix in idlcr8hdf
; 2018-05-28, v1.64 Ian Boyd update due to fix in idlcr8hdf
; 2018-09-01, v1.65 Ian Boyd update due to fix in idlcr8hdf
; 2018-11-16, v1.66 Ian Boyd update due to fix in idlcr8ascii
;---------------------------------------------------------------------------------------------------
function is_a_number,value
on_ioerror, ConversionError
n=DOUBLE(value)
return,1B
ConversionError:
return, 0B
END
;---------------------------------------------------------------------------------------------------
PRO geoms_harmon
args = command_line_args()
iNrArgs = size(args, /N_ELEMENTS)
if ( iNrArgs lt 4 ) then begin
print
print, 'GEOMS harmonization (geoms_harmon)'
print, ' Release v1.66, 2018-11-16'
print, ' Provides harmonization of old Envisat/Aura HDF files or older versions of GEOMS files'
print, ' into most recent GEOMS compliant files.'
print
print, 'usage: idl -rt=geoms_harmon.sav -args [TAVFILE] [OUTPUTDIR] [DATAFORMAT] [ORIGFILE]'
print
print, '1: TAVFILE is the path of the TAV file, you want to harmonize with'
print, '2: OUTPUTDIR is the path of the output directory of the harmonized file'
print, '3: DATAFORMAT: 0 or 10 or 20: HDF4'
print, ' 1 or 11 or 21: HDF5'
print, ' 2 or 12 or 22: NC'
print, ' (Use 10, 11, 12 to Change log file so that Template Checking will not be performed in'
print, ' post-processing QA/TC checks, otherwise Template Checking will be performed if the'
print, ' template is present. Use 20, 21, 22 to not increment the DATA_FILE_VERSION of ORIGFILE)'
print, '4: ORIGFILE is the path of the original HDF file, you want to harmonize'
print, '------------------------------------------------------------------------------------------------'
print
QA_error_code = 3
exit, status=QA_error_code
end
chFileTAV = STRTRIM(args(0), 2)
chDirOutput = STRTRIM(args(1), 2)
iDataFormat = STRTRIM(args(2), 2)
chFileOrig = STRTRIM(args(3), 2)
print, chDirOutput
print, iDataFormat
print, chFileOrig
QA_error_code = 3
if ( file_test( chFileTAV ) eq 0 ) then begin
QA_error_code = 3
print, 'ERROR: TAV file not found.'
end else begin
QA_error_code = 0
end
if ( file_test( chFileOrig ) eq 0 ) then begin
QA_error_code = 3
print, 'ERROR: HDF file not found.'
end else begin
QA_error_code = 0
end
if ( file_test( chDirOutput ) eq 0 ) then begin
QA_error_code = 3
print, 'ERROR: Output directory not found.'
end else begin
QA_error_code = 0
end
if not ( is_a_number( iDataFormat ) ) then begin
QA_error_code = 3
print, 'ERROR: HDF/netCDF option must be numeric [0|1|2|10|11|12].'
end else begin
if ( iDataFormat lt 0 ) or ( ( iDataFormat gt 2 ) and ( iDataFormat lt 10 ) ) or $
( ( iDataFormat gt 12) and ( iDataFormat lt 20 ) ) or ( iDataFormat gt 22 )then begin
QA_error_code = 3
print, 'ERROR: HDF/netCDF option must have values: [0|1|2|10|11|12|20|21|22].'
end
end
if ( QA_error_code eq 0 ) then begin
case 1 of
iDataFormat eq 0: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'h4' )
iDataFormat eq 1: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'h5' )
iDataFormat eq 2: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'nc' )
iDataFormat eq 10: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'h4', /notc )
iDataFormat eq 11: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'h5', /notc )
iDataFormat eq 12: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'nc', /notc )
iDataFormat EQ 20: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'h4', /fv )
iDataFormat EQ 21: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'h5', /fv )
iDataFormat EQ 22: QA_error_code = geoms_tools( 1, chFileTAV, chFileOrig, chDirOutput, 'nc', /fv )
endcase
end
exit, status=QA_error_code
END
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