seppy 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of seppy might be problematic. Click here for more details.

seppy/tests/test_tools.py CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  from astropy.utils.data import get_pkg_data_filename
3
2
  from pathlib import Path
4
3
  from seppy.tools import Event
@@ -26,9 +25,9 @@ def test_onset_spectrum_tsa_SOLO_STEP_ions_old_data_online():
26
25
  assert isinstance(flux, pd.Series)
27
26
  assert flux.shape == (288,)
28
27
  assert len(onset_stats) == 6
29
- assert onset_stats[5].isoformat().split('.')[0] == '2020-09-21T17:27:32'
28
+ assert onset_stats[5].isoformat().split('.')[0] == '2020-09-21T17:27:37'
30
29
  assert onset_found
31
- assert peak_time.isoformat().split('.')[0] == '2020-09-21T17:57:32'
30
+ assert peak_time.isoformat().split('.')[0] == '2020-09-21T17:57:37'
32
31
  assert fig.get_axes()[0].get_title() == 'SOLO/STEP 0.0060 - 0.0091 MeV/n protons\n5min averaging, viewing: PIXEL AVERAGED'
33
32
  # Pixel 8 - check that calculation is stopped bc. this data is not implemented correctly!
34
33
  check = False
@@ -64,7 +63,7 @@ def test_onset_spectrum_tsa_SOLO_STEP_ions_new_data_online():
64
63
  assert len(onset_stats) == 6
65
64
  assert isinstance(onset_stats[5], pd._libs.tslibs.nattype.NaTType) # onset_stats[5].isoformat().split('.')[0] == '2021-10-28T16:07:30'
66
65
  assert ~onset_found
67
- assert peak_time.isoformat().split('.')[0] == '2022-01-09T01:32:30'
66
+ assert peak_time.isoformat().split('.')[0] == '2022-01-09T01:32:31'
68
67
  assert fig.get_axes()[0].get_title() == 'SOLO/STEP 0.0061 - 0.0091 MeV protons\n5min averaging, viewing: PIXEL AVERAGED'
69
68
  # Pixel 8
70
69
  flux, onset_stats, onset_found, peak_flux, peak_time, fig, bg_mean = Event1.find_onset(viewing='Pixel 8', background_range=background_range, channels=1, resample_period="5min", yscale='log', cusum_window=30)
@@ -73,7 +72,7 @@ def test_onset_spectrum_tsa_SOLO_STEP_ions_new_data_online():
73
72
  assert len(onset_stats) == 6
74
73
  assert isinstance(onset_stats[5], pd._libs.tslibs.nattype.NaTType) # onset_stats[5].isoformat().split('.')[0] == '2021-10-28T16:12:30'
75
74
  assert ~onset_found
76
- assert peak_time.isoformat().split('.')[0] == '2022-01-09T00:02:30'
75
+ assert peak_time.isoformat().split('.')[0] == '2022-01-09T00:02:31'
77
76
  assert fig.get_axes()[0].get_title() == 'SOLO/STEP 0.0061 - 0.0091 MeV protons\n5min averaging, viewing: PIXEL 8'
78
77
 
79
78
  # TODO: deactivated, as this function is deactivated atm:
@@ -103,7 +102,7 @@ def test_onset_spectrum_tsa_SOLO_HET_online():
103
102
  assert len(onset_stats) == 6
104
103
  assert isinstance(onset_stats[5], pd._libs.tslibs.nattype.NaTType) # onset_stats[5] == pd.Timestamp('2021-10-28 15:31:59.492059')
105
104
  assert ~onset_found
106
- assert peak_time.isoformat().split('.')[0] == '2022-11-08T17:57:54'
105
+ assert peak_time.isoformat().split('.')[0] == '2022-11-08T17:58:09'
107
106
  assert fig.get_axes()[0].get_title() == 'SOLO/HET 7.3540 - 7.8900 MeV protons\n5min averaging, viewing: SUN'
