Skip to content

Commit

Permalink
new range estimation, move gsmr eqn to gsmr_bristow
Browse files Browse the repository at this point in the history
  • Loading branch information
carleyjmartin committed Jul 25, 2023
1 parent f952996 commit 070baec
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pydarn/plotting/rtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,8 @@ def plot_summary(cls, dmap_data: List[dict],
axes[i].set_ylabel('Slant Range (km)')
elif range_estimation == RangeEstimation.GSMR:
axes[i].set_ylabel('Ground Scatter\nMapped Range\n(km)')
elif range_estimation == RangeEstimation.GSMR_BRISTOW:
axes[i].set_ylabel('Ground Scatter\nMapped Range\n(km)')
elif range_estimation == RangeEstimation.HALF_SLANT:
axes[i].set_ylabel('Slant Range/2\n(km)')
else:
Expand Down
33 changes: 32 additions & 1 deletion pydarn/utils/range_estimations.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def gate2halfslant(**kwargs):
return half_slant


def gate2groundscatter(reflection_height: float = 250, **kwargs):
def gate2gs_bristow(reflection_height: float = 250, **kwargs):
"""
Calculate the ground scatter mapped range (km) for each slanted range
for SuperDARN data. This function is based on the Ground Scatter equation
Expand All @@ -62,6 +62,36 @@ def gate2groundscatter(reflection_height: float = 250, **kwargs):
return ground_scatter_mapped_ranges


def gate2groundscatter(reflection_height: float = 250, hop: float = 0.5,
**kwargs):
"""
Calculate the ground scatter mapped range (km) for each slanted range
for SuperDARN data. This function is based on the Ground Scatter equation
discussed in the issue github.com/SuperDARN/pydarn/issues/257
Parameters
----------
reflection_height: float
reflection height
default: 250
hop: float
hop numberof returning data
default: 0.5
Returns
-------
ground_scatter_mapped_ranges : np.array
returns an array of ground scatter mapped ranges for the radar
"""
slant_ranges = gate2slant(**kwargs)

num = - Re**2 - (Re + reflection_height)**2\
+ (slant_ranges * (0.5 / hop))**2
den = 2 * Re * (Re + reflection_height)
ground_scatter_mapped_ranges = (hop/0.5) * Re * np.arccos( - num / den )

return ground_scatter_mapped_ranges


def gate2slant(rxrise: int = 0, range_gate: int = 0, frang: int = 180,
rsep: int = 45, nrang: int = None, center: bool = True,
**kwargs):
Expand Down Expand Up @@ -139,6 +169,7 @@ class RangeEstimation(enum.Enum):
SLANT_RANGE = (gate2slant,)
HALF_SLANT = (gate2halfslant,)
GSMR = (gate2groundscatter,)
GSMR_BRISTOW = (gate2gs_bristow,)

# Need this to make the functions callable
def __call__(self, *args, **kwargs):
Expand Down

0 comments on commit 070baec

Please sign in to comment.