From cfef58039b2c95b3f4179b25b42a4a06b9f6bca2 Mon Sep 17 00:00:00 2001 From: ketiltrout Date: Sun, 21 Jul 2024 13:36:22 -0700 Subject: [PATCH] fix(ch_util): Import objects directly from caput.time This changes imports of objects moved from `ch_util.ephemeris` to `caput.time` to use the `caput.time` version directly, rather than importing that same `caput` object via its import into `ephemeris`. This is more prep-work for splitting `ch_util.ephemeris`. --- ch_util/andata.py | 19 ++++-------------- ch_util/cal_utils.py | 2 +- ch_util/chan_monitor.py | 15 ++++++++------ ch_util/data_quality.py | 10 ++++++---- ch_util/finder.py | 31 ++++++++++++++--------------- ch_util/fluxcat.py | 4 ++-- ch_util/holography.py | 43 ++++++++++++++++++++--------------------- ch_util/layout.py | 13 ++++++------- ch_util/plot.py | 11 +++++++---- ch_util/timing.py | 21 ++++++++++---------- ch_util/tools.py | 15 ++++++++------ 11 files changed, 90 insertions(+), 94 deletions(-) diff --git a/ch_util/andata.py b/ch_util/andata.py index 8765ed1d..4c7aceb1 100644 --- a/ch_util/andata.py +++ b/ch_util/andata.py @@ -10,14 +10,10 @@ import h5py from bitshuffle import h5 -tmp = h5 # To appease linters who complain about unused imports. +from caput import memh5, tod +import caput.time as ctime -# If the `caput` package is available, get `memh5` from there. Otherwise, use -# the version of memh5 that ships with `ch_util`, eliminating the dependency. -try: - from caput import memh5, tod -except ImportError: - raise ImportError("Could not import memh5 or tod. Have you installed caput?") +tmp = h5 # To appease linters who complain about unused imports. ni_msg = "Ask Kiyo to implement this." @@ -326,12 +322,7 @@ def timestamp(self): @staticmethod def convert_time(time): - try: - from .ephemeris import ensure_unix - except ValueError: - from .ephemeris import ensure_unix - - return ensure_unix(time) + return ctime.ensure_unix(time) class CorrData(BaseData): @@ -1223,8 +1214,6 @@ def from_acq_h5( data : HKPData """ - from caput import time as ctime - metrics = metrics if metrics is not None else datasets if "mode" not in kwargs: diff --git a/ch_util/cal_utils.py b/ch_util/cal_utils.py index 06532d65..2f6f8d4f 100644 --- a/ch_util/cal_utils.py +++ b/ch_util/cal_utils.py @@ -2682,7 +2682,7 @@ def get_reference_times_dataset_id( logger = logging.getLogger(__name__) # Dataset IDs before this date are untrustworthy - ds_start = ephemeris.datetime_to_unix(datetime(2020, 11, 1)) + ds_start = ctime.datetime_to_unix(datetime(2020, 11, 1)) if (times < ds_start).any(): raise ValueError( "Dataset IDs before 2020/11/01 are corrupt, so this method won't work. " diff --git a/ch_util/chan_monitor.py b/ch_util/chan_monitor.py index 1179dbac..5147fb35 100644 --- a/ch_util/chan_monitor.py +++ b/ch_util/chan_monitor.py @@ -2,6 +2,9 @@ import numpy as np import copy + +import caput.time as ctime + from chimedb import data_index from ch_util import ephemeris, finder @@ -14,7 +17,7 @@ ) # Cylinder rotation matrix C = 2.9979e8 PHI = ephemeris.CHIMELATITUDE * np.pi / 180.0 # DRAO Latitue -SD = 24.0 * 3600.0 * ephemeris.SIDEREAL_S # Sidereal day +SD = 24.0 * 3600.0 * ctime.SIDEREAL_S # Sidereal day _DEFAULT_NODE_SPOOF = {"scinet_online": "/scratch/k/krs/jrs65/chime/archive/online/"} # _DEFAULT_NODE_SPOOF = {'gong': '/mnt/gong/archive'} # For tests on Marimba @@ -739,7 +742,7 @@ def fromdate( bsep2=218, ): """Initialize class from date""" - t1 = ephemeris.datetime_to_unix(date) + t1 = ctime.datetime_to_unix(date) return cls( t1, freq_sel=freq_sel, @@ -933,7 +936,7 @@ def set_metadata(self, tms, input_map): from ch_util import tools # Get CHIME ON channels: - half_time = ephemeris.unix_to_datetime(tms[int(len(tms) // 2)]) + half_time = ctime.unix_to_datetime(tms[int(len(tms) // 2)]) corr_inputs = tools.get_correlator_inputs(half_time) self.corr_inputs = tools.reorder_correlator_inputs(input_map, corr_inputs) pwds = tools.is_chime_on(self.corr_inputs) # Which inputs are CHIME ON antennas @@ -954,7 +957,7 @@ def get_prod_sel(self, data): input_map = data.input tms = data.time - half_time = ephemeris.unix_to_datetime(tms[int(len(tms) // 2)]) + half_time = ctime.unix_to_datetime(tms[int(len(tms) // 2)]) corr_inputs = tools.get_correlator_inputs(half_time) corr_inputs = tools.reorder_correlator_inputs(input_map, corr_inputs) pwds = tools.is_chime_on(corr_inputs) # Which inputs are CHIME ON antennas @@ -1099,8 +1102,8 @@ def set_acq_list(self): self.night_acq_list = f_night.get_results() # Create a list of acquisitions that flag out sunrise, sun transit, and sunset - mm = ephemeris.unix_to_datetime(self.t1).month - dd = ephemeris.unix_to_datetime(self.t1).day + mm = ctime.unix_to_datetime(self.t1).month + dd = ctime.unix_to_datetime(self.t1).day mm = mm + float(dd) / 30.0 fct = 3.0 diff --git a/ch_util/data_quality.py b/ch_util/data_quality.py index 4c7ce972..21834a75 100644 --- a/ch_util/data_quality.py +++ b/ch_util/data_quality.py @@ -16,6 +16,8 @@ import numpy as np +import caput.time as ctime + import ch_util.ephemeris as ch_eph from ch_util import andata from ch_util import tools @@ -364,7 +366,7 @@ def _cut_non_chime(data, visi, chan_array, inputs=None): input_map = data.input tmstp = data.index_map["time"]["ctime"] # time stamp # Datetime halfway through data: - half_time = ch_eph.unix_to_datetime(tmstp[int(len(tmstp) // 2)]) + half_time = ctime.unix_to_datetime(tmstp[int(len(tmstp) // 2)]) # Get information on correlator inputs, if not already supplied if inputs is None: inputs = tools.get_correlator_inputs(half_time) @@ -899,7 +901,7 @@ def _create_plot( # For title, use start time stamp: title = "Good channels result for {0}".format( - ch_eph.unix_to_datetime(tmstp1[0]).date() + ctime.unix_to_datetime(tmstp1[0]).date() ) # I need to know the slot for each channel: @@ -985,14 +987,14 @@ def get_slot(channel): if time_unit == "days": plt.xlabel( "Time (days since {0} UTC)".format( - ch_eph.unix_to_datetime(tmstp1[0]) + ctime.unix_to_datetime(tmstp1[0]) ), fontsize=10, ) else: plt.xlabel( "Time (hours since {0} UTC)".format( - ch_eph.unix_to_datetime(tmstp1[0]) + ctime.unix_to_datetime(tmstp1[0]) ), fontsize=10, ) diff --git a/ch_util/finder.py b/ch_util/finder.py index d01dcb66..6c90316a 100644 --- a/ch_util/finder.py +++ b/ch_util/finder.py @@ -46,6 +46,8 @@ import peewee as pw import re +import caput.time as ctime + import chimedb.core as db import chimedb.data_index as di from . import layout, ephemeris @@ -664,8 +666,8 @@ def set_time_range(self, start_time=None, end_time=None): start_time = 0 if end_time is None: end_time = time.time() - start_time = ephemeris.ensure_unix(start_time) - end_time = ephemeris.ensure_unix(end_time) + start_time = ctime.ensure_unix(start_time) + end_time = ctime.ensure_unix(end_time) old_start_time, old_end_time = self.time_range start_time = max(start_time, old_start_time) end_time = min(end_time, old_end_time) @@ -733,8 +735,8 @@ def _format_time_interval(self, start_time, end_time): start_time = 0 if end_time is None: end_time = time.time() - start_time = ephemeris.ensure_unix(start_time) - end_time = ephemeris.ensure_unix(end_time) + start_time = ctime.ensure_unix(start_time) + end_time = ctime.ensure_unix(end_time) range_start, range_end = self.time_range start_time = max(start_time, range_start) end_time = min(end_time, range_end) @@ -915,11 +917,9 @@ def include_RA_interval(self, start_RA, end_RA): Total 242094.394565 seconds of data. """ - from . import ephemeris - delta_RA = (end_RA - start_RA) % 360 mid_RA = (start_RA + delta_RA / 2.0) % 360 - time_delta = delta_RA * 4 * 60.0 * ephemeris.SIDEREAL_S + time_delta = delta_RA * 4 * 60.0 * ctime.SIDEREAL_S self.include_transits(mid_RA, time_delta=time_delta) def exclude_RA_interval(self, start_RA, end_RA): @@ -938,11 +938,10 @@ def exclude_RA_interval(self, start_RA, end_RA): Look under include_RA_interval for very similar example. """ - from . import ephemeris delta_RA = (end_RA - start_RA) % 360 mid_RA = (start_RA + delta_RA / 2.0) % 360 - time_delta = delta_RA * 4 * 60.0 * ephemeris.SIDEREAL_S + time_delta = delta_RA * 4 * 60.0 * ctime.SIDEREAL_S self.exclude_transits(mid_RA, time_delta=time_delta) def include_transits(self, body, time_delta=None): @@ -996,7 +995,7 @@ def include_26m_obs(self, source, require_quality=True): Examples -------- - >>> from ch_util import (finder, ephemeris) + >>> from ch_util import finder >>> from datetime import datetime >>> f = finder.Finder() >>> f.only_corr() @@ -1204,8 +1203,8 @@ def get_results_acq(self, acq_ind, file_condition=None): start, stop = layout.get_global_flag_times(f.id) if stop is None: stop = time.time() - start = ephemeris.ensure_unix(start) - stop = ephemeris.ensure_unix(stop) + start = ctime.ensure_unix(start) + stop = ctime.ensure_unix(stop) flag_times.append((start, stop)) overlap = _check_intervals_overlap(time_intervals, flag_times) if mode is GF_WARN: @@ -1246,8 +1245,8 @@ def get_results_acq(self, acq_ind, file_condition=None): start, stop = f.start_time, f.finish_time if stop is None: stop = time.time() - start = ephemeris.ensure_unix(start) - stop = ephemeris.ensure_unix(stop) + start = ctime.ensure_unix(start) + stop = ctime.ensure_unix(stop) flag_times.append((start, stop)) overlap = _check_intervals_overlap(time_intervals, flag_times) if overlap: @@ -1326,15 +1325,13 @@ def print_acq_info(self): """ - from . import ephemeris - print("acquisition | name | start | length (hrs) | N files") row_proto = "%4d | %-36s | %s | %7.2f | %4d" for ii, acq in enumerate(self.acqs): start = acq.start_time finish = acq.finish_time length = (finish - start) / 3600.0 - start = ephemeris.unix_to_datetime(start) + start = ctime.unix_to_datetime(start) start = start.strftime("%Y-%m-%d %H:%M") name = acq.name n_files = acq.n_timed_files diff --git a/ch_util/fluxcat.py b/ch_util/fluxcat.py index fd66ed4a..ad1a3299 100644 --- a/ch_util/fluxcat.py +++ b/ch_util/fluxcat.py @@ -22,7 +22,7 @@ import time from caput import misc -from . import ephemeris +import caput.time as ctime # Define nominal frequency. Sources in catalog are ordered according to # their predicted flux density at this frequency. Also acts as default @@ -842,7 +842,7 @@ def skyfield(self): """Skyfield star representation :class:`skyfield.starlib.Star` for the source. """ - return ephemeris.skyfield_star_from_ra_dec(self.ra, self.dec, self.name) + return ctime.skyfield_star_from_ra_dec(self.ra, self.dec, self.name) @property def freq(self): diff --git a/ch_util/holography.py b/ch_util/holography.py index c74bfc5f..16ea84a8 100644 --- a/ch_util/holography.py +++ b/ch_util/holography.py @@ -19,6 +19,8 @@ import zipfile import numpy as np import peewee as pw + +import caput.time as ctime from chimedb.core.orm import base_model from ch_util import ephemeris @@ -109,9 +111,9 @@ def from_lst( start_time = ephemeris.lsa_to_unix( start_lst * 360 / 24, - ephemeris.datetime_to_unix(ephemeris.parse_date(start_day)), + ctime.datetime_to_unix(ephemeris.parse_date(start_day)), ) - duration_unix = duration_lst * (3600.0) * ephemeris.SIDEREAL_S + duration_unix = duration_lst * (3600.0) * ctime.SIDEREAL_S finish_time = start_time + duration_unix @@ -186,12 +188,12 @@ def parse_post_report(cls, post_report_file): Commanded duration of the observation in sidereal hours output_params['finish_time'] : skyfield time object Calculated UTC time at the end of the observation - Calculated as start_time + duration * ephemeris.SIDEREAL_S + Calculated as start_time + duration * caput.time.SIDEREAL_S """ import re - ts = ephemeris.skyfield_wrapper.timescale + ts = ctime.skyfield_wrapper.timescale output_params = {} @@ -221,9 +223,9 @@ def parse_post_report(cls, post_report_file): print("Missing", srcnm) output_params["src"] = srcnm - output_params["finish_time"] = ephemeris.unix_to_skyfield_time( - ephemeris.ensure_unix(output_params["start_time"]) - + output_params["DURATION"] * 3600.0 * ephemeris.SIDEREAL_S + output_params["finish_time"] = ctime.unix_to_skyfield_time( + ctime.ensure_unix(output_params["start_time"]) + + output_params["DURATION"] * 3600.0 * ctime.SIDEREAL_S ) output_params["quality_flag"] = QUALITY_GOOD @@ -260,7 +262,7 @@ def create_from_ant_logs( from caput.interferometry import sphdist from skyfield.positionlib import Angle - ts = ephemeris.skyfield_wrapper.timescale + ts = ctime.skyfield_wrapper.timescale DATE_FMT_STR = "%Y-%m-%d %H:%M:%S %z" pr_list, al_list = cls.parse_ant_logs(logs, return_post_report_params=True) @@ -407,9 +409,9 @@ def check_for_duplicates(t, src, start_tol, ignore_src_mismatch=False): If no duplicate is found: None """ - ts = ephemeris.skyfield_wrapper.timescale + ts = ctime.skyfield_wrapper.timescale - unixt = ephemeris.ensure_unix(t) + unixt = ctime.ensure_unix(t) dup_found = False @@ -420,7 +422,7 @@ def check_for_duplicates(t, src, start_tol, ignore_src_mismatch=False): if len(existing_db_entry) > 1: print("Multiple entries found.") for entry in existing_db_entry: - tt = ts.utc(ephemeris.unix_to_datetime(entry.start_time)) + tt = ts.utc(ctime.unix_to_datetime(entry.start_time)) # LST = GST + east longitude ttlst = np.mod(tt.gmst + DRAO_lon, 24.0) @@ -445,7 +447,7 @@ def check_for_duplicates(t, src, start_tol, ignore_src_mismatch=False): # check possible. if dup_found: - tf = ts.utc(ephemeris.unix_to_datetime(entry.finish_time)) + tf = ts.utc(ctime.unix_to_datetime(entry.finish_time)) print( "Tried to add : {} {}; LST={:.3f}".format( src.name, t.utc_datetime().strftime(DATE_FMT_STR), ttlst @@ -488,7 +490,7 @@ def check_for_duplicates(t, src, start_tol, ignore_src_mismatch=False): print( "Not replacing duplicate {} observation {}".format( entry.source.name, - ephemeris.unix_to_datetime(entry.start_time).strftime( + ctime.unix_to_datetime(entry.start_time).strftime( DATE_FMT_STR ), ) @@ -510,8 +512,8 @@ def check_for_duplicates(t, src, start_tol, ignore_src_mismatch=False): else: cls.create( source=dict["src"], - start_time=ephemeris.ensure_unix(dict["start_time"]), - finish_time=ephemeris.ensure_unix(dict["finish_time"]), + start_time=ctime.ensure_unix(dict["start_time"]), + finish_time=ctime.ensure_unix(dict["finish_time"]), quality_flag=dict["quality_flag"], notes=notes, ) @@ -560,7 +562,6 @@ def parse_ant_logs(cls, logs, return_post_report_params=False): """ from skyfield.positionlib import Angle - from caput import time as ctime DRAO_lon = ephemeris.CHIMELONGITUDE * 24.0 / 360.0 @@ -585,11 +586,9 @@ def sidlst_to_csd(sid, lst, sid_ref, t_ref): output : float CHIME sidereal day """ - csd_ref = int( - ephemeris.csd(ephemeris.datetime_to_unix(t_ref.utc_datetime())) - ) + csd_ref = int(ephemeris.csd(ctime.datetime_to_unix(t_ref.utc_datetime()))) csd = sid - sid_ref + csd_ref - return csd + lst / ephemeris.SIDEREAL_S / 24.0 + return csd + lst / ctime.SIDEREAL_S / 24.0 ant_data_list = [] post_report_list = [] @@ -702,13 +701,13 @@ def sidlst_to_csd(sid, lst, sid_ref, t_ref): post_report_params["start_time"], ) - ant_data["t"] = ephemeris.unix_to_skyfield_time( + ant_data["t"] = ctime.unix_to_skyfield_time( ephemeris.csd_to_unix(ant_data["csd"]) ) # Correct RA from equinox to CIRS coords (both in radians) era = np.radians( - ctime.unix_to_era(ephemeris.ensure_unix(ant_data["t"])) + ctime.unix_to_era(ctime.ensure_unix(ant_data["t"])) ) gast = ant_data["t"].gast * 2 * np.pi / 24.0 diff --git a/ch_util/layout.py b/ch_util/layout.py index ec4dbddb..ace97d09 100644 --- a/ch_util/layout.py +++ b/ch_util/layout.py @@ -138,6 +138,8 @@ import chimedb.core +import caput.time as ctime + _property = property # Do this since there is a class "property" in _db_tables. from ._db_tables import ( EVENT_AT, @@ -1465,10 +1467,8 @@ def global_flags_between(start_time, end_time, severity=None): """ - from . import ephemeris - - start_time = ephemeris.ensure_unix(start_time) - end_time = ephemeris.ensure_unix(end_time) + start_time = ctime.ensure_unix(start_time) + end_time = ctime.ensure_unix(end_time) query = global_flag.select() if severity: @@ -1481,15 +1481,14 @@ def global_flags_between(start_time, end_time, severity=None): # Add constraint for the start time query = query.join(ststamp, on=event.start).where( - ststamp.time < ephemeris.unix_to_datetime(end_time) + ststamp.time < ctime.unix_to_datetime(end_time) ) # Constrain the end time (being careful to deal with open events properly) query = ( query.switch(event) .join(etstamp, on=event.end, join_type=pw.JOIN.LEFT_OUTER) .where( - (etstamp.time > ephemeris.unix_to_datetime(start_time)) - | event.end.is_null() + (etstamp.time > ctime.unix_to_datetime(start_time)) | event.end.is_null() ) ) diff --git a/ch_util/plot.py b/ch_util/plot.py index dd7e1843..b16d4a4c 100644 --- a/ch_util/plot.py +++ b/ch_util/plot.py @@ -6,6 +6,9 @@ import warnings import datetime import scipy.signal as sig + +import caput.time as ctime + from . import andata from . import ephemeris @@ -406,8 +409,8 @@ def _full_day_shape(data, tmstp, date, n_bins=8640, axis="solar", ax=None): n_bins = int(n_bins) start_time = datetime.datetime(date[0], date[1], date[2], 8, 0, 0) # UTC-8 end_time = start_time + datetime.timedelta(days=1) - unix_start = ephemeris.datetime_to_unix(start_time) - unix_end = ephemeris.datetime_to_unix(end_time) + unix_start = ctime.datetime_to_unix(start_time) + unix_end = ctime.datetime_to_unix(end_time) print("Re-binning full day data to plot") if axis == "solar": @@ -430,8 +433,8 @@ def _full_day_shape(data, tmstp, date, n_bins=8640, axis="solar", ax=None): for ii in range(len(tmstp)): in_range = (tmstp[ii] > start_range[0]) and (tmstp[ii] < end_range[1]) if in_range: - sf_time = ephemeris.unix_to_skyfield_time(tmstp[ii]) - sun = ephemeris.skyfield_wrapper.ephemeris["sun"] + sf_time = ctime.unix_to_skyfield_time(tmstp[ii]) + sun = ctime.skyfield_wrapper.ephemeris["sun"] obs = ephemeris.chime.skyfield_obs().at(sf_time) azim = obs.observe(sun).apparent().altaz()[1].radians diff --git a/ch_util/timing.py b/ch_util/timing.py index b7d6ec3d..d6899030 100644 --- a/ch_util/timing.py +++ b/ch_util/timing.py @@ -58,8 +58,9 @@ import scipy.interpolate import scipy.optimize -from . import tools, andata, ephemeris, rfi +from . import tools, andata, rfi from caput import memh5, mpiarray, tod +import caput.time as ctime FREQ_TO_OMEGA = 2.0 * np.pi * 1e-6 FREQ_PIVOT = 600.0 @@ -579,8 +580,8 @@ def set_global_reference_time(self, tref, window=0.0, interpolate=False, **kwarg nearest to tref. The get_tau method is use to perform the interpolation, and kwargs for that method will be passed along. """ - tref = ephemeris.ensure_unix(tref) - tref_string = ephemeris.unix_to_datetime(tref).strftime("%Y-%m-%d %H:%M:%S %Z") + tref = ctime.ensure_unix(tref) + tref_string = ctime.unix_to_datetime(tref).strftime("%Y-%m-%d %H:%M:%S %Z") logger.info("Referencing timing correction with respect to %s." % tref_string) if window > 0.0: iref = np.flatnonzero( @@ -664,7 +665,7 @@ def set_reference_time( times nearest to tref. The get_tau method is use to perform the interpolation, and kwargs for that method will be passed along. """ - tref = np.atleast_1d(ephemeris.ensure_unix(tref)) + tref = np.atleast_1d(ctime.ensure_unix(tref)) if not interpolate: kwargs["interp"] = "nearest" @@ -673,7 +674,7 @@ def set_reference_time( alpha_ref, _ = self.get_alpha(tref, **kwargs) if tinit is not None: - tinit = ephemeris.ensure_unix(tinit) + tinit = ctime.ensure_unix(tinit) tau_init, _ = self.get_tau(tinit, ignore_amp=True, **kwargs) alpha_init, _ = self.get_alpha(tinit, **kwargs) @@ -702,11 +703,11 @@ def set_reference_time( tau_ref = np.concatenate((tau_init, tau_ref), axis=-1) alpha_ref = np.concatenate((alpha_init, alpha_ref), axis=-1) - tstart = np.atleast_1d(ephemeris.ensure_unix(tstart)) + tstart = np.atleast_1d(ctime.ensure_unix(tstart)) istart = np.digitize(self.time, tstart) if tend is not None: - tend = np.atleast_1d(ephemeris.ensure_unix(tend)) + tend = np.atleast_1d(ctime.ensure_unix(tend)) iend = np.digitize(self.time, tend) else: tend = tstart @@ -1783,12 +1784,12 @@ def load_timing_correction( raise RuntimeError("No timing acquisitions found on node %s." % node) # Determine the start time of the requested acquistion and the available timing acquisitions - acq_start = ephemeris.datetime_to_unix(ephemeris.timestr_to_datetime(acq_date)) + acq_start = ctime.datetime_to_unix(ctime.timestr_to_datetime(acq_date)) tacq_start = np.array( - [ephemeris.timestr_to_datetime(os.path.basename(tt)) for tt in tdirs] + [ctime.timestr_to_datetime(os.path.basename(tt)) for tt in tdirs] ) - tacq_start = ephemeris.datetime_to_unix(tacq_start) + tacq_start = ctime.datetime_to_unix(tacq_start) # Find the closest timing acquisition to the requested acquisition iclose = np.argmin(np.abs(acq_start - tacq_start)) diff --git a/ch_util/tools.py b/ch_util/tools.py index 996a33d9..c4dcc7e6 100644 --- a/ch_util/tools.py +++ b/ch_util/tools.py @@ -2254,8 +2254,9 @@ def fringestop_time( The frequencies in the array (in MHz). feeds : list of CorrInputs The feeds in the timestream. - src : ephem.FixedBody - A PyEphem object representing the source to fringestop. + src : skyfield source + skyfield.starlib.Star or skyfield.vectorlib.VectorSum or + skyfield.jpllib.ChebyshevPosition body representing the source. wterm: bool, optional Include elevation information in the calculation. bterm: bool, optional @@ -2341,8 +2342,9 @@ def decorrelation( The UNIX time of each sample, or (if csd=True), the CSD of each sample. feeds : list of CorrInputs The feeds in the timestream. - src : ephem.FixedBody - A PyEphem object representing the source to fringestop. + src : skyfield source + skyfield.starlib.Star or skyfield.vectorlib.VectorSum or + skyfield.jpllib.ChebyshevPosition body representing the source. wterm: bool, optional Include elevation information in the calculation. bterm: bool, optional @@ -2419,8 +2421,9 @@ def delay( The UNIX time of each sample, or (if csd=True), the CSD of each sample. feeds : list of CorrInputs The feeds in the timestream. - src : ephem.FixedBody - A PyEphem object representing the source to fringestop. + src : skyfield source + skyfield.starlib.Star or skyfield.vectorlib.VectorSum or + skyfield.jpllib.ChebyshevPosition body representing the source. wterm: bool, optional Include elevation information in the calculation. bterm: bool, optional