diff --git a/zodipy/bodies.py b/zodipy/bodies.py index d2ea1a3..cc8b590 100644 --- a/zodipy/bodies.py +++ b/zodipy/bodies.py @@ -13,13 +13,13 @@ MEAN_DIST_TO_L2 = 0.009896235034000056 -def get_interp_obstimes(t0: float, t1: float) -> time.Time: +def arrange_obstimes(t0: float, t1: float) -> time.Time: """Return a subset of the obstimes used to interpolate in body positions.""" dt = (1 * units.hour).to_value(units.day) return time.Time(np.arange(t0, t1 + dt, dt), format="mjd") -def get_interpolated_bodypos( +def get_interp_bodypos( body: str, obstimes: npt.NDArray[np.float64], interp_obstimes: time.Time, @@ -62,7 +62,7 @@ def get_earthpos_inst( ).flatten() -def get_obspos_from_str( +def get_obspos_from_body( body: str, obstime: time.Time, interp_obstimes: time.Time | None, @@ -91,7 +91,7 @@ def get_obspos_from_str( msg = "interp_obstimes must be provided when obstime is an array." raise ValueError(msg) - return get_interpolated_bodypos( + return get_interp_bodypos( body=body, obstimes=obstime.mjd, interp_obstimes=interp_obstimes, diff --git a/zodipy/line_of_sight.py b/zodipy/line_of_sight.py index 868455f..ed204c9 100644 --- a/zodipy/line_of_sight.py +++ b/zodipy/line_of_sight.py @@ -85,7 +85,7 @@ def get_sphere_intersection( return np.maximum(q, c / q) -def get_line_of_sight_range_dicts( +def get_line_of_sight_range( components: Iterable[ComponentLabel], unit_vectors: npt.NDArray[np.float64], obs_pos: npt.NDArray[np.float64], diff --git a/zodipy/model.py b/zodipy/model.py index c24517b..39df51c 100644 --- a/zodipy/model.py +++ b/zodipy/model.py @@ -13,14 +13,14 @@ from zodipy.blackbody import tabulate_blackbody_emission from zodipy.bodies import ( + arrange_obstimes, get_earthpos_inst, - get_interp_obstimes, - get_interpolated_bodypos, - get_obspos_from_str, + get_interp_bodypos, + get_obspos_from_body, ) from zodipy.component import ComponentLabel from zodipy.line_of_sight import ( - get_line_of_sight_range_dicts, + get_line_of_sight_range, integrate_leggauss, ) from zodipy.model_registry import model_registry @@ -177,7 +177,7 @@ def evaluate( if skycoord.obstime.size == 1: interp_obstimes = None else: - interp_obstimes = get_interp_obstimes(skycoord.obstime[0].mjd, skycoord.obstime[-1].mjd) + interp_obstimes = arrange_obstimes(skycoord.obstime[0].mjd, skycoord.obstime[-1].mjd) dist_coords_to_cores = skycoord.size > nprocesses and nprocesses > 1 if dist_coords_to_cores: @@ -212,7 +212,7 @@ def _evaluate( if interp_obstimes is None: earth_xyz = get_earthpos_inst(skycoord.obstime, self._ephemeris) else: - earth_xyz = get_interpolated_bodypos( + earth_xyz = get_interp_bodypos( body="earth", obstimes=skycoord.obstime.mjd, interp_obstimes=interp_obstimes, @@ -220,7 +220,7 @@ def _evaluate( ) if isinstance(obspos, str): - obs_xyz = get_obspos_from_str( + obs_xyz = get_obspos_from_body( body=obspos, obstime=skycoord.obstime, interp_obstimes=interp_obstimes, @@ -250,7 +250,7 @@ def _evaluate( if skycoord.isscalar: skycoord_xyz = skycoord.cartesian.xyz.value[:, np.newaxis] - start, stop = get_line_of_sight_range_dicts( + start, stop = get_line_of_sight_range( components=self._ipd_model.comps.keys(), unit_vectors=skycoord_xyz, obs_pos=obs_xyz,