Skip to content

Commit

Permalink
Merge branch 'default' into experimental
Browse files Browse the repository at this point in the history
* default:
  Bugfix release
  stx_read_fits : uncommented call to mrdfits to prevent compilation issue when getting version number
  preparing a new release
  Fixed bug in selection of energy indices of pixel data matrix (i4Ds#185)
  stx_subc_transmission: Improved accuracy of message displayed if simple_transm keyword is set.

# Conflicts:
#	stix/idl/io/stx_read_fits.pro
#	stix/idl/processing/spectrogram/stx_fsw_sd_spectrogram2ospex.pro
  • Loading branch information
grazwegian committed Nov 22, 2023
2 parents cf16696 + 3e4169a commit abd1094
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion stix/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.0
v0.5.1
2 changes: 1 addition & 1 deletion stix/idl/io/stx_read_fits.pro
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function stx_read_fits, fits_path, extension, header, silent = silent, mversion_
default, silent, 1

if ~keyword_set(mversion_full) then begin
ver = mrdfits(/version, /silent) ; commented out (FSc, 2023-09-26) since not used anywhere
ver = mrdfits(/version, /silent) ; uncommented to prevent mrdfits compilation issue (ECMD, 2023-11-07)
mversion_full = stx_get_mrd_version()
mversion = mversion_full.split('\.')
if ~(fix(mversion[0]) ge 2 and fix(mversion[1]) ge 27) and ~silent then begin
Expand Down
2 changes: 2 additions & 0 deletions stix/idl/io/stx_read_pixel_data_fits_file.pro
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
; 21-Feb-2023 - FSc (AIP), fix for more changes in L1 files (energy_bin_edge_mask vs. energy_bin_mask)
; 15-Mar-2023 - ECMD (Graz), updated to handle release version of L1 FITS files
; 27-Mar-2023 - ECMD (Graz), added check for duration shift already applied in FITS file
; 11-Oct-2023 - Paolo (WKU), 'energy_bin_mask' is returned in the data structure
;
;-
pro stx_read_pixel_data_fits_file, fits_path, time_shift, alpha = alpha, primary_header = primary_header, data_str = data, data_header = data_header, control_str = control, $
Expand Down Expand Up @@ -251,6 +252,7 @@ pro stx_read_pixel_data_fits_file, fits_path, time_shift, alpha = alpha, primary
control_index:control_index,$
pixel_masks:data.pixel_masks,$
detector_masks:data.detector_masks,$
energy_bin_mask: energy_bin_mask,$
num_pixel_sets:data.num_pixel_sets,$
num_energy_groups:data.num_energy_groups }

Expand Down
43 changes: 25 additions & 18 deletions stix/idl/processing/pixel_data/stx_plot_selected_time_range.pro
Original file line number Diff line number Diff line change
Expand Up @@ -44,39 +44,46 @@
;
;
; HISTORY: September 2022, Massa P., created
; October 2023, Massa P., fixed bug in the selection of the energy bin indices
;
; CONTACT:
; [email protected]
;-

pro stx_plot_selected_time_range, tim_axis, energy_ind, time_ind, counts, live_time_bins, subc_index, sumcase, energy_range, $
time_range, counts_bkg=counts_bkg, live_time_bkg=live_time_bkg
time_range, counts_bkg=counts_bkg, live_time_bkg=live_time_bkg, energy_ind_bkg=energy_ind_bkg

; re-initialise UTBASE to handle UTC times properly when calling utplot
common utcommon
utbase = 0

;;********** Exclude first and last energy bin
; re-initialise UTBASE to handle UTC times properly when calling utplot
common utcommon
utbase = 0

lightcurve = counts[1:30,*,*,*]

if keyword_set(counts_bkg) then bkg_level = counts_bkg[1:30,*,*]

;;********** Sum in energy
;;********** Create lightcurve

if n_elements(energy_ind) eq 1 then begin

lightcurve = reform(lightcurve[energy_ind,*,*,*])
if keyword_set(counts_bkg) then bkg_level = reform(bkg_level[energy_ind,*,*])


endif else begin

lightcurve = total(lightcurve[energy_ind,*,*,*],1)
if keyword_set(counts_bkg) then bkg_level = total(bkg_level[energy_ind,*,*],1)
lightcurve = reform(counts[energy_ind,*,*,*])

endif else begin

lightcurve = total(counts[energy_ind,*,*,*],1)

endelse

if keyword_set(counts_bkg) then begin

if n_elements(energy_ind_bkg) eq 1 then begin

bkg_level = reform(counts_bkg[energy_ind_bkg,*,*])

endif else begin

bkg_level = total(counts_bkg[energy_ind_bkg,*,*],1)

endelse

endif

;;********** Sum counts of selected imaging detectors

;; Compute incident area
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ function stx_fsw_sd_spectrogram2ospex, spectrogram, specpar = specpar, time_shif
grid_transmission_file = concat_dir(getenv('STX_GRID'), 'nom_grid_transmission.txt')
readcol, grid_transmission_file, grid_factors_file, format = 'f', skip = 2


if (keyword_set(gtrans32) and n_elements(flare_location_stx) ne 0) then begin
grid_factors_proc = stx_subc_transmission(flare_location_stx, ph_in, /flux )
if (keyword_set(gtrans32) and n_elements(flare_location_stx) ne 0) then begin
grid_factors_proc = stx_subc_transmission(flare_location_stx, ph_in, /flux)

nph = n_elements(ph_in)
ngrids = n_elements(grids_used)


;05-Oct-2022 - ECMD until fine grid tranmission is ready replace the
;grids not in TOP24 with the on-axis tabulated values
idx_nontop24 = stx_label2det_ind('bkg+cfl+fine')
Expand Down

0 comments on commit abd1094

Please sign in to comment.