s2d2.orbit_tools

Module Contents

Functions

wgs84_param(→ tuple[float, float])

get paramters of the WGS84 ellipsoid

earth_eccentricity(→ float)

get the eccentricity of the WGS84 ellipsoid

earth_axes(→ tuple[float, float])

get axis length of the WGS84 ellipsoid

standard_gravity(→ float)

provide value for the standard gravitational parameter of the Earth

transform_rpy_xyz2ocs(xyz, uvw, roll, pitch, yaw, ...)

estimate_inclination_via_xyz_uvw(xyz, uvw)

calculate_correct_mapping(grid[, inclination, ...])

param grid:

remap_observation_angles(lat, lon, radius, ...)

get_absolute_timing(lat, lon, sat_dict)

acquisition_angles(→ tuple[numpy.ndarray, numpy.ndarray])

given satellite and ground coordinates, estimate observation angles

line_of_sight(→ tuple[numpy.ndarray, numpy.ndarray])

param lat_arr:

location of observation angles

ground_vec(→ numpy.ndarray)

get ground coordinates in Cartesian system

_make_timing_system(ok, x, y, l_time)

time_fitting(l_time, az_arr, zn_arr, bnd, det, x, y, ...)

orbital_fitting(sat, g_x, inclination[, lat, lon, ...])

param sat:

observation vector from ground location towards the satellite

_omega_lon_calculation(lat, lon, inclination)

param lat:

location on the Earth

_gc_calculation(ltime, period, inclination, omega_0, lon_0)

orbital_calculation(ltime, radius, inclination, ...)

observation_calculation(ltime, sat, g_x, radius, ...)

param ltime:

_pert_param(idx, pert, *args)

perterp one of the arguments

partial_obs(ltime, sat, g_x, lat, lon, radius, ...)

numerical differentiation, via pertubation of the observation vector

partial_tim(ltime, sat, g_x, lat, lon, radius, ...[, ...])

s2d2.orbit_tools.wgs84_param() tuple[float, float][source]

get paramters of the WGS84 ellipsoid

Returns:

  • major_axis (float, unit=meter) – largest axis of the ellipsoid

  • flattening (float) – amount of compression of the ellipsoid

Notes

The flattening (f) stem from the major- (a) en minor-axis (b) via:

\[f = (a - b)/a\]

or via the eccentricity (e):

\[f = 1 - \sqrt{ 1 - e^2}\]
s2d2.orbit_tools.earth_eccentricity() float[source]

get the eccentricity of the WGS84 ellipsoid

Returns:

eccentricity – amount of deviation from circularity

Return type:

float

s2d2.orbit_tools.earth_axes() tuple[float, float][source]

get axis length of the WGS84 ellipsoid

Returns:

  • major_axis (float, unit=meter) – the largest axis of the ellipsoid

  • minor_axis (float, unit=meter) – the shortest axis of the ellipsoid

s2d2.orbit_tools.standard_gravity() float[source]

provide value for the standard gravitational parameter of the Earth

Returns:

mu – standard gravity

Return type:

float, unit= m**3 * s**-2

s2d2.orbit_tools.transform_rpy_xyz2ocs(xyz, uvw, roll, pitch, yaw, xyz_time, ang_time)[source]
s2d2.orbit_tools.estimate_inclination_via_xyz_uvw(xyz, uvw)[source]
s2d2.orbit_tools.calculate_correct_mapping(grid: s2d2.sentinel2_grid.Sentinel2Anglegrid, inclination: float = 98.5621, revolutions_per_day: float = 14.30824258387262, radius: float | None = None, mean_altitude: float | None = None)[source]
Parameters:
  • grid (Sentinel2Anglegrid) –

    with the following entries:
    • zenith{numpy.ndarray, numpy.masked.array}, size=(k,l,h)

      observation angles of the different detectors/bands

    • azimuth{numpy.ndarray, numpy.masked.array}, size=(k,l,h)

      observation angles of the different detectors/bands

    • bandnumpy.ndarray, size=(h,)

      number of the band, corresponding to the third dimension of ‘zenith’

    • detectornumpy.ndarray, size=(h,)

      number of the detector, corresponding to the third dimension of ‘zenith’

    • geotransformtuple, size=(6,)

      geotransform of the grid of ‘zenit’ and ‘azimuth’

    • crsosgeo.osr.SpatialReference() object

      coordinate reference system (CRS)

  • inclination (float, unit=degrees) – angle of the orbital plane in relation to the equatorial plane

  • revolutions_per_day (float) – amount of revolutions a satellite platform performs around the Earth

  • mean_altitude (float, unit=meter) – estimate of mean satellite altitude above the Earth surface

Returns:

  • l_time (numpy.ndarray, size=(p,), unit=seconds) – asd

  • lat, lon (float, unit=degrees) – ground location of the satelite at time 0

  • radius (float, unit=metre) – distance away from Earths’ center

  • inclination (unit=degrees) – tilt of the orbital plane in relation to the equator

  • period (float, unit=seconds) – time it takes to complete one revolution

  • time_para (numpy.ndarray, size=(p,b)) – polynomial fitting parameters for the different bands (b)

  • combos (numpy.ndarray, size=(h,2)) – combinations of band and detector pairs, corresponding to the third dimension of ‘grid.zenith’

s2d2.orbit_tools.remap_observation_angles(lat, lon, radius, inclination, period, time_para, combos, x_grd, y_grd, det_stack, bnd_list, geotransform, crs)[source]
s2d2.orbit_tools.get_absolute_timing(lat, lon, sat_dict)[source]
s2d2.orbit_tools.acquisition_angles(p_x: numpy.ndarray, g_x: numpy.ndarray) tuple[numpy.ndarray, numpy.ndarray][source]

