drs4.specs.gain module#

class drs4.specs.gain.Gain(chan: ~typing.Annotated[~xarrayspecs.typing.ArrayLike[~typing.Annotated[~typing.Literal['chan'], Spec({'xarrayspecs_dims': <ITSELF>})], ~typing.Annotated[~numpy.int64, Spec({'xarrayspecs_dtype': <ITSELF>})]], Spec({'xarrayspecs_use': 'coord'}), Spec({'xarrayspecs_attrs': ReadonlyDict({'long_name': 'Channel number'})})], usb: ~typing.Annotated[~xarrayspecs.typing.ArrayLike[~typing.Annotated[~typing.Literal['chan'], Spec({'xarrayspecs_dims': <ITSELF>})], ~typing.Annotated[~numpy.complex128, Spec({'xarrayspecs_dtype': <ITSELF>})]], Spec({'xarrayspecs_use': 'data'}), Spec({'xarrayspecs_attrs': ReadonlyDict({'long_name': 'Complex gain of USB', 'units': 'Arbitrary unit'})})], lsb: ~typing.Annotated[~xarrayspecs.typing.ArrayLike[~typing.Annotated[~typing.Literal['chan'], Spec({'xarrayspecs_dims': <ITSELF>})], ~typing.Annotated[~numpy.complex128, Spec({'xarrayspecs_dtype': <ITSELF>})]], Spec({'xarrayspecs_use': 'data'}), Spec({'xarrayspecs_attrs': ReadonlyDict({'long_name': 'Complex gain of LSB', 'units': 'Arbitrary unit'})})])[source]#

Bases: AsDataset

Complex gains for digital sideband separation.

chan: int64, Spec({'xarrayspecs_dtype': <ITSELF>})]], Spec({'xarrayspecs_use': 'coord'}), Spec({'xarrayspecs_attrs': ReadonlyDict({'long_name': 'Channel number'})})]#

Channel number (0-511).

lsb: complex128, Spec({'xarrayspecs_dtype': <ITSELF>})]], Spec({'xarrayspecs_use': 'data'}), Spec({'xarrayspecs_attrs': ReadonlyDict({'long_name': 'Complex gain of LSB', 'units': 'Arbitrary unit'})})]#

Complex gain of LSB.

spec_version: Annotated[int, Spec({'xarrayspecs_use': 'attr'})] = 0#

Version of the data specification.

usb: complex128, Spec({'xarrayspecs_dtype': <ITSELF>})]], Spec({'xarrayspecs_use': 'data'}), Spec({'xarrayspecs_attrs': ReadonlyDict({'long_name': 'Complex gain of USB', 'units': 'Arbitrary unit'})})]#

Complex gain of USB.

drs4.specs.gain.open_gain(ms: PathLike[str] | str, /, *, format: Literal['Dataset']) → Dataset[source]#
drs4.specs.gain.open_gain(ms: PathLike[str] | str, /, *, format: Literal['DataFrame']) → DataFrame
drs4.specs.gain.open_gain(ms: PathLike[str] | str, /) → Dataset

Open gain file (DRS4 MS file) as a DataFrame or a Dataset.

Parameters:
  • ms – Path of input gain file (DRS4 MS file).

  • format – Output data format (DataFrame|Dataset).

Returns:

DataFrame or Dataset of the input gain file.