pro spinmodel_reset_single,probe=probe
common spinmodel_common,tha_std_obj, thb_std_obj, thc_std_obj,$
thd_std_obj, the_std_obj, thf_std_obj,$
tha_ecl_obj, thb_ecl_obj, thc_ecl_obj,$
thd_ecl_obj, the_ecl_obj, thf_ecl_obj
case probe of
'a': BEGIN
if obj_valid(tha_std_obj) then begin
obj_destroy,tha_std_obj
tha_std_obj = obj_new()
endif
if obj_valid(tha_ecl_obj) then begin
obj_destroy,tha_ecl_obj
tha_ecl_obj = obj_new()
endif
END
'b': BEGIN
if obj_valid(thb_std_obj) then begin
obj_destroy,thb_std_obj
thb_std_obj = obj_new()
endif
if obj_valid(thb_ecl_obj) then begin
obj_destroy,thb_ecl_obj
thb_ecl_obj = obj_new()
endif
END
'c': BEGIN
if obj_valid(thc_std_obj) then begin
obj_destroy,thc_std_obj
thc_std_obj = obj_new()
endif
if obj_valid(thc_ecl_obj) then begin
obj_destroy,thc_ecl_obj
thc_ecl_obj = obj_new()
endif
END
'd': BEGIN
if obj_valid(thd_std_obj) then begin
obj_destroy,thd_std_obj
thd_std_obj = obj_new()
endif
if obj_valid(thd_ecl_obj) then begin
obj_destroy,thd_ecl_obj
thd_ecl_obj = obj_new()
endif
END
'e': BEGIN
if obj_valid(the_std_obj) then begin
obj_destroy,the_std_obj
the_std_obj = obj_new()
endif
if obj_valid(the_ecl_obj) then begin
obj_destroy,the_ecl_obj
the_ecl_obj = obj_new()
endif
END
'f': BEGIN
if obj_valid(thf_std_obj) then begin
obj_destroy,thf_std_obj
thf_std_obj = obj_new()
endif
if obj_valid(thf_ecl_obj) then begin
obj_destroy,thf_ecl_obj
thf_ecl_obj = obj_new()
endif
END
else: message,'Unrecognized probe identifier: '+probe
endcase
end
pro spinmodel_reset,probe=probe
if (n_elements(probe) EQ 0) then begin
message,'Required PROBE keyword not passed.'
endif
if (size(probe,/n_dim) EQ 0) then begin
probe_arr = strsplit(strlowcase(probe),' ',/extract)
endif else begin
probe_arr = strlowcase(probe)
endelse
result=WHERE(strmatch(probe_arr,'all'),all_count)
result=WHERE(strmatch(probe_arr,'\*'),star_count)
if ((all_count GE 1) or (star_count GE 1)) then begin
dprint,'Resetting spin models for all probes.'
spinmodel_reset_single,probe='a'
spinmodel_reset_single,probe='b'
spinmodel_reset_single,probe='c'
spinmodel_reset_single,probe='d'
spinmodel_reset_single,probe='e'
spinmodel_reset_single,probe='f'
endif else begin
for i=0,n_elements(probe_arr)-1 do begin
dprint,'Resetting spin model for probe '+probe_arr[i]
spinmodel_reset_single,probe=probe_arr[i]
endfor
endelse
end