SuperDARN / pydarn

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

Lmfit2 Autoscaling #27

Closed mts299 closed 3 years ago

mts299 commented 4 years ago

As mentioned in #24 the scaling gets messed up when using lmfit2 data:

import pydarn
import matplotlib.pyplot as plt 

fitacf_file = "20120614.0401.1200.sas.lmfit2"
darn_read = pydarn.SDarnRead(fitacf_file)
fitacf_data = darn_read.read_fitacf()

filts = {'min_scalar_filter':{'tfreq': 12500}}
fig = plt.figure(figsize=(10,8))
ax1 = fig.add_subplot(111)
pydarn.RTP.plot_range_time(fitacf_data, parameter='p_l',
                           beam_num=12, ax=ax1,
                           filter_settings=filts)

lmfit_data_scaling

mts299 commented 4 years ago

@asreimer I noticed the zmin = -Inf when you get pydarn to print out the values. One fix and I already implemented it is to check if zmin zmax is infinity then throw an error suggesting the user to use zmin and zmax options.

The error looks like this:

Traceback (most recent call last):
  File "summary_plot.py", line 16, in <module>
    filter_settings=filts)
  File "/usr/lib/python3.6/site-packages/pydarn-0.1.dev0-py3.6.egg/pydarn/plotting/rtp.py", line 323, in plot_range_time
    'zmin', zmin)
pydarn.exceptions.rtp_exceptions.RTPInfinityError: zmin is set to -inf for parameter p_l and beam number 12, please use zmin or zmax options to set lower or upper boundary.

Does this satisfy your problem?