Skip to content

Commit

Permalink
bepi data now correctly time-centered
Browse files Browse the repository at this point in the history
  • Loading branch information
jgieseler committed Aug 30, 2024
1 parent d87a4bd commit f23b00f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
25 changes: 7 additions & 18 deletions seppy/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,13 @@ def bepicolombo_sixs_stack(path, date, side, pos_timestamp='center'):
df.index = np.array(times)
df = df.drop(columns=['TimeUTC'])

# TODO: (as it's not really nicely done so far)
# careful!
# adjusting the position of the timestamp manually.
# requires knowledge of the original time resolution and timestamp position!
if type(date) is datetime.datetime:
change_date = pd.Timestamp(2022, 8, 29)
elif type(date) is datetime.date:
change_date = pd.Timestamp(2022, 8, 29).date()
if date < change_date:
cadence = 8
elif date >= change_date:
cadence = 24
#
if pos_timestamp == 'center':
df.index = df.index+pd.Timedelta(f'{cadence/2}s')
# warnings.warn("Assuming cadence of 8s before 2022-08-29 and 24s after!")
custom_warning("Assuming cadence of 8s before 2022-08-29 and 24s after!")
elif pos_timestamp == 'start':
if pos_timestamp == 'start':
cadence1 = (df.index[1]-df.index[0]).seconds
cadence2 = (df.index[-1]-df.index[-2]).seconds
if cadence1 != cadence2:
custom_warning("Bepi/SIXS cadence is changing throughout the day; something is wrong!")
df.index = df.index-pd.Timedelta(f'{cadence1/2}s')
elif pos_timestamp == 'center':
pass
except FileNotFoundError:
print(f'Unable to open {filename}')
Expand Down
2 changes: 1 addition & 1 deletion seppy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from setuptools_scm import get_version
__version__ = get_version(root='..', relative_to=__file__)
except Exception:
__version__ = '0.1.15'
__version__ = '0.1.16'

0 comments on commit f23b00f

Please sign in to comment.