function igp_test, geopack_2008=geopack_2008
help, /dlm, output = out
version_geopack08 = [9, 0]
filter = strfilter(out, '*GEOPACK*',/index)
if(filter[0] eq -1) then begin
message, /continue, 'Required module IDL/GEOPACK not installed'
message, /continue, 'To install GEOPACK please download a copy'
message, /continue, 'Place the module binary and the .dlm in:'
message, /continue, !DLM_PATH
message, /continue, 'and restart IDL to install the package'
message, /continue, 'more detailed installation instructions'
message, /continue, 'can be found on the GEOPACK DLM web site (http://ampere.jhuapl.edu/code/idl_geopack.html), or'
message, /continue, 'in the SPEDAS software distribution at'
message, /continue, 'external/IDL_GEOPACK/README.txt'
return, 0
endif
geopack_version = stregex(out[filter+1], '([0-9.]+[0-9]?), Build', /extract)
version_num = (strsplit(geopack_version[0], ', ', /extract))[0]
version_num_pieces = strsplit(version_num, '.', /extract)
if version_num_pieces[0] lt version_geopack08[0] || $
(version_num_pieces[0] eq version_geopack08[0] && version_num_pieces[1] lt version_geopack08[1]) then begin
message, /continue, 'Old version of IDL/GEOPACK found'
message, /continue, 'Version 9.0+ expected when using the GEOPACK 2008 keyword'
message,/continue, 'Please download the newest version and'
message, /continue, 'place the binary(.dll,.so,.etc..) and the .dlm in:'
message, /continue, !DLM_PATH
message, /continue, 'then restart IDL to install the package'
message, /continue, 'More detailed installation instructions'
message, /continue, 'can be found on the GEOPACK DLM web site (http://ampere.jhuapl.edu/code/idl_geopack.html), or'
message, /continue, 'in the SPEDAS software distribution at'
message, /continue, 'external/IDL_GEOPACK/README.txt'
return, 0
endif
catch, geopack_dlm_error
if geopack_dlm_error ne 0 then begin
catch, /cancel
help, /last_message, output=err_msg
message, /continue, 'There was a problem loading IDL/GEOPACK. '
message, /continue, 'To install GEOPACK please download a copy'
message, /continue, 'Place the module binary and the .dlm in:'
message, /continue, !DLM_PATH
message, /continue, 'and restart IDL to install the package'
message, /continue, 'more detailed installation instructions'
message, /continue, 'can be found on the GEOPACK DLM web site (http://ampere.jhuapl.edu/code/idl_geopack.html), or'
message, /continue, 'in the SPEDAS software distribution at'
message, /continue, 'external/IDL_GEOPACK/README.txt'
for line_num=0, n_elements(err_msg)-1 do begin
message, /continue, err_msg[line_num]
endfor
return, 0
endif
dlm_load, 'geopack'
return, 1
end