Skip to content
Snippets Groups Projects

simple ipp model

Closed Maaijke Mevius requested to merge ipp_calculation into main
All threads resolved!
1 file
+ 9
5
Compare changes
  • Side-by-side
  • Inline
@@ -45,6 +45,8 @@ def get_ipp_from_skycoord(
IPP
Ionospheric piercepoints
"""
# Note: at the moment we calculate ipp per station. I think this is ok,
# but maybe we need to include a many stations option
aa = AltAz(location=loc, obstime=times)
altaz = source.transform_to(aa)
return get_ipp_from_altaz(loc, altaz, height_array)
@@ -80,7 +82,7 @@ def _get_ipp_simple(
height_array: u.Quantity, loc: EarthLocation, los_dir: SkyCoord
) -> list[u.Quantity]:
"""helper function to calculate ionospheric piercepoints using a simple spherical earth model
|loc + alphas * los_dir| = r_earth + height_array, solve for alphas using abc formula
Parameters
----------
height_array : u.Quantity
@@ -96,10 +98,12 @@ def _get_ipp_simple(
ipp.x, ipp.y, ipp.z positions
"""
c_value = r_earth**2 - (r_earth + height_array) ** 2
ipp_vector = los_dir.cartesian[np.newaxis] * height_array[:, np.newaxis]
b_value = np.sqrt(
loc.x * ipp_vector.x + loc.y * ipp_vector.y + loc.z * ipp_vector.z
) # inproduct
ipp_vector = los_dir.cartesian[np.newaxis] # unit vector
b_value = (
loc.x * ipp_vector.x.value
+ loc.y * ipp_vector.y.value
+ loc.z * ipp_vector.z.value
)[np.newaxis] # inproduct, add axis for altitudes
alphas = -b_value + np.sqrt(b_value**2 - c_value[:, np.newaxis])
return [
loc.x + alphas * los_dir.x,
Loading