108
107
  # viewing "north", combined channel, electrons
109
108
  Event1 = Event(spacecraft='Solar Orbiter', sensor='HET', viewing='sun', data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath)
@@ -114,7 +113,7 @@ def test_onset_spectrum_tsa_SOLO_HET_online():
114
113
  assert len(onset_stats) == 6
115
114
  assert isinstance(onset_stats[5], pd._libs.tslibs.nattype.NaTType) # onset_stats[5] == pd.Timestamp('2021-10-28 15:31:59.492059')
116
115
  assert ~onset_found
117
- assert peak_time.isoformat().split('.')[0] == '2022-11-08T22:27:54'
116
+ assert peak_time.isoformat().split('.')[0] == '2022-11-08T22:27:56'
118
117
  assert fig.get_axes()[0].get_title() == 'SOLO/HET 0.4533 - 18.8300 MeV electrons\n5min averaging, viewing: NORTH'
119
118
 
120
119
  # test dynamic spectrum:
@@ -141,7 +140,7 @@ def test_onset_spectrum_tsa_SOLO_EPT_online():
141
140
  assert len(onset_stats) == 6
142
141
  assert isinstance(onset_stats[5], pd._libs.tslibs.nattype.NaTType) # onset_stats[5] == pd.Timestamp('2021-10-28 15:31:59.492059')
143
142
  assert ~onset_found
144
- assert peak_time.isoformat().split('.')[0] == '2022-06-06T01:02:30'
143
+ assert peak_time.isoformat().split('.')[0] == '2022-06-06T01:02:31'
145
144
  assert fig.get_axes()[0].get_title() == 'SOLO/EPT 0.0608 - 0.0678 MeV protons\n5min averaging, viewing: SUN'
146
145
  # viewing "north", combined channel, electrons
147
146
  Event1 = Event(spacecraft='Solar Orbiter', sensor='EPT', viewing='sun', data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath)
@@ -152,7 +151,7 @@ def test_onset_spectrum_tsa_SOLO_EPT_online():
152
151
  assert len(onset_stats) == 6
153
152
  assert isinstance(onset_stats[5], pd._libs.tslibs.nattype.NaTType) # onset_stats[5] == pd.Timestamp('2021-10-28 15:31:59.492059')
154
153
  assert ~onset_found
155
- assert peak_time.isoformat().split('.')[0] == '2022-06-06T23:02:30'
154
+ assert peak_time.isoformat().split('.')[0] == '2022-06-06T23:02:31'
156
155
  assert fig.get_axes()[0].get_title() == 'SOLO/EPT 0.0334 - 0.0439 MeV electrons\n5min averaging, viewing: NORTH'
157
156
 
158
157
  # test dynamic spectrum:
@@ -440,12 +439,15 @@ def test_onset_spectrum_tsa_SOHO_EPHIN_online():
440
439
  # no channel combination inlcuded for SOHO/EPHIN electrons, yet
441
440
 
442
441
  # test dynamic spectrum:
443
- check = False
444
- try:
445
- Event1.dynamic_spectrum(view=None)
446
- except Warning:
447
- check = True
448
- assert check
442
+ # check = False
443
+ # try:
444
+ # Event1.dynamic_spectrum(view=None)
445
+ # except Warning:
446
+ # check = True
447
+ # assert check
448
+ Event1.dynamic_spectrum(view=None)
449
+ assert Event1.fig.get_axes()[0].get_title() == 'SOHO/EPHIN electrons, 2021-10-28'
450
+
449
451
 
450
452
  # test tsa plot:
451
453
  plt.close('all') # in order to pick the right figure, make sure all previous are closed
@@ -515,3 +517,22 @@ def test_dynamic_spectrum_SOHO_ERNE_offline():
515
517
  Event1.dynamic_spectrum(view=None)
516
518
 
517
519
  assert Event1.fig.get_axes()[0].get_title() == 'SOHO/ERNE protons, 2021-10-28'
