-
Notifications
You must be signed in to change notification settings - Fork 24
Adds livetime correction to get data #192
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
base: main
Are you sure you want to change the base?
Adds livetime correction to get data #192
Conversation
Adds livetime correction to get_data
Adds detector and time masks
samaloney
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - needs docs, change log and test/s
stixpy/product/sources/science.py
Outdated
|
|
||
| # fmt: off | ||
| # For the moment copied from idl | ||
| trigger_to_detector = [0, 0, 7, 7, 2, 1, 1, 6, 6, 5, 2, 3, 3, 4, 4, 5, 13, 12, | ||
| 12, 11, 11, 10, 13, 14, 14, 9, 9, 10, 15, 15, 8, 8,] | ||
| # fmt: on | ||
|
|
||
| triggers = self.data["triggers"][:, trigger_to_detector].astype(float)[...] | ||
|
|
||
| _, livefrac, _ = get_livetime_fraction(triggers / self.data["timedel"].to("s").reshape(-1, 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is now in the instrument configuration namespace
stixpy/stixpy/config/instrument.py
Lines 78 to 92 in fb3004c
| STIX_INSTRUMENT = SimpleNamespace( | |
| __doc__="""This namespace contains the instrument name, visibility information, sub-collimator ADC mapping, sub-collimator parameters, and pixel configuration. | |
| The visibility information is obtained from the _get_uv_points_data function, | |
| the sub-collimator ADC mapping is read from the detector ADC mapping file, | |
| the sub-collimator parameters are read from the sub-collimator parameters file, | |
| and the pixel configuration is read from the pixel parameters file. | |
| The namespace is used to encapsulate all the configuration data related to the STIX instrument. | |
| This allows for easy access and management of the instrument's configuration data.""", | |
| name="STIX", | |
| vis_info=_get_uv_points_data(), | |
| subcol_adc_mapping=np.array(read_det_adc_mapping()["Adc #"]), | |
| subcol_params=_SUBCOL_PARAMS, | |
| pixel_config=read_pixel_params(), | |
| ) |
Implements corrections and get_spectrum function
get_spectrum and bkg_subtract now work
|
Add properties for |
SRM now functional with wedge grid transmission
Adds livetime correction to get data.