spinifex.vis_tools.ms_tools =========================== .. py:module:: spinifex.vis_tools.ms_tools Attributes ---------- .. autoapisummary:: spinifex.vis_tools.ms_tools.MSG spinifex.vis_tools.ms_tools.table Classes ------- .. autoapisummary:: spinifex.vis_tools.ms_tools.MsMetaData Functions --------- .. autoapisummary:: spinifex.vis_tools.ms_tools._get_iono_from_ms spinifex.vis_tools.ms_tools.cli_get_dtec_h5parm_from_ms spinifex.vis_tools.ms_tools.cli_get_rm_h5parm_from_ms spinifex.vis_tools.ms_tools.get_average_location spinifex.vis_tools.ms_tools.get_columns_from_ms spinifex.vis_tools.ms_tools.get_dtec_from_ms spinifex.vis_tools.ms_tools.get_metadata_from_ms spinifex.vis_tools.ms_tools.get_rm_from_ms Module Contents --------------- .. py:class:: MsMetaData Bases: :py:obj:`NamedTuple` Metadata from a Measurement Set .. py:attribute:: locations :type: astropy.coordinates.EarthLocation .. py:attribute:: name :type: str .. py:attribute:: source :type: astropy.coordinates.SkyCoord .. py:attribute:: station_names :type: list[str] .. py:attribute:: times :type: astropy.time.Time .. py:function:: _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] Get ionospheric values for a measurement set Parameters ---------- ms_path : Path measurement set iono_type : Literal["dtec", "rm"] type of ionospheric value to calculate timestep : u.Quantity | None, optional only calculate rotation measure every timestep, by default None use_stations : list[int | str] | None, optional list of stations (index or name) to use, if None use first of the measurement set, by default None height_array : NDArray[np.float64], optional array of ionospheric altitudes, by default DEFAULT_IONO_HEIGHT iono_model : ModelDensityFunction, optional ionospheric model, by default ionospheric_models.ionex magnetic_model : MagneticFieldFunction, optional geomagnetic model, by default magnetic_models.ppigrf iono_options : OptionType | None, optional arguments for the ionospheric model, by default None Returns ------- dict[str, RM] | dict[str, NDArray] dictionary with ionospheric values .. py:function:: cli_get_dtec_h5parm_from_ms(args: argparse.Namespace) -> None .. py:function:: cli_get_rm_h5parm_from_ms(args: argparse.Namespace) -> None .. py:function:: get_average_location(location: astropy.coordinates.EarthLocation) -> astropy.coordinates.EarthLocation Get first location from N locations Parameters ---------- location : EarthLocation N locations Returns ------- EarthLocation first location .. py:function:: get_columns_from_ms(ms_path: pathlib.Path) -> list[str] Get the columns from a MeasurementSet .. py:function:: 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] Get rotation measures for a measurement set Parameters ---------- ms_path : Path measurement set timestep : u.Quantity | None, optional only calculate rotation measure every timestep, by default None use_stations : list[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_name : str, optional ionospheric model name, by default "ionex". Must be a supported ionospheric model. iono_kwargs : dict, optional arguments for the ionospheric model, by default None Returns ------- dict[str, NDArray] dictionary with electron_density_profiles per station .. py:function:: get_metadata_from_ms(ms_path: pathlib.Path) -> MsMetaData open measurement set and get metadata from it Parameters ---------- ms_path : Path measurement set Returns ------- MsMetaData object with metadata .. py:function:: 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] Get rotation measures for a measurement set Parameters ---------- ms_path : Path measurement set timestep : u.Quantity | None, optional only calculate rotation measure every timestep, by default None use_stations : list[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_name : str, optional ionospheric model name, by default "ionex". Must be a supported ionospheric model. magnetic_model_name : str, optional geomagnetic model name, by default "ppigrf". Must be a supported geomagnetic model. iono_kwargs : dict, optional arguments for the ionospheric model, by default None Returns ------- dict[str, RM] dictionary with RM object per station .. py:data:: MSG :value: 'casacore is not installed! To operate on MeasurementSets, install spinifex[casacore].' .. py:data:: table