astrohack.locit
¶
Module Contents¶
Functions¶
|
Extract Antenna position determination data from an MS and stores it in a locit output file. |
-
locit
(locit_name: str, position_name: str = None, elevation_limit: float = 10.0, polarization: str = 'both', fit_engine: str = 'scipy', fit_kterm: bool = False, fit_delay_rate: bool = True, ant: Union[str, List[str]] = 'all', ddi: Union[int, List[int]] = 'all', combine_ddis: str = 'simple', parallel: bool = False, overwrite: bool = False)[source]¶ Extract Antenna position determination data from an MS and stores it in a locit output file.
- Parameters
locit_name (str) – Name of input *.locit.zarr file.
position_name (str, optional) – Name of <position_name>.position.zarr file to create. Defaults to measurement set name with position.zarr extension.
elevation_limit (float, optional) – Lower elevation limit for excluding sources in degrees
polarization (str, optional) – Which polarization to use R, L or both for circular systems, X, Y, or both for linear systems.
fit_kterm (bool, optional) – Fit antenna elevation axis offset term, defaults to False
fit_delay_rate (bool, optional) – Fit delay rate with time, defaults to True
fit_engine (str, optional) – What engine to use on fitting, default is linear algebra
ant (list or str, optional) – List of antennas/antenna to be processed, defaults to “all” when None, ex. ea25
ddi (list or int, optional) – List of ddis/ddi to be processed, defaults to “all” when None, ex. 0
combine_ddis (str, optional) – Type of DDI combination, if desired, defaults to simple
parallel (bool, optional) – Run in parallel. Defaults to False.
overwrite (bool, optional) – Boolean for whether to overwrite current position.zarr file, defaults to False.
- Returns
Antenna position object.
- Return type
AstrohackPositionFile Position object allows the user to access position data via compound dictionary keys with values, in order of depth, ant -> ddi. The position object also provides a summary() helper function to list available keys for each file. An outline of the position object structure is show below:
combine_ddis = no:
position_mds = { ant_0:{ ddi_0: position_ds, ⋮ ddi_m: position_ds }, ⋮ ant_n: … }
combine_ddis = [“simple”, “difference”]:
position_mds = { ant_0: position_ds ant_n: position_ds }
Additional Information
Available fitting engines:
For locit two fitting engines have been implemented, one the classic method used in AIPS is called here ‘linear algebra’ and a newer more pythonic engine using scipy curve fitting capabilities, which we call scipy, more details below.
- linear algebra: This fitting engine is based on the least square methods for solving linear systems,
this engine is fast, about one order of magnitude faster than scipy, but may fail to converge, also its uncertainties may be underestimated.
- scipy: This fitting engine uses the well established scipy.optimize.curve_fit routine. This engine is
slower than the linear algebra engine, but it is more robust with better estimated uncertainties.
Choosing a polarization
The position fit may be done on either polarization (R or L for the VLA, X or Y for ALMA) or for both polarizations at once. When choosing both polarizations we increase the robustness of the solution by doubling the amount of data fitted.
Combining DDIs
By default, (combine_ddis=’simple’) locit combines different DDIs so that there is a single position solution per antenna. The other options are, a solution for each of the DDIs for each antenna (combine_ddis=’no’) or combining two DDIs by computing the delays from the difference in phases between the two DDIs of different frequencies (combine_ddis=’difference’).
- combine_ddis=’simple’Generates higher antenna position correction solutions of higher SNR as more data is used
each delay fit.
combine_ddis=’no’ : Useful for detecting systematic differences between different DDIs. combine_ddis=’difference’ : This method is useful for cases where phase wrapping may have occurred due to large
delays.
Examples
- position_mds = locit(“myphase.locit.zarr”, polarization=’R’, combine_ddis=’simple’) -> Fit the phase delays in
“myphase.locit.zarr” for all antennas by combining the delays from all DDIs but using only the ‘R’ polarization.
- position_mds = locit(“myphase.locit.zarr”, combine_ddis=’difference’, elevation_limit=30.0) -> Fit the phase
difference delays in “myphase.locit.zarr” for all antennas but only using sources above 30 degrees elevation.