Camera Handle¶
- class huira.swir8.CameraModelHandle¶
- __init__(*args, **kwargs)¶
- add_filter(*args, **kwargs)¶
Overloaded function.
add_filter(self: huira._huira.swir8.CameraModelHandle, name: str, transmission: float, flat: Optional[huira._huira.Image_f32] = None) -> int
Add a filter to the camera’s filter wheel, and select it if it is the first; returns its index. transmission is the fraction of the light it passes, from 0 to 1: one number for every bin, or a SpectralBins (or a list or array, one value per bin). flat is the filter’s flat, an Image_f32 of each pixel’s response through it relative to the principal point’s (flat_from_flat_field() makes one from a flat field), or None for 1 everywhere. The selected filter’s transmission multiplies the sensor’s quantum efficiency, and its flat each pixel’s signal electrons; the flat is one of the sensor’s imperfections (enable_sensor_imperfections()). A camera whose wheel is empty has a clear filter and no flat. The name must be unused by the wheel’s other filters.
add_filter(self: huira._huira.swir8.CameraModelHandle, name: str, transmission: huira._huira.swir8.SpectralBins, flat: Optional[huira._huira.Image_f32] = None) -> int
As above, with the transmission per bin.
- aperture_diameter(self: huira._huira.swir8.CameraModelHandle) huira._huira.Millimeter¶
- auto_precompute_enabled(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether a render builds an out-of-date camera itself. See enable_auto_precompute().
- cast_ray(self: huira._huira.swir8.CameraModelHandle, x: float, y: float) huira._huira.swir8.Ray¶
Cast a pinhole camera ray, in camera coordinates, through position (x, y) on the image, in the camera’s pixel convention. The position may be outside the image. Raises where the lens distortion has no inverse; see try_cast_ray().
- clear_filters(self: huira._huira.swir8.CameraModelHandle) None¶
Empty the filter wheel: the camera then has a clear filter, with no flat.
- clear_psf(self: huira._huira.swir8.CameraModelHandle) None¶
Remove a PSF set with set_measured_psf(): sources are drawn with the aperture’s diffraction pattern again, or without one if it is off.
- clear_sensor_bias_map(self: huira._huira.swir8.CameraModelHandle) None¶
Clear the sensor’s bias map, so that every pixel has the bias level again.
- clear_sensor_dark_current_map(self: huira._huira.swir8.CameraModelHandle) None¶
Clear the sensor’s dark current map, so that every pixel has the dark current again.
- configure_sensor_from_pitch(self: huira._huira.swir8.CameraModelHandle, resolution: tuple[int, int], pitch_x: object, pitch_y: object = None, cx: float | None = None, cy: float | None = None) None¶
Configure sensor using a resolution tuple (width, height) and pixel pitch. pitch_y defaults to pitch_x (square pixels). cx/cy are in the camera’s pixel convention (see set_pixel_convention) and default to the center of the sensor.
- configure_sensor_from_size(self: huira._huira.swir8.CameraModelHandle, resolution: tuple[int, int], width: object, height: object = None, cx: float | None = None, cy: float | None = None) None¶
Configure sensor using a resolution tuple (width, height) and physical size. height defaults to maintaining square pixels. cx/cy are in the camera’s pixel convention (see set_pixel_convention) and default to the center of the sensor.
- defocus_blur_radius(self: huira._huira.swir8.CameraModelHandle, range: object = None) float¶
Radius in pixel widths of the defocus blur of a point at ‘range’ along the camera’s axis (any length unit), or of a star (None), as unresolved sources are drawn with it: 0 when it would change no pixel by more than a part in 10^5, and with depth of field off.
- defocus_image(self: huira._huira.swir8.CameraModelHandle, radius: int, x_offset: float = 0.0, y_offset: float = 0.0, range: object = None) huira._huira.swir8.Image¶
The defocus blur alone of a point at ‘range’ (any length unit; None for a star), in each pixel as psf_image() gives it: a uniform disc of radius defocus_blur_radius(range), or in focus the pixel the point falls in.
- delete_distortion(self: huira._huira.swir8.CameraModelHandle) None¶
- depth_of_field_enabled(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether depth of field is on (the default).
- describe(self: huira._huira.swir8.CameraModelHandle) str¶
A summary of the camera’s settings, one per line, for reading (print(camera) shows it too). The format may change.
- diffraction_enabled(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether the aperture’s diffraction pattern is on (the default).
- diffraction_image(self: huira._huira.swir8.CameraModelHandle, radius: int, x_offset: float = 0.0, y_offset: float = 0.0) huira._huira.swir8.Image¶
The aperture’s diffraction pattern alone, in focus, in each pixel as psf_image() gives it, whether or not it is in use.
- disable_scatter(self: huira._huira.swir8.CameraModelHandle) None¶
Turn scattered light off (the default).
- disable_veiling_glare(self: huira._huira.swir8.CameraModelHandle) None¶
- enable_auto_precompute(self: huira._huira.swir8.CameraModelHandle, auto_precompute: bool = True) None¶
Choose what a render does when the camera is out of date: build what it needs and log the time taken (True, the default), or raise (False), which guarantees that no render includes that time.
- enable_depth_of_field(self: huira._huira.swir8.CameraModelHandle, depth_of_field: bool = True) None¶
Turn depth of field on (the default) or off. On, the camera has the focus set (at infinity unless set): resolved bodies are traced with rays from across the aperture, which blurs whatever is out of focus, and unresolved sources are blurred by the defocus at their depth. Off, everything is in focus, as through a pinhole. Out-of-focus bodies need more samples per pixel to look clean.
- enable_diffraction(self: huira._huira.swir8.CameraModelHandle, diffraction: bool = True) None¶
Turn the aperture’s diffraction pattern on (the default) or off. On, unresolved sources are drawn with it, averaged over each spectral bin, and resolved bodies are convolved with it; off, a source in focus puts that light in the pixel it falls in. Scattered light and defocus are added either way. A PSF set with set_measured_psf() takes its place while set; clear_psf() goes back to it.
- enable_motion_blur(self: huira._huira.swir8.CameraModelHandle, motion_blur: bool = True) None¶
Turn motion blur on (the default) or off. On, a SceneView through the camera shows what moves during the exposure blurred along its path, with as many temporal samples as its motion needs, or the number it is given. Off, it renders a still frame, at the middle of the exposure, whatever number it is given.
- enable_psf_convolution(self: huira._huira.swir8.CameraModelHandle, convolve_psf: bool = True) None¶
Choose whether the PSF and scattered light blur resolved bodies (the path-traced image). On by default. Off, bodies are sharp, and rendering is faster without the whole-image convolution; unresolved sources, such as stars, get the PSF and scattered light either way. Bodies get the whole PSF, across the frame, in focus: path tracing gives them their defocus.
- enable_sensor_imperfections(self: huira._huira.swir8.CameraModelHandle, imperfections: bool = True) None¶
Turn the sensor’s imperfections on (the default) or off: what is the same in every frame and a calibration would remove, the dark current (single value, map and hot pixels), PRNU, the selected filter’s flat, and the bias map. Off, each pixel’s gain is 1 and the bias is the bias level; the settings are kept. Independent of enable_sensor_noise(): with both off the sensor is ideal, and with only imperfections off its frames are as from a calibrated camera.
- enable_sensor_noise(self: huira._huira.swir8.CameraModelHandle, noise: bool = True) None¶
Turn the sensor’s noise on (the default) or off: shot noise, read noise, and row and column noise. Off, each pixel collects the expected number of electrons. Independent of enable_sensor_imperfections().
- filter_count(self: huira._huira.swir8.CameraModelHandle) int¶
The number of filters in the filter wheel; 0 without one.
- filter_flat(*args, **kwargs)¶
Overloaded function.
filter_flat(self: huira._huira.swir8.CameraModelHandle, index: int) -> Optional[huira._huira.Image_f32]
The flat of the filter at an index, as an Image_f32, or None if it has none.
filter_flat(self: huira._huira.swir8.CameraModelHandle, name: str) -> Optional[huira._huira.Image_f32]
The flat of the filter with a name, as an Image_f32, or None if it has none.
- filter_index(self: huira._huira.swir8.CameraModelHandle, name: str) int¶
The index of the filter with a name.
- filter_name(self: huira._huira.swir8.CameraModelHandle, index: int) str¶
The name of the filter at an index.
- filter_transmission(*args, **kwargs)¶
Overloaded function.
filter_transmission(self: huira._huira.swir8.CameraModelHandle, index: int) -> huira._huira.swir8.SpectralBins
The transmission, per bin, of the filter at an index.
filter_transmission(self: huira._huira.swir8.CameraModelHandle, name: str) -> huira._huira.swir8.SpectralBins
The transmission, per bin, of the filter with a name.
- flat_from_flat_field(self: huira._huira.swir8.CameraModelHandle, flat_field: huira._huira.Image_f32, central_fraction: float = 0.05000000074505806) huira._huira.Image_f32¶
A filter’s flat from a flat field taken through it (an Image_f32 at the sensor’s resolution, bias and dark subtracted, in any scale): each pixel’s response relative to the principal point’s, with the falloff the renderer gives each pixel (its solid angle and cosine) divided out, so that it keeps what the renderer doesn’t model: further vignetting, the filter’s unevenness, dust and PRNU. It is normalized to the median of a square around the principal point, central_fraction of the shorter side on each edge (5% by default, at least 8 pixels), so a speck of dust there doesn’t set the scale; the quantum efficiency and transmission are then the response at the principal point, and pixels that respond more are above 1. The camera’s focal length, distortion and principal point must be as when the flat field was taken. For add_filter() or set_filter_flat().
- focal_length(self: huira._huira.swir8.CameraModelHandle) huira._huira.Millimeter¶
- focus_diopters(self: huira._huira.swir8.CameraModelHandle) huira._huira.Diopter¶
Focus in diopters: the reciprocal of focus_distance(), 0 at infinity.
- focus_distance(self: huira._huira.swir8.CameraModelHandle) huira._huira.Meter¶
Distance the camera is focused at: negative past infinity, inf at infinity.
- focus_sensor_offset(self: huira._huira.swir8.CameraModelHandle) huira._huira.Micrometer¶
Focus as the sensor’s offset from the infinity-focus position.
- fstop(self: huira._huira.swir8.CameraModelHandle) float¶
The f-number: focal length / aperture diameter.
- has_sensor_bias_map(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether the sensor has a bias map. See set_sensor_bias_map().
- has_sensor_dark_current_map(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether the sensor has a dark current map. See set_sensor_dark_current_map().
- has_set_psf(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether a PSF was set in place of the aperture’s diffraction pattern.
- in_fov(self: huira._huira.swir8.CameraModelHandle, point: object) bool¶
Whether a point in camera coordinates (a huira.Vec3 or three numbers) is in the field of view.
- intrinsic_matrix(self: huira._huira.swir8.CameraModelHandle) huira._huira.Mat3¶
The camera matrix [[fx, s, cx], [0, fy, cy], [0, 0, 1]] as a huira.Mat3, as set_intrinsic_matrix() takes it: in pixels, with the principal point in the camera’s pixel convention (see set_pixel_convention). It works with numpy as the 3x3 array, row by row: np.asarray(K), K[0, 2].
- is_precomputed(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether everything the next render needs from the camera is built and up to date.
- make_frame_buffer(self: huira._huira.swir8.CameraModelHandle) huira._huira.swir8.FrameBuffer¶
- motion_blur_enabled(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether motion blur is on (the default).
- pixel_convention(self: huira._huira.swir8.CameraModelHandle) huira._huira.PixelConvention¶
The pixel coordinate convention for the principal point and projected positions.
- pixel_pitch(self: huira._huira.swir8.CameraModelHandle) tuple¶
The pixel pitch, as a tuple (along x, along y) of Micrometer.
- pixel_radiance_to_power(self: huira._huira.swir8.CameraModelHandle, x: int, y: int) float¶
The power pixel (x, y) (column, row from the top) receives per unit of radiance, in m^2 sr: its solid angle times the aperture area projected along the direction to its center. This is the falloff the renderer gives each pixel, which flat_from_flat_field() divides out of a flat field.
- precompute(self: huira._huira.swir8.CameraModelHandle) None¶
Build everything the camera needs for the next render now (the tables of its geometry, the PSF’s tables or grid, and the convolution of resolved bodies), so that the time is not spent in the render. Only what is out of date is rebuilt.
- project_point(self: huira._huira.swir8.CameraModelHandle, point: object) tuple¶
Project a point in camera coordinates (meters; a huira.Vec3 or three numbers) onto the image, as a tuple (x, y) in the camera’s pixel convention.
- psf_convolution_enabled(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether the PSF and scattered light blur resolved bodies (the default). See enable_psf_convolution().
- psf_image(self: huira._huira.swir8.CameraModelHandle, radius: int, x_offset: float = 0.0, y_offset: float = 0.0, range: object = None) huira._huira.swir8.Image¶
The light an unresolved source puts in each pixel around it, per channel, as the renderer draws it: the aperture’s diffraction pattern (or a PSF set in its place), with scattered light, blurred by defocus for a source at ‘range’ along the camera’s axis (any length unit; None for a star), and integrated over each pixel, for the source (x_offset, y_offset) pixels from the center pixel’s center. The image is 2 radius + 1 pixels square. Resolved bodies are convolved with it in focus.
- resolution(self: huira._huira.swir8.CameraModelHandle) tuple¶
The sensor’s resolution, as a tuple (width, height).
- scatter_enabled(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether scattered light is on.
- scatter_image(self: huira._huira.swir8.CameraModelHandle, radius: int, x_offset: float = 0.0, y_offset: float = 0.0) huira._huira.swir8.Image¶
The scattered light alone, in focus, in each pixel as psf_image() gives it, holding all of the light rather than its fraction. Raises without scattered light.
- select_filter(*args, **kwargs)¶
Overloaded function.
select_filter(self: huira._huira.swir8.CameraModelHandle, index: int) -> None
Select a filter of the filter wheel by index, in the order added. A frame buffer is read out through the filter selected when it is rendered.
select_filter(self: huira._huira.swir8.CameraModelHandle, name: str) -> None
Select a filter of the filter wheel by name.
- selected_filter_index(self: huira._huira.swir8.CameraModelHandle) int | None¶
The index of the selected filter, or None if the wheel is empty.
- selected_filter_name(self: huira._huira.swir8.CameraModelHandle) str | None¶
The name of the selected filter, or None if the wheel is empty.
- sensor_bias_level(self: huira._huira.swir8.CameraModelHandle) float¶
The sensor’s bias level, in digital numbers.
- sensor_bias_map(self: huira._huira.swir8.CameraModelHandle) huira._huira.Image_f32¶
The bias of each pixel, in DN, as an Image_f32: an absolute bias map, a relative one added to the bias level, or the bias level everywhere if none is set.
- sensor_bias_map_kind(self: huira._huira.swir8.CameraModelHandle) huira._huira.BiasMapKind¶
What the values of the sensor’s bias map are (BiasMapKind.Absolute if none is set).
- sensor_bit_depth(self: huira._huira.swir8.CameraModelHandle) int¶
The sensor’s bit depth.
- sensor_column_noise(self: huira._huira.swir8.CameraModelHandle) float¶
The sensor’s column noise, in e- RMS. See set_sensor_column_noise().
- sensor_conversion_gain(self: huira._huira.swir8.CameraModelHandle) float¶
The sensor’s conversion gain, in electrons per digital number.
- sensor_dark_current(self: huira._huira.swir8.CameraModelHandle) float¶
The sensor’s dark current, in electrons per second.
- sensor_dark_current_map(self: huira._huira.swir8.CameraModelHandle) huira._huira.Image_f32¶
The dark current of each pixel, in e-/s, as an Image_f32: the dark current map, or the dark current everywhere if none is set.
- sensor_full_well_capacity(self: huira._huira.swir8.CameraModelHandle) float¶
The sensor’s full well capacity, in electrons.
- sensor_gain_db(self: huira._huira.swir8.CameraModelHandle) float¶
The sensor’s gain, in decibels.
- sensor_hot_pixel_dark_current(self: huira._huira.swir8.CameraModelHandle) float¶
The hot pixels’ median dark current, in e-/s.
- sensor_hot_pixel_fraction(self: huira._huira.swir8.CameraModelHandle) float¶
The fraction of the sensor’s pixels that are hot. See set_sensor_hot_pixels().
- sensor_hot_pixel_map(self: huira._huira.swir8.CameraModelHandle) huira._huira.Image_f32¶
Each pixel’s dark current as a hot pixel, in e-/s, as an Image_f32: 0 for the pixels that aren’t hot.
- sensor_hot_pixel_spread(self: huira._huira.swir8.CameraModelHandle) float¶
The standard deviation of the natural log of the hot pixels’ dark currents.
- sensor_imperfections_enabled(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether the sensor’s imperfections are on (the default). See enable_sensor_imperfections().
- sensor_noise_enabled(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether the sensor’s noise is on (the default). See enable_sensor_noise().
- sensor_noise_seed(self: huira._huira.swir8.CameraModelHandle) int¶
The seed of the sensor’s noise. See set_sensor_noise_seed().
- sensor_orientation(self: huira._huira.swir8.CameraModelHandle) huira._huira.Rotation¶
The sensor’s orientation relative to the camera, as a huira.Rotation from the sensor’s axes (in which projections and rays are given) to the camera’s: the roll about the optical axis.
- sensor_prnu(self: huira._huira.swir8.CameraModelHandle) float¶
The standard deviation of each pixel’s gain. See set_sensor_prnu().
- sensor_prnu_map(self: huira._huira.swir8.CameraModelHandle) huira._huira.Image_f32¶
Each pixel’s gain from the PRNU, as an Image_f32: 1 everywhere without it.
- sensor_quantum_efficiency(self: huira._huira.swir8.CameraModelHandle) huira._huira.swir8.SpectralBins¶
The sensor’s quantum efficiency, per spectral bin.
- sensor_read_noise(self: huira._huira.swir8.CameraModelHandle) float¶
The sensor’s read noise, in electrons.
- sensor_roll(self: huira._huira.swir8.CameraModelHandle) huira._huira.Radian¶
The sensor’s roll about the optical axis, in Radian. See set_sensor_roll().
- sensor_row_noise(self: huira._huira.swir8.CameraModelHandle) float¶
The sensor’s row noise, in e- RMS. See set_sensor_row_noise().
- sensor_unity_db(self: huira._huira.swir8.CameraModelHandle) float¶
The gain, in decibels, at which the sensor’s conversion gain is unity.
- set_aperture_diameter(self: huira._huira.swir8.CameraModelHandle, diameter: object) None¶
Set the aperture’s diameter (any distance unit). It is kept if the focal length changes, so the f-number follows the focal length.
- set_brown_conrady_distortion(self: huira._huira.swir8.CameraModelHandle, coeffs: huira._huira.BrownCoefficients) None¶
- set_filter_flat(*args, **kwargs)¶
Overloaded function.
set_filter_flat(self: huira._huira.swir8.CameraModelHandle, index: int, flat: Optional[huira._huira.Image_f32]) -> None
Replace the flat of the filter at an index, as for add_filter(), or remove it (None).
set_filter_flat(self: huira._huira.swir8.CameraModelHandle, name: str, flat: Optional[huira._huira.Image_f32]) -> None
Replace the flat of the filter with a name, as for add_filter(), or remove it (None).
- set_focal_length(self: huira._huira.swir8.CameraModelHandle, focal_length: object) None¶
Set the focal length (accepts any distance unit). Until the aperture is set, the camera stays f/2.8. After set_fstop() the aperture’s diameter is kept, so the f-number changes (with a warning); set the f-stop after the focal length.
- set_focus_diopters(self: huira._huira.swir8.CameraModelHandle, diopters: object) None¶
Focus in diopters, the reciprocal of the focus distance (Diopter). 0 focuses at infinity; negative values focus past infinity.
- set_focus_distance(self: huira._huira.swir8.CameraModelHandle, focus_distance: object) None¶
Focus at a distance (any distance unit). Negative values focus past infinity; infinity focuses at infinity.
- set_focus_sensor_offset(self: huira._huira.swir8.CameraModelHandle, offset: object) None¶
Focus by moving the sensor from the infinity-focus position (any distance unit). 0 focuses at infinity, positive values (sensor farther from the lens) focus in front of the camera, negative values focus past infinity. The offset, not the focus distance, is kept fixed if the focal length changes.
- set_fstop(self: huira._huira.swir8.CameraModelHandle, fstop: float) None¶
Set the f-number, e.g. 8 for f/8. This sets the aperture’s diameter from the current focal length, and the diameter is what is kept if the focal length changes later (with a warning), so set the f-stop after the focal length. Until the aperture is set, the camera is f/2.8 at any focal length.
- set_intrinsic_matrix(self: huira._huira.swir8.CameraModelHandle, intrinsic_matrix: huira._huira.Mat3, resolution: tuple[int, int], anchor_focal_length: object) None¶
Set the intrinsics from a 3x3 camera matrix, a huira.Mat3 or a numpy array or nested list written row by row: [[fx, s, cx], [0, fy, cy], [0, 0, 1]] (up to scale), where s is the skew; with a resolution tuple and physical focal length anchor. The principal point is in the camera’s pixel convention (see set_pixel_convention).
- set_intrinsics(self: huira._huira.swir8.CameraModelHandle, fx: float, fy: float, cx: float, cy: float, resolution: tuple[int, int], anchor_focal_length: object, skew: float = 0.0) None¶
Explicitly set mathematical intrinsics with a resolution tuple and physical focal length anchor: (x, y) projects to (fx * x + skew * y + cx, fy * y + cy). cx/cy are in the camera’s pixel convention (see set_pixel_convention); skew is 0 for perpendicular pixel axes.
- set_measured_psf(self: huira._huira.swir8.CameraModelHandle, data: huira._huira.swir8.Image, samples_per_pixel: float, sampling: huira._huira.PSFSampling, focus: huira._huira.PSFFocus = <PSFFocus.InFocus: 0>) None¶
Use a measured (user-supplied) PSF in place of the aperture’s diffraction pattern, until clear_psf(). ‘data’ is an Image of centered PSF samples, taken whole: as holding all of a source’s light out to its farthest sample (crop it to use less); ‘samples_per_pixel’ is the measurement sampling density per sensor pixel per axis; ‘sampling’ says what the samples are (see PSFSampling): PSFSampling.PixelIntegrated if the data came from the sensor being simulated, such as a star’s image, and otherwise almost always PSFSampling.PointSampled, such as optical design software’s PSF. Sources are drawn from the spline through the samples. ‘focus’ says whether it is a point’s in focus, which the camera’s focus blurs (the default), or already holds the camera’s defocus (see PSFFocus). Scattered light, if set, is added to it.
- set_opencv_distortion(self: huira._huira.swir8.CameraModelHandle, coeffs: huira._huira.OpenCVCoefficients) None¶
- set_owen_distortion(self: huira._huira.swir8.CameraModelHandle, coeffs: huira._huira.OwenCoefficients) None¶
- set_pixel_convention(self: huira._huira.swir8.CameraModelHandle, convention: huira._huira.PixelConvention) None¶
Set the pixel coordinate convention for the principal point (cx, cy) and projected positions, e.g. huira.PixelConvention.fits(). The default is huira.PixelConvention.opencv(): the top-left pixel’s center is (0, 0), y down. May be set before or after the principal point; changes nothing rendered unless a principal point was given.
- set_scatter(self: huira._huira.swir8.CameraModelHandle, fraction: float, slope: float, shoulder_angle: object, outer_angle: object = None) None¶
Set scattered light in angles (any angle unit, e.g. Arcsecond): ‘fraction’ of each source’s light spreads as (1 + (theta / shoulder_angle)^2)^(-slope / 2), falling as theta^-(slope + 2) beyond ‘outer_angle’. A slope of 2 or less needs an outer angle. It is added to diffraction or a PSF that was set, and included in psf_image(); scatter_image() gives it alone.
- set_sensor_bias_level(self: huira._huira.swir8.CameraModelHandle, bias_level: float) None¶
Set the sensor’s bias level, in DN, the same for every pixel. An absolute bias map, while one is set, takes its place; a relative one is added to it.
- set_sensor_bias_map(self: huira._huira.swir8.CameraModelHandle, bias_dn: huira._huira.Image_f32, kind: huira._huira.BiasMapKind = <BiasMapKind.Absolute: 0>) None¶
Set the bias of each pixel, in DN: an Image_f32 at the sensor’s resolution, in the sensor response’s layout (Image_f32(array, origin=…) makes one from a numpy array). With kind BiasMapKind.Absolute (the default), it is each pixel’s bias, as a master bias frame gives it, and the bias level is not used while it is set; with BiasMapKind.Relative, each pixel’s offset from the bias level, averaging about 0, and the bias level still applies. Each pixel’s bias must be in [0, 2^bit_depth - 1). An image with a sensor_bit_depth (a sensor response, or a frame read from a file that records its counts’ bit depth) holds DN / (2^bits - 1) and is converted; one without, whose values are all at most 1 DN, is refused as normalized (multiply a 32-bit float master from Siril or PixInsight by 65535). One of the sensor’s imperfections. The camera keeps it until it is cleared or replaced.
- set_sensor_bit_depth(self: huira._huira.swir8.CameraModelHandle, bit_depth: int) None¶
Set the sensor’s bit depth: its ADC’s, so DN run from 0 to 2^bit_depth - 1.
- set_sensor_column_noise(self: huira._huira.swir8.CameraModelHandle, column_noise: float) None¶
Set the sensor’s column noise, in e- RMS (0 by default): in each readout, every column’s pixels shift together by one draw of this standard deviation, as banding along the columns that changes from frame to frame. Off with the other noise.
- set_sensor_conversion_gain(self: huira._huira.swir8.CameraModelHandle, gain: float) None¶
Set the sensor’s conversion gain, in e-/DN.
- set_sensor_dark_current(self: huira._huira.swir8.CameraModelHandle, dark_current: float) None¶
Set the sensor’s dark current, in e-/s, the same for every pixel. A dark current map, while one is set, takes its place. One of the sensor’s imperfections.
- set_sensor_dark_current_map(self: huira._huira.swir8.CameraModelHandle, electrons_per_second: huira._huira.Image_f32) None¶
Set the dark current of each pixel, in e-/s, in place of the one dark current for all: an Image_f32 at the sensor’s resolution, in the sensor response’s layout (Image_f32(array, origin=…) makes one from a numpy array). Each pixel’s dark current, times the exposure time, is the mean number of electrons it gathers in the dark, added to its signal before shot noise; for RGB, each channel gathers that many. huira.dark_current_from_master_dark() makes one from a master dark and a master bias; an image with a sensor_bit_depth (normalized DN, not e-/s) is refused. One of the sensor’s imperfections. The camera keeps it until it is cleared or replaced.
- set_sensor_full_well_capacity(self: huira._huira.swir8.CameraModelHandle, fwc: float) None¶
Set the sensor’s full well capacity, in e-: the most electrons a pixel holds.
- set_sensor_gain_db(self: huira._huira.swir8.CameraModelHandle, gain_db: float) None¶
- set_sensor_hot_pixels(self: huira._huira.swir8.CameraModelHandle, fraction: float, dark_current: float, spread: float = 0.0) None¶
Give the sensor hot pixels: each pixel is hot with probability fraction, and a hot pixel gathers a dark current of its own, in e-/s, on top of the sensor’s: dark_current times exp(spread * N(0, 1)), a log-normal distribution whose median is dark_current (spread 0 for the same in every hot pixel). A fixed pattern made from the noise seed, the same pixels in every frame; a larger fraction keeps a smaller one’s hot pixels and adds more. One of the sensor’s imperfections. A dark current map from a real master dark already holds the camera’s hot pixels: leave these off with one. Off (fraction 0) by default; set_sensor_hot_pixels(0, 0) turns them off.
- set_sensor_noise_seed(self: huira._huira.swir8.CameraModelHandle, seed: int) None¶
Seed the sensor’s noise. Setting the same seed again repeats the same sequence of frames; the seed also makes the sensor’s PRNU and hot pixels, so another seed gives another sensor’s. Sensors get distinct seeds by default.
- set_sensor_prnu(self: huira._huira.swir8.CameraModelHandle, prnu: float) None¶
Set the sensor’s photo response non-uniformity: the standard deviation of each pixel’s gain (0.01 is 1%), by which its signal electrons are multiplied. A fixed pattern made from the noise seed, the same in every frame; one of the sensor’s imperfections. A flat from a real flat field already holds the camera’s PRNU: leave this at 0 with one. 0 by default.
- set_sensor_quantum_efficiency(*args, **kwargs)¶
Overloaded function.
set_sensor_quantum_efficiency(self: huira._huira.swir8.CameraModelHandle, qe: float) -> None
Set quantum efficiency (scalar, e.g. 0.7)
set_sensor_quantum_efficiency(self: huira._huira.swir8.CameraModelHandle, qe: huira._huira.swir8.SpectralBins) -> None
Set quantum efficiency (spectral)
- set_sensor_read_noise(self: huira._huira.swir8.CameraModelHandle, read_noise: float) None¶
Set the sensor’s read noise, in e- RMS: the noise of each pixel’s readout.
- set_sensor_roll(self: huira._huira.swir8.CameraModelHandle, angle: object) None¶
Set the sensor’s roll about the optical axis (any angle unit, e.g. Degree). The sensor’s x axis is turned by the angle toward its y axis, so with OpenCV’s axes (the default) a positive roll turns the scene counterclockwise in the image. The camera’s pose is unchanged; projections and rays are in the sensor’s axes.
- set_sensor_row_noise(self: huira._huira.swir8.CameraModelHandle, row_noise: float) None¶
Set the sensor’s row noise, in e- RMS (0 by default): in each readout, every row’s pixels shift together by one draw of this standard deviation, as banding along the rows (the image’s x axis) that changes from frame to frame. For a sensor read out along y, set the column noise instead. Off with the other noise.
- set_sensor_unity_db(self: huira._huira.swir8.CameraModelHandle, unity_db: float) None¶
- set_veiling_glare(self: huira._huira.swir8.CameraModelHandle, alpha: float) None¶
Redistribute the given fraction of total collected energy uniformly across the image (veiling glare).
- try_cast_ray(self: huira._huira.swir8.CameraModelHandle, x: float, y: float) object¶
As cast_ray(), but None where the lens distortion has no inverse, rather than raising.
- try_project_point(self: huira._huira.swir8.CameraModelHandle, point: object) tuple¶
As project_point(), but (nan, nan) for a point outside the field of view.
- use_blender_convention(self: huira._huira.swir8.CameraModelHandle, value: bool = True) None¶
Use Blender’s camera convention (-z forward, y up) rather than OpenCV’s (z forward, y down, the default).
- uses_blender_convention(self: huira._huira.swir8.CameraModelHandle) bool¶
Whether the camera uses Blender’s convention (-z forward, y up).
- valid(self: huira._huira.swir8.CameraModelHandle) bool¶