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

Fixed bug in the estimation of the total number of bkg counts #186

Merged
merged 3 commits into from
Oct 28, 2023
Merged

Fixed bug in the estimation of the total number of bkg counts #186

merged 3 commits into from
Oct 28, 2023

Conversation

paolomassa
Copy link
Collaborator

In the previous version of the code, we didn't keep into account the live time fraction of the science observation when we estimated the total number of bkg counts in an image. Now, this estimation is performed as follows:

  1. The bkg counts recorded by each pixel are divided by the corresponding live time (to make them count rates, their units being count s^-1)
  2. We multiply the duration of the time integration of the science file by the corresponding live time fraction. In this way, we obtain the total number of seconds in which each pixel was taking measurements. We call this time the duration of the actual observation time
  3. The bkg count rates are multiplied by the duration duration of the actual observation time to get an estimate of the total number of bkg counts recorded by each pixel during the observation time interval
  4. We finally sum the total number of bkg counts recorded by all the pixels

@samaloney
Copy link
Collaborator

Look good to me but are the demo files not now downloaded via sock_copy rather than being stored in git repo?

Copy link
Collaborator

@samaloney samaloney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove demo files and download from web server

@paolomassa
Copy link
Collaborator Author

You are right @samaloney, I removed the fits files used in the imaging demo

@samaloney samaloney merged commit 01b4e29 into i4Ds:master Oct 28, 2023
grazwegian added a commit to grazwegian/STIX-GSW that referenced this pull request Oct 30, 2023
* i4ds:
  Initial release of basic routines for downloading L2 AUX ephemeris files given a date and L1 science data fits files given a UID. (i4Ds#189)
  Fixed bug in the estimation of the total number of bkg counts (i4Ds#186)
  stx_livetime_fraction: update of default eta value using empirical high trigger rate data (i4Ds#188)
  Energy calibration improvement (i4Ds#183)
  Call lightcurve without generating FITS files (i4Ds#181)
  Respect shift_duration if file is "possibly summed on board". (i4Ds#180)
  Clarify flare_location coordinates (i4Ds#169)

# Conflicts:
#	stix/dbase/detector/elut_index.csv
grazwegian added a commit to grazwegian/STIX-GSW that referenced this pull request Nov 2, 2023
* i4ds:
  Initial release of basic routines for downloading L2 AUX ephemeris files given a date and L1 science data fits files given a UID. (i4Ds#189)
  Fixed bug in the estimation of the total number of bkg counts (i4Ds#186)
  stx_livetime_fraction: update of default eta value using empirical high trigger rate data (i4Ds#188)
  Energy calibration improvement (i4Ds#183)
  Call lightcurve without generating FITS files (i4Ds#181)
  Respect shift_duration if file is "possibly summed on board". (i4Ds#180)
  Clarify flare_location coordinates (i4Ds#169)

# Conflicts:
#	stix/dbase/detector/elut_index.csv
#	stix/dbase/detector/science_echan_index.csv
#	stix/idl/demo/stx_ospex_spectroscopy_demo.pro
#	stix/idl/processing/spectrogram/stx_convert_pixel_data.pro
#	stix/idl/processing/spectrogram/stx_convert_science_data2ospex.pro
#	stix/idl/processing/spectrogram/stx_convert_spectrogram.pro
#	stix/idl/processing/spectrogram/stx_fsw_sd_spectrogram2ospex.pro
#	stix/idl/processing/spectrogram/stx_science_data_lightcurve.pro
grazwegian added a commit to grazwegian/STIX-GSW that referenced this pull request Nov 22, 2023
* i4ds:
  Initial release of basic routines for downloading L2 AUX ephemeris files given a date and L1 science data fits files given a UID. (i4Ds#189)
  Fixed bug in the estimation of the total number of bkg counts (i4Ds#186)
  stx_livetime_fraction: update of default eta value using empirical high trigger rate data (i4Ds#188)
  Energy calibration improvement (i4Ds#183)
  Call lightcurve without generating FITS files (i4Ds#181)
  Respect shift_duration if file is "possibly summed on board". (i4Ds#180)
  Clarify flare_location coordinates (i4Ds#169)

# Conflicts:
#	stix/dbase/detector/elut_index.csv
grazwegian added a commit to grazwegian/STIX-GSW that referenced this pull request Dec 14, 2023
* i4ds: (28 commits)
  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.
  Update by Massa, P. - use simplified version of the subcollimator transmission for imaging (temporary solution)
  Some Improvement in aspect processing (i4Ds#179)
  Initial release of basic routines for downloading L2 AUX ephemeris files given a date and L1 science data fits files given a UID. (i4Ds#189)
  Fixed bug in the estimation of the total number of bkg counts (i4Ds#186)
  stx_livetime_fraction: update of default eta value using empirical high trigger rate data (i4Ds#188)
  Energy calibration improvement (i4Ds#183)
  Call lightcurve without generating FITS files (i4Ds#181)
  Respect shift_duration if file is "possibly summed on board". (i4Ds#180)
  Clarify flare_location coordinates (i4Ds#169)
  changed default behaviour of flux keyword
  Improvements to transmission following suggestions from @paolomassa. Value of flux = 1 passed through from  stx_fsw_sd_spectrogram2ospex. Additional description of calculation of  linear attenuation coefficient in stx_subc_transmission.
  stx_write_ospex_fits: fix grid factor recording in FITS file for srm file
  stx_write_ospex_fits: fix grid factor recording in FITS file
  stx_subc_transmission:  added default to calculate low energy approximation if no input photon energies are passed
  fix calculation for single included grid
  ...

# Conflicts:
#	stix/idl/processing/spectrogram/stx_convert_pixel_data.pro
#	stix/idl/processing/spectrogram/stx_convert_science_data2ospex.pro
#	stix/idl/processing/spectrogram/stx_convert_spectrogram.pro
#	stix/idl/processing/spectrogram/stx_science_data_lightcurve.pro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants