spinifex.image_tools.fits_tools

Predict / correct ionospheric RM in FITS images

Classes

FITSMetaData

Metadata from a FITS file

Functions

correct_fits_images(→ None)

get_freq_from_fits(→ astropy.units.Quantity)

Get frequency array from FITS file

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

Module Contents

class spinifex.image_tools.fits_tools.FITSMetaData[source]

Bases: NamedTuple

Metadata from a FITS file

duration: astropy.time.TimeDelta[source]

Duration of observation

location: astropy.coordinates.EarthLocation[source]

Location of observation

name: str[source]

Name of FITS file as str

source: astropy.coordinates.SkyCoord[source]

Target of observation

start_time: astropy.time.Time[source]

Start time of obsrvation

spinifex.image_tools.fits_tools.correct_fits_images(stokes_q_path: pathlib.Path, stokes_u_path: pathlib.Path, integrated_rm: spinifex.image_tools.image_tools.IntegratedRM, ext: int = 0, suffix: str = 'fr_corr') None[source]
spinifex.image_tools.fits_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.fits_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.fits_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.fits_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