Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix startup when user doesn't have write permission to SSW #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions stix/idl/processing/spectrogram/stx_check_config_files.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down