520
+
521
+
522
+ def test_onset_Bepi_SIXS_offline():
523
+ startdate = datetime.date(2023, 7, 19)
524
+ enddate = datetime.date(2023, 7, 19)
525
+ fullpath = get_pkg_data_filename('data/test/20230719_side1.csv', package='seppy')
526
+ lpath = Path(fullpath).parent.as_posix()
527
+ # lpath = '/home/jagies/data/bepi/bc_mpo_sixs/data_csv/cruise/sixs-p/raw'
528
+ Event1 = Event(spacecraft='Bepi', sensor='SIXS', data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath, viewing='1')
529
+ background_range = (datetime.datetime(2023, 7, 19, 0, 30, 0), datetime.datetime(2023, 7, 19, 1, 30, 0))
530
+ flux, onset_stats, onset_found, peak_flux, peak_time, fig, bg_mean = Event1.find_onset(viewing='1', background_range=background_range, channels=2, resample_period="1min", yscale='log', cusum_window=30)
531
+
532
+ assert isinstance(flux, pd.Series)
533
+ assert flux.shape == (161,)
534
+ assert len(onset_stats) == 6
535
+ assert isinstance(onset_stats[5], pd._libs.tslibs.nattype.NaTType)
536
+ assert ~onset_found
537
+ assert peak_time.isoformat().split('.')[0] == '2023-07-19T02:25:42'
538
+ assert fig.get_axes()[0].get_title() == 'BEPI/SIXS 106 keV electrons\n1min averaging, viewing: 1'
seppy/tools/__init__.py CHANGED
@@ -1616,8 +1616,13 @@ class Event:
1616
1616
  s_identifier = "protons"
1617
1617
  if instrument.lower() == "ephin":
1618
1618
  particle_data = self.current_df_e
1619
+ # Here drop the E300 channel altogether from the dataframe if the data is produced after Oct 4, 2017,
1620
+ # for it contains no valid data. Keyword axis==1 refers to the columns axis.
1621
+ if self.start_date > pd.to_datetime("2017-10-04").date():
1622
+ particle_data = particle_data.drop("E300", axis=1)
1623
+
1619
1624
  s_identifier = "electrons"
1620
- raise Warning('SOHO/EPHIN is not implemented yet in the dynamic spectrum tool!')
1625
+ # raise Warning('SOHO/EPHIN is not implemented yet in the dynamic spectrum tool!')
1621
1626
 
1622
1627
  if spacecraft == "psp":
1623
1628
  if instrument.lower() == "isois-epihi":
@@ -2302,11 +2307,11 @@ class Event:
2302
2307
  energy_ranges = self.current_energies["channels_dict_df_p"]["ch_strings"].values
2303
2308
  if self.sensor.lower() == "ephin":
2304
2309
  # Choose only the first 4 channels (E150, E300, E1300 and E3000)
2305
- # This are the only electron channels (rest p and He), and we
2310
+ # These are the only electron channels (rest are p and He), and we
2306
2311
  # use only electron data here.
2307
2312
  energy_ranges = [val for val in self.current_energies.values()][:4]
2308
2313
  if self.sensor.lower() in ("ephin-5", "ephin-15"):
2309
- energy_ranges = [value for key, value in self.current_energies.items()]
2314
+ energy_ranges = [value for _, value in self.current_energies.items()]
2310
2315
 
2311
2316
  if self.spacecraft == "psp":
2312
2317
  energy_dict = self.meta
seppy/version.py CHANGED
@@ -5,4 +5,4 @@ try:
5
5
  from setuptools_scm import get_version
6
6
  __version__ = get_version(root='..', relative_to=__file__)
7
7
  except Exception:
8
- __version__ = '0.1.13'
8
+ __version__ = '0.1.15'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: seppy
3
- Version: 0.1.13
3
+ Version: 0.1.15
4
4
  Summary: SEPpy
5
5
  Home-page: https://github.com/serpentine-h2020/SEPpy
