eye_patch.pixel_utils¶
Classes¶
A simple container to represent a fitted 2D gaussian, |
Functions¶
|
Construct and return a beam shape from the fields in a FITS image |
|
Given a image with beam information, return the number of pixels |
Module Contents¶
- class eye_patch.pixel_utils.BeamShape[source]¶
A simple container to represent a fitted 2D gaussian, intended for the main lobe of the synthesised beam. This class has been defined to avoid issues with the serialisation of astropy.units, which can cause strange and wonderful errors when being sent over the wire to workers.
- classmethod from_radio_beam(radio_beam: radio_beam.Beam) BeamShape[source]¶
A helper function to convert a radio_beam.Beam into a BeamShape. This is prinicpally intended to be used when there is a need to exchange a Beam between processes that would need to serialise the object.
- Parameters:
radio_beam (Beam) – The Beam to convert to normalised and known units
- Returns:
The normalised container without astropy units.
- Return type:
- eye_patch.pixel_utils.get_beam_shape(fits_path: pathlib.Path) BeamShape | None[source]¶
Construct and return a beam shape from the fields in a FITS image
- Parameters:
fits_path (Path) – FITS image to extract the beam information from
- Returns:
Shape of the beam stored in the FITS image. None is returned if the beam is not found.
- Return type:
Optional[BeamShape]
- eye_patch.pixel_utils.get_pixels_per_beam(fits_path: pathlib.Path) float | None[source]¶
Given a image with beam information, return the number of pixels per beam. The beam is taken from the FITS header. This is evaluated for pixels at the reference pixel position.
- Parameters:
fits_path (Path) – FITS image to consideer
- Returns:
Number of pixels per beam. If beam is not in header then None is returned.
- Return type:
float | None