From c5278267940e229db840fa575836d6d3fa841c3e Mon Sep 17 00:00:00 2001 From: Shane Maloney Date: Thu, 19 Dec 2024 16:08:19 +0000 Subject: [PATCH] Bugfix startup when user doesn't have write permisssion to SSW --- .../spectrogram/stx_check_config_files.pro | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/stix/idl/processing/spectrogram/stx_check_config_files.pro b/stix/idl/processing/spectrogram/stx_check_config_files.pro index 2eaebb3c..b30e631b 100644 --- a/stix/idl/processing/spectrogram/stx_check_config_files.pro +++ b/stix/idl/processing/spectrogram/stx_check_config_files.pro @@ -88,6 +88,7 @@ end ; ; :history: ; 31-Aug-2023 - ECMD (Graz), initial release +: 19-Dec-2024 - SAM (DIAS), fail gracefully if localfile doesn't exist ; ;- pro stx_update_det_config_files, url_root = url_root, name_idx = name_idx, filter = filter, directory = directory, verbose = verbose @@ -96,23 +97,24 @@ pro stx_update_det_config_files, url_root = url_root, name_idx = name_idx, filt sock_copy, url_idx, out_dir = directory, local_file = local_file, /clobber, verbose = verbose - str_index = read_csv(local_file, n_table_header = 1) - elut_filenames = (str_index.field4) - - files_present = find_file(concat_dir(directory, filter), count = count) - filenames_present = file_break(files_present, /name) - - for i = 0, n_elements(elut_filenames)-1 do begin - check = where(elut_filenames[i] eq filenames_present, count_found) - if count_found eq 0 then begin - url = url_root + elut_filenames[i] - sock_copy, url, out_dir = directory, verbose = verbose - endif - - endfor + if local_file ne '' then begin; + str_index = read_csv(local_file, n_table_header = 1) + elut_filenames = (str_index.field4) + files_present = find_file(concat_dir(directory, filter), count = count) + filenames_present = file_break(files_present, /name) + for i = 0, n_elements(elut_filenames)-1 do begin + check = where(elut_filenames[i] eq filenames_present, count_found) + if count_found eq 0 then begin + url = url_root + elut_filenames[i] + sock_copy, url, out_dir = directory, verbose = verbose + endif + endfor + endif else begin + message, 'Warning congiguration file '+name_idx +' not found.', /continue + endelse end