6
6
  Author: Jan Gieseler
@@ -14,6 +14,8 @@ Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3.8
15
15
  Classifier: Programming Language :: Python :: 3.9
16
16
  Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
17
19
  Classifier: Topic :: Scientific/Engineering :: Physics
18
20
  Requires-Python: >=3.8
19
21
  License-File: licenses/LICENSE.rst
@@ -21,28 +23,23 @@ Requires-Dist: astropy
21
23
  Requires-Dist: astroquery
22
24
  Requires-Dist: bs4
23
25
  Requires-Dist: cdflib
24
- Requires-Dist: datetime
25
- Requires-Dist: drms
26
- Requires-Dist: h5netcdf
27
- Requires-Dist: ipykernel
28
26
  Requires-Dist: ipywidgets
29
- Requires-Dist: lxml
30
27
  Requires-Dist: matplotlib
28
+ Requires-Dist: mpl-animators>=1.0.0
31
29
  Requires-Dist: numpy
32
30
  Requires-Dist: pandas
33
31
  Requires-Dist: pooch
34
32
  Requires-Dist: requests
35
33
  Requires-Dist: solo-epd-loader
36
- Requires-Dist: sunpy >=4.1.0
37
- Requires-Dist: zeep
34
+ Requires-Dist: sunpy>=4.1.0
38
35
  Provides-Extra: all
39
36
  Provides-Extra: docs
40
- Requires-Dist: sphinx ; extra == 'docs'
41
- Requires-Dist: sphinx-automodapi ; extra == 'docs'
37
+ Requires-Dist: sphinx; extra == "docs"
38
+ Requires-Dist: sphinx-automodapi; extra == "docs"
42
39
  Provides-Extra: test
43
- Requires-Dist: pytest ; extra == 'test'
44
- Requires-Dist: pytest-doctestplus ; extra == 'test'
45
- Requires-Dist: pytest-cov ; extra == 'test'
40
+ Requires-Dist: pytest; extra == "test"
41
+ Requires-Dist: pytest-doctestplus; extra == "test"
42
+ Requires-Dist: pytest-cov; extra == "test"
46
43
 
47
44
  seppy
48
45
  =====
@@ -1,7 +1,9 @@
1
1
  seppy/__init__.py,sha256=M8ZBbGj0r_XdNVLzaSXF38M4wyzAgUX32LXcSYh5O5A,254
2
- seppy/version.py,sha256=8Iy3vCG3vhcccNaZYD_PmgkO2Pa648hsFWtY-EcVMeY,346
2
+ seppy/version.py,sha256=86lr4VUTfCM5Saeoz0h6DkiA3FNlIbon3BsAepb63G0,346
3
+ seppy/data/test/20230719_side0.csv,sha256=0htTQcdQydRc92bkO26lxK8tDRSeN6uov13VfsqmUFQ,72368
4
+ seppy/data/test/20230719_side1.csv,sha256=iHCfHmOIltJatncWpns_zq3ym_-2yRu0twmDvQDbmJw,72368
5
+ seppy/data/test/20230719_side2.csv,sha256=eYyEQX5fNDO4E57KwKN3bHs6u5-lHaAhIHt-3f20Urg,72368
3
6
  seppy/data/test/epi21106.rl2,sha256=Fhq5A5D1pKqEfV9mx6T8tjEei4HmSfmWBR0XaLJl_JI,180858
4
- seppy/data/test/psp_isois-epihi_l2-het-rates60_20210531_v15.cdf,sha256=u0XcZ9SpocPwuKAmu7w2qDU_yLXxg3eyf0VXvayWlT4,401828
5
7
  seppy/data/test/sept_ahead_ele_sun_2006_318_1min_l2_v03.dat,sha256=ReZ7cvIcC4Z_nDJ-oJQ7lsKSziA_qlZsAG74F5n3M2o,167882
