pysat / pysatSeasons

Seasonal Analysis routines for pysat
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Impacts from Occurrence Probability #33

Open rstoneback opened 2 years ago

rstoneback commented 2 years ago

Describe the bug Running Occurrence probability analysis leaves Instrument object on last day. If a user tries to run it again, it won't work. Already at end of bounds.

To Reproduce Steps to reproduce the behavior:

#  Orbit breakdown info
orbit_info = {'kind': 'lt', 'index':'Magnetic_Local_Time'}

# We will employ a centered time-based calculation. Engage pysat's data padding.
pad = pds.DateOffset(seconds=30)

# Instantiate IVM instrument data and 
ivm = pysat.Instrument('icon', 'ivm', inst_id='a', orbit_info=orbit_info,
                       pad=pad)

# Set the range of dates for the analysis
ivm.bounds = (dt.datetime(2020, 1, 1), dt.datetime(2020, 1, 15))

answer = pysatSeasons.occur_prob.by_orbit2D(ivm, [0, 360, 24], 'Longitude',
                                            [-20, 20, 10], 'Magnetic_Latitude',
                                            ['Ion_Density'], [7.E3], returnBins=True)

answer = pysatSeasons.occur_prob.by_orbit2D(ivm, [0, 360, 24], 'Longitude',
                                            [-20, 20, 10], 'Magnetic_Latitude',
                                            ['Ion_Density'], [7.E3], returnBins=True)

Expected behavior Running it twice should yield the same result, twice.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.