Skip to content

Commit 9f3afed

Browse files
committed
removed redundant function
1 parent f2c2cb2 commit 9f3afed

1 file changed

Lines changed: 4 additions & 26 deletions

File tree

imap_processing/lo/l1c/lo_l1c.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
frame_transform_az_el,
2424
get_spacecraft_to_instrument_spin_phase_offset,
2525
lo_instrument_pointing,
26+
spherical_to_cartesian,
2627
)
2728
from imap_processing.spice.repoint import get_pointing_times
2829
from imap_processing.spice.spin import get_spin_data, get_spin_number
@@ -1262,36 +1263,13 @@ def create_ra_dec(
12621263
ecl_lats : list of float
12631264
Ecliptic latitude (degrees) for each of the 60 bin centers.
12641265
"""
1265-
1266-
def radec2cart(ra: float, colatitude_deg: float) -> np.ndarray:
1267-
"""
1268-
Convert right ascension and colatitude to a Cartesian unit vector.
1269-
1270-
Parameters
1271-
----------
1272-
ra : float
1273-
Right ascension in degrees.
1274-
colatitude_deg : float
1275-
Colatitude (90° − latitude) in degrees.
1276-
1277-
Returns
1278-
-------
1279-
np.ndarray
1280-
3-element unit vector [x, y, z].
1281-
"""
1282-
x = np.cos(np.radians(ra)) * np.sin(np.radians(colatitude_deg))
1283-
y = np.sin(np.radians(ra)) * np.sin(np.radians(colatitude_deg))
1284-
z = np.cos(np.radians(colatitude_deg))
1285-
1286-
return np.array([x, y, z])
1287-
1288-
spin_colatitude_deg = 90.0 - spin_ecl_lat
1289-
12901266
pivot_angle_rad = np.radians(pivot_angle)
12911267

12921268
# In ECLIPJ2000 the NEP is [0, 0, 1].
12931269
nep_unit = np.array([0.0, 0.0, 1.0])
1294-
spin_axis_unit = radec2cart(spin_ecl_lon, spin_colatitude_deg)
1270+
spin_axis_unit = spherical_to_cartesian(
1271+
np.array([[1.0, spin_ecl_lon, spin_ecl_lat]])
1272+
)[0]
12951273
spin_axis_unit /= np.linalg.norm(spin_axis_unit)
12961274

12971275
# Build a right-handed frame in the plane perpendicular to the spin axis,

0 commit comments

Comments
 (0)