6
8
  seppy/data/test/soho_erne-hed_l2-1min_20211028_v01.cdf,sha256=RX1XX6eQevCuXqc1tTAEjPsXtlgbDeP2DsmRFVbsGwg,278505
7
9
  seppy/data/test/solo_l2_mag-rtn-normal-1-minute_20210712_v01.cdf,sha256=Tc_-3YQMVGDwJgN1td2iqTPGfCF7YwmuyYZ2G0NiSoY,59249
@@ -14,14 +16,14 @@ seppy/loader/solo.py,sha256=Nst2ZJU2yH5NHsB6M_69ryVfzt978hbmqhxaHZJREVg,3054
14
16
  seppy/loader/stereo.py,sha256=S0_IRIFbFxLH00bSIt1uZMflmuG5dAU5sKw0w9NL9oM,24583
15
17
  seppy/loader/wind.py,sha256=3rWV_EOcY7sY69eqtCQCZxL5GxAQZuMm1-wpJJxrej8,18460
16
18
  seppy/tests/__init__.py,sha256=1D-l3TVbwIZHY78A-sB7kc4ldldX8ZaEq-Ntph51WVw,108
17
- seppy/tests/test_loader.py,sha256=FJYsr3W1AXb1VxIrLG9iLzh9hNvPlkWLBUElndM9_xo,7648
18
- seppy/tests/test_tools.py,sha256=wgIAAuXsm4CtSm30usqMr5mUCteBntHAiHXzzlvl62A,30201
19
- seppy/tools/__init__.py,sha256=QxQ2VlGm934rnffYLnUkWdkL6GMqK29h544m7UDdqeI,115724
19
+ seppy/tests/test_loader.py,sha256=mt52vrAeSEtJ-od4Cqt0HrscN_ykKNHklGZm8OTZjLs,7767
20
+ seppy/tests/test_tools.py,sha256=NrKXrlgCsy9RRx2V7fUGRtB1l8N0_CXasyGjoB_lSNU,31518
21
+ seppy/tools/__init__.py,sha256=Ge3lQ9zVRJ27aaHSet2I1wQ9tD4emVfjnn49pUGcoiY,116086
20
22
  seppy/tools/swaves.py,sha256=OcohPXLko0ik9FLyYMVkYxI75W4XzOKvQ2Ylnwi-wlQ,3139
21
23
  seppy/tools/widgets.py,sha256=atQj9vvus0UgrUV6vlPcTdjpaidnERUevOp6FUmGLSI,6820
22
24
  seppy/util/__init__.py,sha256=0J3DNmOdh9X8a-uZy0yfFe1ubFSfcF5b7K4RMSJvGHA,15705
23
- seppy-0.1.13.dist-info/LICENSE.rst,sha256=SxptLPCIHKdfDjyguGdC7ai6Eze-Vz_t1jdqC8h19js,1473
24
- seppy-0.1.13.dist-info/METADATA,sha256=1peJsOrI-RvGReYt3MtMqjwyW_SHuE12bJKHv9WMtnc,4375
25
- seppy-0.1.13.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
26
- seppy-0.1.13.dist-info/top_level.txt,sha256=G2Op1GREPmbCX81isNhYY_7ZZyLWLIm-MJC04J4Fgc4,6
27
- seppy-0.1.13.dist-info/RECORD,,
25
+ seppy-0.1.15.dist-info/LICENSE.rst,sha256=SxptLPCIHKdfDjyguGdC7ai6Eze-Vz_t1jdqC8h19js,1473
26
+ seppy-0.1.15.dist-info/METADATA,sha256=Q4NN8Ku265gLCQGT1Ys81X1Uml6Hlk2Q2jwY5_tEdqw,4374
27
+ seppy-0.1.15.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
28
+ seppy-0.1.15.dist-info/top_level.txt,sha256=G2Op1GREPmbCX81isNhYY_7ZZyLWLIm-MJC04J4Fgc4,6
29
+ seppy-0.1.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (72.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5