orbits-lib/resources/orbits/orbit.rb
def coord_crossing_range(coord, ascending)
      # If the point is above the max coverage `phi`, there's no coverage
      return LongitudeCoverage.none if coord.phi.abs > max_coverage_phi

      # If the point is above the full coverage `phi`, it's covered by every pass
      return LongitudeCoverage.full if coord.phi.abs > full_coverage_phi

      # We start by figuring out how wide the swath is at the coordinate,
      # along the longitude lines.  This is different from the orbit's
      # swath width parameter, because the measurement runs parallel to
      # the equator, not perpendicular to the orbit.
      west_edge, east_edge = *horizontal_swath_edges(coord, ascending)

      # If the swath has no edges at the coordinate, there's no coverage
      return LongitudeCoverage.none if west_edge.nil? || east_edge.nil?

      # TODO one edge may pass over the equator before the other, and the
      #      Earth will rotate in the mean time, which will skew the
      #      longitude range slightly.  The NSIDC site mentions this, but
      #      the Java code doesn't account for it.

      # This part is a little tricky.  The swath area to the west of the point
      # is covered by a range of orbits to the east of the point, so we use
      # the west swath edge to calculate the range of orbits crossing to the
      # east and vice versa.
      west_width = west_edge.theta - coord.theta
      east_target = Coordinate.phi_theta(coord.phi, coord.theta - west_width)

      east_width = east_edge.theta - coord.theta
      west_target = Coordinate.phi_theta(coord.phi, coord.theta - east_width)

      # Figure out where the orbits through each of our targets cross the
      # equator, compensating for the Earth's rotation (the boolean true value).
      min_crossing = equator_crossing(west_target, ascending, true).theta
      max_crossing = equator_crossing(east_target, ascending, true).theta

      # Construct and return a coverage object
      LongitudeCoverage.new(min_crossing, max_crossing)
    end
##### coord_crossing_range
#
# This method performs the Backtrack Orbit Search Algorithm.
#
# Given a coordinate, returns a range of longitudes.  Orbital passes
# which cross the equator within the returned range will cover the
# given coordinate with their swath.
#
# Parameters:
# * **coord** - The coordinate whose equator crossing range we're
#   interested in (Orbit::Coordinate)
# * **ascending** - A boolean value.  If true, we return ranges
#   where the orbit crosses the equator on its ascending pass.  If
#   false, we return ranges where the orbit crosses the equator on
#   its descending pass.
#
# Returns an Orbit::LongitudeCoverage
coord_crossing_range
This method performs the Backtrack Orbit Search Algorithm.

Given a coordinate, returns a range of longitudes.  Orbital passes
which cross the equator within the returned range will cover the
given coordinate with their swath.

coord** - The coordinate whose equator crossing range we're
interested in (Orbit::Coordinate)
ascending** - A boolean value.  If true, we return ranges
where the orbit crosses the equator on its ascending pass.  If
false, we return ranges where the orbit crosses the equator on
its descending pass.


coord_crossing_range This method performs the Backtrack Orbit Search Algorithm . Given a coordinate returns a range of longitudes . Orbital passes which cross the equator within the returned range will cover the given coordinate with their swath . coord ** - The coordinate whose equator crossing range we ' re interested in ( Orbit :: Coordinate ) ascending ** - A boolean value . If true we return ranges where the orbit crosses the equator on its ascending pass . If false we return ranges where the orbit crosses the equator on its descending pass .
def coord_crossing_range(coord, ascending)
      return LongitudeCoverage.none if coord.phi.abs > max_coverage_phi
      return LongitudeCoverage.full if coord.phi.abs > full_coverage_phi
      west_edge, east_edge = *horizontal_swath_edges(coord, ascending)
      return LongitudeCoverage.none if west_edge.nil? || east_edge.nil?
      west_width = west_edge.theta - coord.theta
      east_target = Coordinate.phi_theta(coord.phi, coord.theta - west_width)
      east_width = east_edge.theta - coord.theta
      west_target = Coordinate.phi_theta(coord.phi, coord.theta - east_width)
      min_crossing = equator_crossing(west_target, ascending, true).theta
      max_crossing = equator_crossing(east_target, ascending, true).theta
      LongitudeCoverage.new(min_crossing, max_crossing)
    end
def coord_crossing_range ( coord , ascending ) return LongitudeCoverage . none if coord . phi . abs > max_coverage_phi return LongitudeCoverage . full if coord . phi . abs > full_coverage_phi west_edge , east_edge = * horizontal_swath_edges ( coord , ascending ) return LongitudeCoverage . none if west_edge . nil? || east_edge . nil? west_width = west_edge . theta - coord . theta east_target = Coordinate . phi_theta ( coord . phi , coord . theta - west_width ) east_width = east_edge . theta - coord . theta west_target = Coordinate . phi_theta ( coord . phi , coord . theta - east_width ) min_crossing = equator_crossing ( west_target , ascending , true ) . theta max_crossing = equator_crossing ( east_target , ascending , true ) . theta LongitudeCoverage . new ( min_crossing , max_crossing ) end
coord_crossing_range
This method performs the Backtrack Orbit Search Algorithm.
coord_crossing_range This method performs the Backtrack Orbit Search Algorithm .
# If the point is above the max coverage `phi`, there's no coverage # If the point is above the full coverage `phi`, it's covered by every pass # We start by figuring out how wide the swath is at the coordinate, # along the longitude lines.  This is different from the orbit's # swath width parameter, because the measurement runs parallel to # the equator, not perpendicular to the orbit. # If the swath has no edges at the coordinate, there's no coverage # TODO one edge may pass over the equator before the other, and the #      Earth will rotate in the mean time, which will skew the #      longitude range slightly.  The NSIDC site mentions this, but #      the Java code doesn't account for it. # This part is a little tricky.  The swath area to the west of the point # is covered by a range of orbits to the east of the point, so we use # the west swath edge to calculate the range of orbits crossing to the # east and vice versa. # Figure out where the orbits through each of our targets cross the # equator, compensating for the Earth's rotation (the boolean true value). # Construct and return a coverage object
coord
ascending