distroi.auxiliary.time_base_oifits module#
A module to interactively plot the uv coverage of time-series of OIFITS files.
Provides a method to interactively plot multiple OIFITS files as a time-series, allowing the user to specify and adapt a certain time window, allowing the user to investigate the timebase of the observations.
- distroi.auxiliary.time_base_oifits.oifits_time_window_plot(data_dir: str, data_file: str, init_window_width: float, copy_dir: str | None = None) list[str] | None#
Interactive matplotlib plot showing uv coverage of specified OIFITS files.
Makes an interactive plot for specified OIFITS files as a time-series. The specified time window is shown as a red-shaded area. Sliders are provided to change the position and width of this time window. The ‘uv coverage’ button can then be clicked in order to plot the uv coverage of the data included within the time window. If the copy_dir argument is passed along, the ‘Copy files’ button can be pressed to copy over the OIFITS file which contain observations within the interactively set time window. After all plots are closed, returns a list with the filepaths of these OIFITS files.
- Parameters:
data_dir (str) – Path to the directory where the OIFITS files are stored.
data_file (str) – Data filename. Use wildcards to read in multiple files at once.
init_window_width (float) – Initial width of the time window in days. Needs to be larger than 0 days.
copy_dir (str, optional) – If specified, the OIFITS files that have observations within the interactively set time window will be copied to this directory upon using the ‘Copy files’ button.
- Returns:
List of filepaths corresponding to the OIFITS files that have observations within the interactively set time window.
- Return type:
list[str] or None
Warning
Because the uv coverage button spawns another plot, this function cannot be properly used in jupyter notebooks, instead use this method within a python script.
- Raises:
ValueError – If init_window_width is non-positive.
- distroi.auxiliary.time_base_oifits.timestamp_to_plt_float(date_time: Timestamp) float#
Convert a pandas Timestamp object to the amount of days passed since midnight 1970-01-01 UTC as a float.
- Parameters:
date_time (pd.Timestamp) – Pandas Timestamp instance.
- Returns:
The Timestamp converted to a float value to be used in matplotlib when specifying e.g. position along the axes.
- Return type:
float