Skip to content

Conversation

@jajmitchell
Copy link

Adds livetime correction to get data.

Copy link
Member

@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.

Looks good - needs docs, change log and test/s

Comment on lines 900 to 909

# 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))
Copy link
Member

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

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
@samaloney samaloney added this to the v0.4.0 milestone Nov 25, 2025
@samaloney
Copy link
Member

Add properties for livetime and livefrac or deadfrac

@samaloney samaloney modified the milestones: v0.4.0, v0.3.0 Nov 25, 2025
SRM now functional with wedge grid transmission
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