given satellite and ground coordinates, estimate observation angles

s2d2.orbit_tools.line_of_sight(lat_arr: numpy.ndarray, lon_arr: numpy.ndarray, zn_arr: numpy.ndarray, az_arr: numpy.ndarray, eccentricity: float | None = None, major_axis: float | None = None) tuple[numpy.ndarray, numpy.ndarray][source]
Parameters:
  • lat_arr (numpy.ndarray, size=(m,n), unit=degrees) – location of observation angles

  • lon_arr (numpy.ndarray, size=(m,n), unit=degrees) – location of observation angles

  • zn_arr (numpy.ndarray, size=(m,n), unit=degrees) – polar angles of line of sight to the satellite, also known as, delcination and right ascension.

  • az_arr (numpy.ndarray, size=(m,n), unit=degrees) – polar angles of line of sight to the satellite, also known as, delcination and right ascension.

  • eccentricity (float) – eccentricity squared, if None default is WGS84 (6.69E-10)

  • major_axis (float, unit=meters) – length of the major axis, if None default is WGS84 (6.37E6)

Returns:

  • sat (numpy.ndarray, size=(m*n,3)) – observation vector from ground location towards the satellite

  • g_x (numpy.ndarray, size=(m*n,3)) – ground location in Cartesian coordinates

s2d2.orbit_tools.ground_vec(lat_arr: numpy.ndarray, lon_arr: numpy.ndarray, eccentricity: float | None = None, major_axis: float | None = None) numpy.ndarray[source]

get ground coordinates in Cartesian system

Parameters:
  • lat_arr (numpy.ndarray, size=(m,n), unit=degrees) – location of observation angles

  • lon_arr (numpy.ndarray, size=(m,n), unit=degrees) – location of observation angles

  • eccentricity (float) – eccentricity squared, if None default is WGS84 (6.69E-10)

  • major_axis (float, unit=meters) – length of the major axis, if None default is WGS84 (6.37E6)

Returns:

g_x – ground location in Cartesian coordinates

Return type:

numpy.ndarray, size=(m*n,3)

s2d2.orbit_tools._make_timing_system(ok, x, y, l_time)[source]
s2d2.orbit_tools.time_fitting(l_time, az_arr, zn_arr, bnd, det, x, y, geotransform)[source]
s2d2.orbit_tools.orbital_fitting(sat, g_x, inclination, lat=None, lon=None, radius=None, period=None, revolutions_per_day=None, mean_altitude=None, gps=None, convtol=0.001, orbtol=1.0, maxiter=20, printing=False)[source]
Parameters:
  • sat (numpy.ndarray, size=(m*n,3)) – observation vector from ground location towards the satellite

  • g_x (numpy.ndarray, size=(m*n,3)) – ground location in Cartesian coordinates

  • lat (float, unit=degrees) – location of satellite within orbital track

  • lon (float, unit=degrees) – location of satellite within orbital track

  • radius (float, unit=meter) – radius towards the orbiting satellite

  • inclination (float, unit=degrees, range=-180...+180) – inclination of the orbital plane with the equatorial plane

  • period (float, unit=seconds) – time it takes to revolve one time around the Earth

s2d2.orbit_tools._omega_lon_calculation(lat, lon, inclination)[source]
Parameters:
  • lat ({float, numpy.array}, unit=radians) – location on the Earth

  • lon ({float, numpy.array}, unit=radians) – location on the Earth

  • inclination ({float, numpy.array}, unit=radians) – angle of the orbital plane i.r.t. the equator

s2d2.orbit_tools._gc_calculation(ltime, period, inclination, omega_0, lon_0)[source]
s2d2.orbit_tools.orbital_calculation(ltime, radius, inclination, period, omega_0, lon_0)[source]
s2d2.orbit_tools.observation_calculation(ltime, sat, g_x, radius, inclination, period, omega_0, lon_0)[source]
Parameters:
  • ltime (numpy.array, size=(m,1)) –

  • sat (numpy.ndarray, size=(m,3)) – observation vector from ground location towards the satellite

  • g_x (numpy.ndarray, size=(m,3)) – ground location in Cartesian coordinates

  • radius (float, unit=meter) – radius towards the orbiting satellite

  • inclination (float, unit=degrees, range=-180...+180) – inclination of the orbital plane with the equator

  • period (float, unit=seconds) – time it takes to revolve one time around the Earth

  • omega_0 (float, unit=degrees) – angle towards ascending node, one of the orbit Euler angles

  • lon_0 (float, unit=degrees) – ephemeris longitude

Returns:

v_x

Return type:

numpy.array, size=(m,3)

s2d2.orbit_tools._pert_param(idx, pert, *args)[source]

perterp one of the arguments

Parameters:
  • idx (integer, range=0...m-1) – index which of the arguments should be perturbed

  • pert ({float, numpy.array}) – amount of pertubation

  • args (tuple, size=m) – tuple with different arguments, with datatypes like arrays or floats

Returns:

args – tuple with different arguments, with datatypes like arrays or floats

Return type:

tuple, size=m

s2d2.orbit_tools.partial_obs(ltime, sat, g_x, lat, lon, radius, inclination, period)[source]

numerical differentiation, via pertubation of the observation vector

s2d2.orbit_tools.partial_tim(ltime, sat, g_x, lat, lon, radius, inclination, period, pertubation=0.1)[source]