spinifex.image_tools

Spinifex tools for correcting image data

Submodules

Classes

FITSMetaData

Metadata from a FITS file

IntegratedRM

Time-integrated rotation measure

Functions

get_freq_from_fits(→ astropy.units.Quantity)

Get frequency array from FITS file

get_integrated_rm(→ IntegratedRM)

Computed the integrated RM effect following Van Eck (2021)

get_integrated_rm_from_fits(...)

Computed the integrated RM effect following Van Eck (2021)

get_metadata_from_fits(→ FITSMetaData)

Get metadata from a FITS file header

get_rm_from_fits(→ spinifex.get_rm.RM)

Get the ionospheric RM from a FITS file

Package Contents

class spinifex.image_tools.FITSMetaData[source]

Bases: NamedTuple

Metadata from a FITS file

duration: astropy.time.TimeDelta

Duration of observation

location: astropy.coordinates.EarthLocation

Location of observation

name: str

Name of FITS file as str

source: astropy.coordinates.SkyCoord

Target of observation

start_time: astropy.time.Time

Start time of obsrvation

class spinifex.image_tools.IntegratedRM[source]

Bases: NamedTuple

Time-integrated rotation measure

azimuth: float

Average azimuth (degrees)

b_parallel: float

Average parallel magnetic field

electron_density: float

Average electron content

elevation: float

Average elevation (degrees)

height: float

Average altitude (km)

theta: numpy.typing.NDArray[numpy.complex128]

Complex time-integrated effect of the ionosphere

time: astropy.time.Time

Average time

spinifex.image_tools.get_freq_from_fits(fits_path: pathlib.Path) astropy.units.Quantity[source]

Get frequency array from FITS file

Parameters

fits_pathPath

Path to FITS file

Returns

u.Quantity

Frequency array

Raises

FITSHeaderError

If no spectral axis is found

spinifex.image_tools.get_integrated_rm(time_dep_rm: spinifex.get_rm.RM, freq_arr: astropy.units.Quantity) IntegratedRM[source]

Computed the integrated RM effect following Van Eck (2021)

Parameters

time_dep_rmRM

Time-dependent RM object

freq_arru.Quantity

Frequency array

Returns

IntegratedRM

Integrated rotation measure object

spinifex.image_tools.get_integrated_rm_from_fits(fits_path: pathlib.Path, timestep: astropy.units.Quantity = 15 * u.min, iono_model_name: str = 'ionex', magnetic_model_name: str = 'ppigrf', **iono_kwargs: Any) spinifex.image_tools.image_tools.IntegratedRM[source]

Computed the integrated RM effect following Van Eck (2021)

Parameters

fits_pathPath

Path to FITS file

timestepu.Quantity, optional

Timestep to use for computing time-dependent RM, by default 15*u.min

iono_model_namestr, optional

ionospheric model name, by default “ionex”. Must be a supported ionospheric model.

magnetic_model_namestr, optional

geomagnetic model name, by default “ppigrf”. Must be a supported geomagnetic model.

iono_kwargsdict

keyword arguments for the ionospheric model

Returns

IntegratedRM

Integrated rotation measure object

spinifex.image_tools.get_metadata_from_fits(fits_path: pathlib.Path) FITSMetaData[source]

Get metadata from a FITS file header

Parameters

fits_pathPath

FITS file

Returns

FitsMetaData

FITS image metadata

spinifex.image_tools.get_rm_from_fits(fits_path: pathlib.Path, timestep: astropy.units.Quantity = 15 * u.min, iono_model_name: str = 'ionex', magnetic_model_name: str = 'ppigrf', **iono_kwargs: Any) spinifex.get_rm.RM[source]

Get the ionospheric RM from a FITS file

Parameters

fits_pathPath

Path to FITS file

timestepu.Quantity, optional

Time step to evaluate time-dependant RM, by default 15*u.min

iono_model_namestr, optional

ionospheric model name, by default “ionex”. Must be a supported ionospheric model.

magnetic_model_namestr, optional

geomagnetic model name, by default “ppigrf”. Must be a supported geomagnetic model.

iono_kwargsdict

Keyword arguments for the ionospheric model

Returns

RM

Rotation measure object