SuperDARN / pydarn

Python library for visualizing SuperDARN Data
GNU Lesser General Public License v3.0
31 stars 11 forks source link

EHN: Replace GSMR equation #356

Closed carleyjmartin closed 9 months ago

carleyjmartin commented 11 months ago

Scope

This pull request replaces the current equation to calculate the GSMR range estimate, and makes a new method for GSMR_BRISTOW which uses the older Bristow GSMR version. There is also a new warning when inf values are found during the Bristow equation method.

You can read the discussion of this issue at #257

issue: to close #257

Approval

Number of approvals: 2

Test

matplotlib version: 3.7.2 Note testers: please indicate what version of matplotlib you are using

import matplotlib.pyplot as plt 
import pydarn

file = "/Users/carley/Documents/data/20211102.0000.00.rkn.a.fitacf"
SDarn_read = pydarn.SuperDARNRead(file)
fitacf_data = SDarn_read.read_fitacf()

a = pydarn.RTP.plot_summary(fitacf_data, beam_num=2, range_estimation=pydarn.RangeEstimation.GSMR, watermark=False, title='New GSMR Eqn')
plt.show()
a = pydarn.RTP.plot_summary(fitacf_data, beam_num=2, range_estimation=pydarn.RangeEstimation.GSMR_BRISTOW, watermark=False, title='Old GSMR (GSMR_BRISTOW)')
plt.show()
a = pydarn.RTP.plot_summary(fitacf_data, beam_num=2, range_estimation=pydarn.RangeEstimation.SLANT_RANGE, watermark=False, title='Slant Range')
plt.show()

Will give: Screenshot 2023-09-14 at 12 01 04 PM Screenshot 2023-09-14 at 12 01 19 PM Screenshot 2023-09-14 at 12 01 31 PM

For now the warning message will not show up, warnings for summary plots are fixed in another PR.