opticks.imaging_model.detector
Classes
|
Reference to an external absorption coefficient data file. |
|
Create a new model by parsing and validating input data from keyword arguments. |
|
Class containing generic Detector parameters. |
|
Detector type enumeration. |
|
Noise parameters for a Detector. |
|
Image sensor physical parameters (diffusion MTF, CTE, crosstalk). |
|
Timing parameters for a Detector. |
- class AbsorptionData(**data)[source]
Reference to an external absorption coefficient data file.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- class Channel(**data)[source]
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
name (str)
binning (int)
tdi_stages (int)
cuton_wvl (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=~opticks.utils.parser_helpers._validate_positive_quantity), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)])
cutoff_wvl (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=~opticks.utils.parser_helpers._validate_positive_quantity), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)])
is_binned (bool)
frame_duration (Quantity | None)
frame_rate (Quantity | None)
integration_duration (Quantity | None)
max_integration_duration (Quantity | None)
total_tdi_col_duration (Quantity | None)
- property bandwidth: Quantity
Computes the bandwidth of the channel (the difference between the cut-off and cut-on wavelengths).
- Returns:
Quantity– Bandwidth of the channel (in wavelengths)
- property centre_wavelength: Quantity
Computes the centre wavelength of the channel.
- Returns:
Quantity– Centre wavelength of the channel
- cutoff_wvl: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=_validate_positive_quantity), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)]
- cuton_wvl: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=_validate_positive_quantity), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)]
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Return type:
- Parameters:
self (BaseModel) – The BaseModel instance.
context (Any) – The context.
- nyquist_freq(with_binning=True)[source]
Returns Nyquist Frequency / Limit parameter with or without binning.
Nyquist frequency is defined as: 1 / (2 x pix pitch), which translates to one line pair per two pixels (e.g., one pixel white, next one black). This is the absolute maximum limiting resolution of the sensor.
- pix_read_rate(frame_rate, with_binning=True, with_tdi=False, with_read_blocks=True)[source]
Pixel read rate.
- Return type:
- Parameters:
- Computed as:
Pushbroom type: horiz pix (binned) x TDI stages x read blocks x line rate
Full frame type: horiz pix (binned) x vert pix (binned) x frame rate
- Parameters:
- Returns:
Quantity– Pixel read rate with or without binning (Mpixel/s)- Return type:
- pixel_area(with_binning=True)[source]
Pixel geometric area.
Computed as the square of pixel pitch. The effective pixel area is smaller, even for a pixel with a single sensing element.
- pixel_count_frame(with_binning=True)[source]
Computes the total number of pixels in the channel with/without binning.
- pixel_count_line(with_binning=True)[source]
Computes the total number of pixels in the detector line with/without binning.
- class Detector(**data)[source]
Class containing generic Detector parameters.
A Detector has one or more Channel objects.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
name (str)
detector_type (DetectorType)
pixel_pitch (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=~opticks.utils.parser_helpers._validate_positive_quantity), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)])
full_well_capacity (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
noise (Noise | None)
timings (Timings)
sensor_params (SensorParams | None)
- detector_type: DetectorType
- full_well_capacity: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)] | None
- get_crosstalk_mtf_1d(channel_id, with_binning=True)[source]
Generate crosstalk MTF model for this detector.
Uses the crosstalk coefficients from
sensor_paramsand the pixel pitch for the given channel.- Return type:
- Parameters:
- Returns:
MTF_Model_1D– Crosstalk MTF model.- Raises:
ValueError – If
sensor_paramsorcrosstalk_xsis not configured.
- get_cte_mtf_1d(num_pixels, channel_id, with_binning=True, tdi_stages=None)[source]
Generate CTE MTF model for this detector.
Uses
cte_num_phasesandcte_valuefromsensor_paramsand the pixel pitch for the given channel.num_pixelsis a required runtime argument: the number of pixel shifts from the target pixel to the readout register, which is both position-dependent and direction-dependent.cte_tdi_stagesfromsensor_paramsis used unless overridden by the tdi_stages argument (passtdi_stages=0for the ACT direction on a TDI sensor without modifyingsensor_params).- Return type:
- Parameters:
num_pixels (
int) – Number of pixels between the target pixel and the readout register.channel_id (
str) – Channel identifier.with_binning (
bool, optional) – IfTrue(default), use the channel’s effective pitch accounting for binning. IfFalse, use the native pixel pitch.tdi_stages (
int, optional) – Override for the number of on-chip analog TDI stages. IfNone, falls back tosensor_params.cte_tdi_stages(or 0 if unset).
- Returns:
MTF_Model_1D– CTE MTF model.- Raises:
ValueError – If
sensor_params,cte_num_phases, orcte_valueis not configured.
- get_det_sampling_mtf_1d(channel_id, with_binning=True)[source]
Generate detector sampling MTF model for this detector.
The sampling MTF is a sinc function of the effective pixel pitch for the given channel.
- Return type:
- Parameters:
- Returns:
MTF_Model_1D– Detector sampling MTF model.
- get_diffusion_mtf_1d(wavelength)[source]
Generate diffusion MTF model for this detector at the given wavelength.
The diffusion MTF is isotropic (same in ALT and ACT directions).
Looks up the absorption coefficient from the sensor_params absorption table, then delegates to
MTF_Model_1D.detector_diffusion()orMTF_Model_1D.detector_diffusion_preset().- Return type:
- Parameters:
wavelength (
Quantity) – Wavelength at which to compute the diffusion MTF.- Returns:
MTF_Model_1D– Diffusion MTF model.- Raises:
ValueError – If
sensor_paramsorabsorption_datais not configured.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(_Detector__context)[source]
Initialises derived parameters after Pydantic validation.
Overrides the abstract pydantic method to perform additional initialization after __init__ and model_construct.
- pix_read_rate(band_id, with_binning=True, with_tdi=True, with_read_blocks=True)[source]
Pixel read rate.
- Return type:
- Parameters:
- Computed as:
Pushbroom type: horiz pix (binned) x TDI stages x read blocks x line rate
Full frame type: horiz pix (binned) x vert pix (binned) x frame rate
If a list of channels is given, then the returned result is the sum of all the requested channels.
- Parameters:
- Returns:
Quantity– Pixel read rate with or without binning (Mpixels)- Return type:
- property pixel_count: Quantity
Computes the total number of pixels in the detector.
- Returns:
Quantity– Total number of pixels for the requested configuration (in Mpixels)
- pixel_pitch: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=_validate_positive_quantity), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)]
- sensor_params: SensorParams | None
- class DetectorType(*values)[source]
Detector type enumeration.
- FULL_FRAME = 'full frame'
- PUSHBROOM = 'pushbroom'
- class Noise(**data)[source]
Noise parameters for a Detector.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
dark_current (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
temporal_dark_noise (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
- dark_current: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)] | None
- class SensorParams(**data)[source]
Image sensor physical parameters (diffusion MTF, CTE, crosstalk).
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
diffusion_model (str | None)
diffusion_preset (str | None)
diffusion_length (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=~opticks.utils.parser_helpers._validate_positive_quantity), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
field_free_depth (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=~opticks.utils.parser_helpers._validate_positive_quantity), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
depletion_depth (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=~opticks.utils.parser_helpers._validate_positive_quantity), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
surface_recomb_velocity (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
diffusion_coeff (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
crosstalk_xs (float | None)
crosstalk_xd (float | None)
cte_num_phases (int | None)
cte_value (float | None)
cte_tdi_stages (int | None)
absorption_data (AbsorptionData | None)
- absorption_data: AbsorptionData | None
- depletion_depth: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=_validate_positive_quantity), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)] | None
- diffusion_coeff: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)] | None
- diffusion_length: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=_validate_positive_quantity), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)] | None
- field_free_depth: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), AfterValidator(func=_validate_positive_quantity), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)] | None
- get_absorption_coeff(wavelength)[source]
Return the absorption coefficient at the given wavelength.
- Return type:
- Parameters:
wavelength (
Quantity) – Wavelength at which to interpolate α.- Returns:
Quantity– Absorption coefficient with units from the data file.
- load_absorption_data()[source]
Load absorption coefficient data from the external file.
Resolves the file path relative to the current working directory. The file is self-describing: comment lines start with
#, the first non-comment line is the header declaring column names and units (e.g.wavelength (nm) alpha (1/um)), and subsequent lines are data rows.- Return type:
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- class Timings(**data)[source]
Timing parameters for a Detector.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
frame_rate (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)] | None)
integration_duration (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)])
frame_overhead_duration (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)])
frame_overlap_duration (Annotated[Quantity, BeforeValidator(func=~opticks.utils.parser_helpers._parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=~opticks.utils.parser_helpers._serialize_quantity, return_type=str, when_used=always)])
frame_duration (Quantity | None)
- frame_overhead_duration: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)]
- frame_overlap_duration: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)]
- frame_rate: Annotated[Quantity, BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined), PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)] | None