spinifex.vis_tools.ms_tools

Attributes

Classes

MsMetaData

Metadata from a Measurement Set

Functions

_get_iono_from_ms(→ dict[str, ...)

Get ionospheric values for a measurement set

cli_get_dtec_h5parm_from_ms(→ None)

cli_get_rm_h5parm_from_ms(→ None)

get_average_location(→ astropy.coordinates.EarthLocation)

Get first location from N locations

get_columns_from_ms(→ list[str])

Get the columns from a MeasurementSet

get_dtec_from_ms(→ dict[str, numpy.typing.NDArray])

Get rotation measures for a measurement set

get_metadata_from_ms(→ MsMetaData)

open measurement set and get metadata from it

get_rm_from_ms(→ dict[str, spinifex.get_rm.RM])

Get rotation measures for a measurement set

Module Contents

class spinifex.vis_tools.ms_tools.MsMetaData[source]

Bases: NamedTuple

Metadata from a Measurement Set

locations: astropy.coordinates.EarthLocation[source]
name: str[source]
source: astropy.coordinates.SkyCoord[source]
station_names: list[str][source]
times: astropy.time.Time[source]
spinifex.vis_tools.ms_tools._get_iono_from_ms(ms_path: pathlib.Path, iono_model: spinifex.ionospheric.ModelDensityFunction[spinifex.ionospheric.models.O], iono_type: Literal['dtec', 'rm'], timestep: astropy.units.Quantity | None = None, use_stations: list[int] | list[str] | Literal['all', 'average'] = 'average', height_array: numpy.typing.NDArray[numpy.float64] = DEFAULT_IONO_HEIGHT, iono_options: spinifex.ionospheric.models.O | None = None, magnetic_model: spinifex.magnetic.MagneticFieldFunction = magnetic_models.ppigrf) dict[str, spinifex.get_rm.RM] | dict[str, numpy.typing.NDArray][source]

Get ionospheric values for a measurement set

Parameters

ms_pathPath

measurement set

iono_typeLiteral[“dtec”, “rm”]

type of ionospheric value to calculate

timestepu.Quantity | None, optional

only calculate rotation measure every timestep, by default None

use_stationslist[int | str] | None, optional

list of stations (index or name) to use, if None use first of the measurement set, by default None

height_arrayNDArray[np.float64], optional

array of ionospheric altitudes, by default DEFAULT_IONO_HEIGHT

iono_modelModelDensityFunction, optional

ionospheric model, by default ionospheric_models.ionex

magnetic_modelMagneticFieldFunction, optional

geomagnetic model, by default magnetic_models.ppigrf

iono_optionsOptionType | None, optional

arguments for the ionospheric model, by default None

Returns

dict[str, RM] | dict[str, NDArray]

dictionary with ionospheric values

spinifex.vis_tools.ms_tools.cli_get_dtec_h5parm_from_ms(args: argparse.Namespace) None[source]
spinifex.vis_tools.ms_tools.cli_get_rm_h5parm_from_ms(args: argparse.Namespace) None[source]
spinifex.vis_tools.ms_tools.get_average_location(location: astropy.coordinates.EarthLocation) astropy.coordinates.EarthLocation[source]

Get first location from N locations

Parameters

locationEarthLocation

N locations

Returns

EarthLocation

first location

spinifex.vis_tools.ms_tools.get_columns_from_ms(ms_path: pathlib.Path) list[str][source]

Get the columns from a MeasurementSet

spinifex.vis_tools.ms_tools.get_dtec_from_ms(ms_path: pathlib.Path, timestep: astropy.units.Quantity | None = None, use_stations: list[int] | list[str] | Literal['all', 'average'] = 'average', iono_model_name: str | None = None, **iono_kwargs: Any) dict[str, numpy.typing.NDArray][source]

Get rotation measures for a measurement set

Parameters

ms_pathPath

measurement set

timestepu.Quantity | None, optional

only calculate rotation measure every timestep, by default None

use_stationslist[int | str] | None, optional

list of stations (index or name) to use, if None use first of the measurement set, by default None

iono_model_namestr, optional

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

iono_kwargsdict, optional

arguments for the ionospheric model, by default None

Returns

dict[str, NDArray]

dictionary with electron_density_profiles per station

spinifex.vis_tools.ms_tools.get_metadata_from_ms(ms_path: pathlib.Path) MsMetaData[source]

open measurement set and get metadata from it

Parameters

ms_pathPath

measurement set

Returns

MsMetaData

object with metadata

spinifex.vis_tools.ms_tools.get_rm_from_ms(ms_path: pathlib.Path, timestep: astropy.units.Quantity | None = None, use_stations: list[int] | list[str] | Literal['all', 'average'] = 'average', iono_model_name: str | None = None, magnetic_model_name: str = 'ppigrf', **iono_kwargs: Any) dict[str, spinifex.get_rm.RM][source]

Get rotation measures for a measurement set

Parameters

ms_pathPath

measurement set

timestepu.Quantity | None, optional

only calculate rotation measure every timestep, by default None

use_stationslist[int | str] | None, optional

list of stations (index or name) to use, if None use first of the measurement set, by default None

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, optional

arguments for the ionospheric model, by default None

Returns

dict[str, RM]

dictionary with RM object per station

spinifex.vis_tools.ms_tools.MSG = 'casacore is not installed! To operate on MeasurementSets, install spinifex[casacore].'[source]
spinifex.vis_tools.ms_tools.table[source]