seppy 0.2.0__tar.gz → 0.3.0__tar.gz

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.

Files changed (70) hide show
  1. {seppy-0.2.0 → seppy-0.3.0}/.zenodo.json +1 -1
  2. seppy-0.3.0/CITATION.cff +81 -0
  3. {seppy-0.2.0 → seppy-0.3.0}/PKG-INFO +2 -2
  4. {seppy-0.2.0 → seppy-0.3.0}/README.rst +1 -1
  5. {seppy-0.2.0 → seppy-0.3.0}/seppy/_version.py +16 -3
  6. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side0_e_gf_en.csv +7 -0
  7. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side0_p_gf_en.csv +7 -0
  8. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side0_pe_gf_en.csv +7 -0
  9. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side1_e_gf_en.csv +7 -0
  10. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side1_p_gf_en.csv +7 -0
  11. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side1_pe_gf_en.csv +7 -0
  12. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side2_e_gf_en.csv +7 -0
  13. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side2_p_gf_en.csv +7 -0
  14. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side2_pe_gf_en.csv +7 -0
  15. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side3_e_gf_en.csv +7 -0
  16. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side3_p_gf_en.csv +7 -0
  17. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side3_pe_gf_en.csv +7 -0
  18. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side4_e_gf_en.csv +7 -0
  19. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side4_p_gf_en.csv +7 -0
  20. seppy-0.3.0/seppy/data/bepi_sixsp_instrumental_constants/sixsp_side4_pe_gf_en.csv +7 -0
  21. seppy-0.3.0/seppy/loader/bepi.py +152 -0
  22. {seppy-0.2.0 → seppy-0.3.0}/seppy/loader/psp.py +17 -19
  23. {seppy-0.2.0 → seppy-0.3.0}/seppy/loader/soho.py +7 -6
  24. {seppy-0.2.0 → seppy-0.3.0}/seppy/tests/test_loader.py +15 -0
  25. {seppy-0.2.0 → seppy-0.3.0}/seppy/tests/test_time_shift_analysis.ipynb +7 -5
  26. {seppy-0.2.0 → seppy-0.3.0}/seppy/tests/test_tools.py +29 -14
  27. {seppy-0.2.0 → seppy-0.3.0}/seppy/util/__init__.py +31 -2
  28. {seppy-0.2.0 → seppy-0.3.0}/seppy/version.py +1 -1
  29. {seppy-0.2.0 → seppy-0.3.0}/seppy.egg-info/PKG-INFO +2 -2
  30. {seppy-0.2.0 → seppy-0.3.0}/seppy.egg-info/SOURCES.txt +17 -0
  31. {seppy-0.2.0 → seppy-0.3.0}/.github/dependabot.yml +0 -0
  32. {seppy-0.2.0 → seppy-0.3.0}/.github/release.yml +0 -0
  33. {seppy-0.2.0 → seppy-0.3.0}/.github/workflows/pytest.yml +0 -0
  34. {seppy-0.2.0 → seppy-0.3.0}/.gitignore +0 -0
  35. {seppy-0.2.0 → seppy-0.3.0}/LICENSE.rst +0 -0
  36. {seppy-0.2.0 → seppy-0.3.0}/MANIFEST.in +0 -0
  37. {seppy-0.2.0 → seppy-0.3.0}/docs/Makefile +0 -0
  38. {seppy-0.2.0 → seppy-0.3.0}/docs/conf.py +0 -0
  39. {seppy-0.2.0 → seppy-0.3.0}/docs/index.rst +0 -0
  40. {seppy-0.2.0 → seppy-0.3.0}/docs/make.bat +0 -0
  41. {seppy-0.2.0 → seppy-0.3.0}/licenses/LICENSE.rst +0 -0
  42. {seppy-0.2.0 → seppy-0.3.0}/licenses/SUNPY_LICENSE.rst +0 -0
  43. {seppy-0.2.0 → seppy-0.3.0}/licenses/TEMPLATE_LICENSE.rst +0 -0
  44. {seppy-0.2.0 → seppy-0.3.0}/pyproject.toml +0 -0
  45. {seppy-0.2.0 → seppy-0.3.0}/seppy/__init__.py +0 -0
  46. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/20230719_side0.csv +0 -0
  47. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/20230719_side1.csv +0 -0
  48. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/20230719_side2.csv +0 -0
  49. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/epi21106.rl2 +0 -0
  50. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/sept_ahead_ele_sun_2006_318_1min_l2_v03.dat +0 -0
  51. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/soho_erne-hed_l2-1min_20211028_v01.cdf +0 -0
  52. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/solo_l2_mag-rtn-normal-1-minute_20210712_v01.cdf +0 -0
  53. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/sta_l1_het_20211028_v01.cdf +0 -0
  54. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/wi_sfsp_3dp_00000000_v01.cdf +0 -0
  55. {seppy-0.2.0 → seppy-0.3.0}/seppy/data/test/wi_sfsp_3dp_20200213_v01.cdf +0 -0
  56. {seppy-0.2.0 → seppy-0.3.0}/seppy/loader/solo.py +0 -0
  57. {seppy-0.2.0 → seppy-0.3.0}/seppy/loader/stereo.py +0 -0
  58. {seppy-0.2.0 → seppy-0.3.0}/seppy/loader/wind.py +0 -0
  59. {seppy-0.2.0 → seppy-0.3.0}/seppy/tests/__init__.py +0 -0
  60. {seppy-0.2.0 → seppy-0.3.0}/seppy/tests/tsa_org.png +0 -0
  61. {seppy-0.2.0 → seppy-0.3.0}/seppy/tools/__init__.py +0 -0
  62. {seppy-0.2.0 → seppy-0.3.0}/seppy/tools/swaves.py +0 -0
  63. {seppy-0.2.0 → seppy-0.3.0}/seppy/tools/widgets.py +0 -0
  64. {seppy-0.2.0 → seppy-0.3.0}/seppy.egg-info/dependency_links.txt +0 -0
  65. {seppy-0.2.0 → seppy-0.3.0}/seppy.egg-info/not-zip-safe +0 -0
  66. {seppy-0.2.0 → seppy-0.3.0}/seppy.egg-info/requires.txt +0 -0
  67. {seppy-0.2.0 → seppy-0.3.0}/seppy.egg-info/top_level.txt +0 -0
  68. {seppy-0.2.0 → seppy-0.3.0}/setup.cfg +0 -0
  69. {seppy-0.2.0 → seppy-0.3.0}/setup.py +0 -0
  70. {seppy-0.2.0 → seppy-0.3.0}/tox.ini +0 -0
@@ -27,7 +27,7 @@
27
27
  {
28
28
  "name": "Morosan, Diana",
29
29
  "orcid": "0000-0002-8416-1375",
30
- "affiliation": "University of Helsinki"
30
+ "affiliation": "University of Turku"
31
31
  },
32
32
  {
33
33
  "name": "Asvestari, Eleanna",
@@ -0,0 +1,81 @@
1
+ # YAML 1.2
2
+ # Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
3
+ cff-version: 1.0.3
4
+ message: If you use this software, please cite it using these metadata.
5
+ title: SEPpy
6
+ doi: 10.5281/zenodo.15275445
7
+ authors:
8
+ - given-names: Jan
9
+ family-names: Gieseler
10
+ affiliation: University of Turku
11
+ orcid: https://orcid.org/0000-0003-1848-7067
12
+ - given-names: Christian
13
+ family-names: Palmroos
14
+ affiliation: University of Turku
15
+ orcid: https://orcid.org/0000-0002-7778-5454
16
+ - given-names: Nina
17
+ family-names: Dresing
18
+ affiliation: University of Turku
19
+ orcid: https://orcid.org/0000-0003-3903-4649
20
+ - given-names: Diana
21
+ family-names: Morosan
22
+ affiliation: University of Turku
23
+ orcid: https://orcid.org/0000-0002-8416-1375
24
+ - given-names: Eleanna
25
+ family-names: Asvestari
26
+ affiliation: University of Helsinki
27
+ orcid: https://orcid.org/0000-0002-6998-7224
28
+ - given-names: Aleksi
29
+ family-names: Yli-Laurila
30
+ affiliation: University of Turku
31
+ - given-names: Daniel
32
+ family-names: Price
33
+ name-particle: J.
34
+ affiliation: University of Helsinki
35
+ orcid: https://orcid.org/0000-0002-8065-2847
36
+ - given-names: Rami
37
+ family-names: Vainio
38
+ affiliation: University of Turku
39
+ orcid: https://orcid.org/0000-0002-3298-2067
40
+ version: 0.2.1
41
+ date-released: 2025-04-24
42
+ repository-code: https://github.com/serpentine-h2020/SEPpy
43
+ license: BSD-3-Clause
44
+ preferred-citation:
45
+ type: article
46
+ authors:
47
+ - given-names: Christian
48
+ family-names: Palmroos
49
+ orcid: https://orcid.org/0000-0002-7778-5454
50
+ - given-names: Jan
51
+ family-names: Gieseler
52
+ orcid: https://orcid.org/0000-0003-1848-7067
53
+ - given-names: Nina
54
+ family-names: Dresing
55
+ orcid: https://orcid.org/0000-0003-3903-4649
56
+ - given-names: Diana
57
+ family-names: Morosan
58
+ orcid: https://orcid.org/0000-0002-8416-1375
59
+ - given-names: Eleanna
60
+ family-names: Asvestari
61
+ affiliation: University of Helsinki
62
+ orcid: https://orcid.org/0000-0002-6998-7224
63
+ - given-names: Aleksi
64
+ family-names: Yli-Laurila
65
+ affiliation: University of Turku
66
+ - given-names: "Daniel J."
67
+ family-names: Price
68
+ orcid: https://orcid.org/0000-0003-2672-5491
69
+ - given-names: Saku
70
+ family-names: Valkila
71
+ affiliation: University of Turku
72
+ - given-names: Rami
73
+ family-names: Vainio
74
+ orcid: https://orcid.org/0000-0002-3298-2067
75
+ doi: 10.3389/fspas.2022.1073578
76
+ url: http://dx.doi.org/10.3389/fspas.2022.1073578
77
+ journal: Frontiers in Astronomy and Space Sciences
78
+ month: 12
79
+ title: 'Solar Energetic Particle Time Series Analysis with Python'
80
+ volume: 9
81
+ year: 2022
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seppy
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: SEPpy
5
5
  Author-email: Jan Gieseler <jan.gieseler@utu.fi>
6
6
  License-Expression: BSD-3-Clause
@@ -102,7 +102,7 @@ The standard usecase is to utilize the ``***_load`` function, which returns Pand
102
102
  startdate="2021/04/16",
103
103
  enddate="2021/04/20")
104
104
 
105
- Note that the syntax is different for each loader! `Please refer to this Notebook for more info and examples for the different data sets! <https://github.com/jgieseler/serpentine/blob/main/notebooks/sep_analysis_tools/data_loader.ipynb>`_
105
+ Note that the syntax is different for each loader! `Please refer to this Notebook for more info and examples for the different data sets! <https://github.com/serpentine-h2020/serpentine/blob/main/notebooks/sep_analysis_tools/data_loader.ipynb>`_
106
106
 
107
107
 
108
108
 
@@ -59,7 +59,7 @@ The standard usecase is to utilize the ``***_load`` function, which returns Pand
59
59
  startdate="2021/04/16",
60
60
  enddate="2021/04/20")
61
61
 
62
- Note that the syntax is different for each loader! `Please refer to this Notebook for more info and examples for the different data sets! <https://github.com/jgieseler/serpentine/blob/main/notebooks/sep_analysis_tools/data_loader.ipynb>`_
62
+ Note that the syntax is different for each loader! `Please refer to this Notebook for more info and examples for the different data sets! <https://github.com/serpentine-h2020/serpentine/blob/main/notebooks/sep_analysis_tools/data_loader.ipynb>`_
63
63
 
64
64
 
65
65
 
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '0.2.0'
21
- __version_tuple__ = version_tuple = (0, 2, 0)
31
+ __version__ = version = '0.3.0'
32
+ __version_tuple__ = version_tuple = (0, 3, 0)
33
+
34
+ __commit_id__ = commit_id = 'g9b03e5735'
@@ -0,0 +1,7 @@
1
+ ,E1,E2,E3,E4,E5,E6,E7
2
+ E,0.07136998820779036,0.106020689668199,0.16924491340933645,0.2775615953281198,0.9181013479068942,2.1191996570142773,7.0097596149373445
3
+ E_high,0.09177548368520268,0.1435558391798049,0.21427728740410143,0.32992687069379817,1.1919879656119372,3.1550604857068207,10.079805475146708
4
+ E_low,0.055358148952411465,0.0781948638827628,0.13375408944763315,0.2352565594439009,0.7101665913370564,1.434578973690385,4.9022841726462385
5
+ GF,0.000744084026271284,0.0023547057401371954,0.005482528319823421,0.005127093454252397,0.01902742886064727,0.1135490379756403,0.2955529518148407
6
+ GF+,4.407576153642146e-05,0.00017692625607747562,0.00031414777830010825,0.00019485103307045285,0.0011317644544316732,0.011627598549077231,0.02799650885304167
7
+ GF-,3.0765532479120456e-05,0.0001188050101714527,0.00020985025971215383,0.00013586989944603094,0.00080099321001725,0.0076059086849180335,0.018302999792083552
@@ -0,0 +1,7 @@
1
+ ,P1,P2,P3,P4,P5,P6,P7,P8,P9
2
+ E,1.0892043697352367,1.191713543468342,1.5056858706388565,2.256917193159761,3.941877511129657,8.022262617851206,14.265824435249744,25.368621860434764,53.51994087714765
3
+ E_high,1.251485094184434,1.3065388380799035,1.6056568100801567,2.3847685334679674,4.221768392896758,8.517536828165206,15.433052366961784,28.39091667282395,89.55390877399482
4
+ E_low,0.9514425251349821,1.0912554154920344,1.4091787939193618,2.1414957174412077,3.6637636124811643,7.547586376710909,13.281738658302704,22.624222568325365,32.141145641824835
5
+ GF,0.0032863100615447526,0.005468400528408421,0.021381087836238214,0.03702551911640926,0.10513416559161146,0.17682237417850455,0.2807719612783785,0.6426692644860997,4.417831868656601
6
+ GF+,5.5941135781905574e-05,6.30411355749495e-05,0.0002668630584832174,0.0003885416046627774,0.0018069722794588072,0.00251349420409519,0.0044082778101268705,0.01765557652554295,0.647858015234017
7
+ GF-,6.0688111326479e-05,6.584953449700025e-05,0.00020883744898082465,0.00029257922312374285,0.0011991726979636297,0.0017163600352084196,0.0032386186964388775,0.011903665826323961,0.39883657804893247
@@ -0,0 +1,7 @@
1
+ ,PE1,PE2,PE3,PE4,PE5,PE6
2
+ E,0.4676510082325783,0.8241677662985538,2.2166806233466865,8.62078620999237,26.775301817436077,12.133451960771676
3
+ E_high,0.5851212006368589,1.3257423744366215,5.158203734799679,12.590771944731483,27.235133946294397,14.404083636710494
4
+ E_low,0.37194992790604253,0.518392576286752,0.9675352045576238,5.900841471337149,26.499630721545326,10.171453180737755
5
+ GF,0.0019944301402097455,0.0006192197467306016,0.0003749758705828118,7.312229694482832e-06,2.7513657814327922e-06,1.9882174824425192e-07
6
+ GF+,0.00010619568110399689,7.118716148898593e-05,0.00010681007180712073,7.3861849530426e-07,8.609005779195944e-09,8.675243782569238e-09
7
+ GF-,7.319464690360767e-05,4.958934387170287e-05,6.333791383428044e-05,4.788649015895818e-07,6.077330182483046e-09,5.7663320553281525e-09
@@ -0,0 +1,7 @@
1
+ ,E1,E2,E3,E4,E5,E6,E7
2
+ E,0.07266547637276809,0.10697859135347235,0.16772947012552017,0.2750762689037563,0.9181013479068942,2.2166806233466865,6.464677658766367
3
+ E_high,0.0938661165385642,0.14556572709739835,0.2149397274396841,0.32885250719646497,1.19831321732201,3.454148777427686,8.777905504122035
4
+ E_low,0.05591963288099132,0.07800768179172005,0.13157500106851347,0.229468611029276,0.710022523538504,1.4270357504314202,4.787042648485159
5
+ GF,0.0007181721869354164,0.0022911117115975866,0.005338722505649909,0.0053279846351268504,0.01910546786520893,0.1318902237747132,0.2477727675027271
6
+ GF+,4.4650191386252686e-05,0.00017527027985042663,0.0003068872591992294,0.00022779916153314872,0.0011467368861200547,0.015624347174579334,0.019124445653687594
7
+ GF-,3.0542187188129085e-05,0.00011996299907816865,0.000211768053756424,0.0001540285986186673,0.0008027181612488173,0.010119568529005737,0.012709656446140777
@@ -0,0 +1,7 @@
1
+ ,P1,P2,P3,P4,P5,P6,P7,P8,P9
2
+ E,1.1189949459517485,1.2243078243318797,1.5330166615576915,2.2773085412033933,3.941877511129657,8.022262617851206,14.524773710478838,25.141467573528143,50.70819187632956
3
+ E_high,1.3223001496828999,1.3596505875437543,1.6485420226281504,2.4139989566905813,4.242107533500153,8.602000273122464,15.931612875059924,27.975318468273986,93.4426658097329
4
+ E_low,0.9530269812043741,1.1040604447545643,1.4268951008225135,2.1519241580419894,3.6650678027885255,7.514123958392166,13.214464098541105,22.508989270245554,27.46015473172804
5
+ GF,0.003417373212057817,0.005704707811472433,0.02117844231485463,0.036808668119749435,0.10442881307172068,0.1773596966488655,0.29529294426814723,0.6221938878154205,2.9687170296087215
6
+ GF+,6.723268990899709e-05,8.235303448051682e-05,0.00026892393553325233,0.0004176991324003343,0.00181299133602085,0.0026282889469222137,0.00635582245663785,0.01648939555162421,0.5563973578927941
7
+ GF-,7.4864392519307e-05,8.368513461937555e-05,0.00022066784954512947,0.00031551758113382983,0.0012093755374471549,0.0018689499875964022,0.00448082085151752,0.01102081224935636,0.331832176800245
@@ -0,0 +1,7 @@
1
+ ,PE1,PE2,PE3,PE4
2
+ E,0.45931367423648206,0.854359445102026,2.4693242703651928,7.950430125161575
3
+ E_high,0.5861023904242666,1.423490785532313,5.803641182049846,12.581177755928415
4
+ E_low,0.36119731291293905,0.515372479746482,1.0671331244923925,5.007527707523226
5
+ GF,0.0022496109828675664,0.0007169892839069388,0.00048714137081507875,7.5448304605853795e-06
6
+ GF+,0.00012223582840262866,9.329951235403336e-05,0.00014401896608265175,9.837586503936157e-07
7
+ GF-,8.68081007633398e-05,6.364012978105115e-05,8.363676914069633e-05,6.089555424148017e-07
@@ -0,0 +1,7 @@
1
+ ,E1,E2,E3,E4,E5,E6,E7
2
+ E,0.0739844798784057,0.10990453800572952,0.1707740487911767,0.2775615953281198,0.9263964347542263,2.2367084321777915,6.464677658766367
3
+ E_high,0.09683761985733648,0.14912024822608438,0.21769171950625313,0.3312569928459745,1.199871417496154,3.475358665292029,8.776316820441252
4
+ E_low,0.05651060653400861,0.08077898564322093,0.13430152844429505,0.23129938054497642,0.7121845775042904,1.4372522284152158,4.787513372749311
5
+ GF,0.0008511366983350547,0.002311919739815824,0.0053353887099831035,0.005268252968388173,0.019725349691526606,0.1334813273024479,0.2473510118426091
6
+ GF+,5.3238283193165255e-05,0.00017661741224786,0.0003083117811340814,0.00022118672994133216,0.0012484718947037114,0.015543836783105752,0.01907534389265092
7
+ GF-,3.757855480810096e-05,0.00011807268882640335,0.00020874269766830902,0.00015242957345449216,0.0008484465084393766,0.010238551730619896,0.012683484180204346
@@ -0,0 +1,7 @@
1
+ ,P1,P2,P3,P4,P5,P6,P7,P8,P9
2
+ E,1.1189949459517485,1.2243078243318797,1.5330166615576915,2.297884125990977,3.977492551202207,8.022262617851206,14.524773710478838,25.141467573528143,50.70819187632956
3
+ E_high,1.3157259281035252,1.356097047783742,1.6519779438932318,2.4297389744623636,4.270088314569492,8.633713966834957,15.921930092376614,28.009034286015392,93.20916481719583
4
+ E_low,0.9519399061432624,1.1038294066976289,1.428974937587994,2.1545803044543237,3.6749877492261436,7.519889127134641,13.214593682717476,22.523217844179257,27.477027019054116
5
+ GF,0.00342855623448415,0.005880008743912994,0.021265661596847237,0.03755246368057295,0.10601645885858789,0.1756915497430881,0.29450495230108736,0.6228600631156037,2.9599055009889925
6
+ GF+,7.700316516841797e-05,9.202210143432425e-05,0.00024601151621420417,0.0005327950333694556,0.0019311640800869223,0.0025119276899031595,0.006357998809416621,0.01627819147425935,0.5552349628859359
7
+ GF-,7.874074095820006e-05,8.796683981514807e-05,0.0002123524609220183,0.00036593596532658035,0.0012832844295466023,0.0018315009173413277,0.004465881596842081,0.011078717841187857,0.32994005417183336
@@ -0,0 +1,7 @@
1
+ ,PE1,PE2,PE3,PE4
2
+ E,0.45931367423648206,0.854359445102026,2.514146757352814,6.641491558765202
3
+ E_high,0.588273904480234,1.4221334455796117,5.861970663649293,10.437341423451176
4
+ E_low,0.36200761772125184,0.5153445622954819,1.0817957857113776,4.220862322844621
5
+ GF,0.002209843626660993,0.0007229209204374963,0.00048056361125581385,5.1378789334747096e-06
6
+ GF+,0.00011703106464218144,9.433030474381297e-05,0.0001444900573658563,6.456076218174611e-07
7
+ GF-,8.41291095489932e-05,6.41728677725354e-05,8.254576830816682e-05,4.077522099072141e-07
@@ -0,0 +1,7 @@
1
+ ,E1,E2,E3,E4,E5,E6,E7
2
+ E,0.0739844798784057,0.10990453800572952,0.1707740487911767,0.2775615953281198,0.9263964347542263,2.2367084321777915,6.464677658766367
3
+ E_high,0.09681857324865471,0.1491035468728382,0.21776389566899282,0.331760503738385,1.2005632992504962,3.4766756868229716,8.776033872920168
4
+ E_low,0.056504989295303176,0.08071949574820148,0.13437267958223326,0.2316654325069703,0.7120388424489775,1.4365032754333429,4.788111694131427
5
+ GF,0.0008442041675831355,0.0023172253395054025,0.005338566748157845,0.005243527622973674,0.01970122733468188,0.13358622148857563,0.24756520917267677
6
+ GF+,5.291697744843303e-05,0.00017645442943132117,0.00030600315243276173,0.00022391451478508215,0.0012458508558131562,0.015567154399447142,0.019094442157332026
7
+ GF-,3.728950285384095e-05,0.00011866835055917213,0.00020828081189503724,0.00015112412222963688,0.0008480296748576872,0.010258141732280221,0.012689099388690145
@@ -0,0 +1,7 @@
1
+ ,P1,P2,P3,P4,P5,P6,P7,P8,P9
2
+ E,1.1189949459517485,1.2243078243318797,1.5330166615576915,2.2773085412033933,3.941877511129657,8.022262617851206,14.524773710478838,25.141467573528143,50.70819187632956
3
+ E_high,1.317484285281681,1.3552031263617221,1.6438624344220234,2.4081170735241058,4.2341689932160484,8.592238595206155,15.942530635178805,27.974226473582224,93.11643669530481
4
+ E_low,0.952107967898227,1.100831794236823,1.420201077594966,2.14268618264107,3.652048014470417,7.50638057565861,13.219065126488594,22.522578972238577,27.500563286132035
5
+ GF,0.0034337346506887727,0.005652684076987327,0.021309875907337975,0.03702114589758524,0.10508943980067502,0.1781592911198782,0.29533463877334826,0.6207177970231386,2.9545622530653795
6
+ GF+,7.494910648766541e-05,9.457608313425715e-05,0.0003191740917381364,0.0004910765859101954,0.0018780556015039473,0.0027072219049861512,0.0064822172708204895,0.0164123046915311,0.5533627291203111
7
+ GF-,7.831448139930097e-05,8.906824862469492e-05,0.0002455688818309397,0.00034486180943617967,0.0012482879573847416,0.001898825126256165,0.004460804041532873,0.010969198056017593,0.32866424470382816
@@ -0,0 +1,7 @@
1
+ ,PE1,PE2,PE3,PE4
2
+ E,0.4634635938794987,0.854359445102026,2.4472135858801662,6.884788843757024
3
+ E_high,0.590239417347087,1.4279880120729744,5.706894655539061,10.757538196406426
4
+ E_low,0.36279280928406576,0.5158909964187646,1.0539249442560916,4.412002960453417
5
+ GF,0.0022328826881507246,0.0007038662917862357,0.0004928496870442698,6.1142618768399e-06
6
+ GF+,0.0001262826090005567,9.028184494690064e-05,0.00014746723186205774,7.508955459383839e-07
7
+ GF-,8.798351252209098e-05,6.226028174881738e-05,8.443900628209248e-05,4.773764381117551e-07
@@ -0,0 +1,7 @@
1
+ ,E1,E2,E3,E4,E5,E6,E7
2
+ E,0.07332201221022118,0.10892043697352369,0.16924491340933645,0.2750762689037563,0.9263964347542263,2.2367084321777915,6.464677658766367
3
+ E_high,0.09586117235553393,0.147846557267237,0.21621216427237688,0.3289498925597295,1.198863300463159,3.4693533033997697,8.781492681873587
4
+ E_low,0.05633605203645279,0.07968574246426258,0.13298592138352458,0.22992653527644236,0.7112958749614946,1.432472868631079,4.787109084493891
5
+ GF,0.0007911991425025455,0.0022973169575156533,0.005308870961753688,0.005267881906498958,0.01963322218802799,0.1339587299557098,0.2476901751226763
6
+ GF+,4.802600403869218e-05,0.0001732926882168132,0.0003054455157324304,0.00022055181308570145,0.0012348725834009401,0.01591755483045612,0.019168620640087203
7
+ GF-,3.397791959186037e-05,0.00011912427004962889,0.00020858345018441408,0.0001502769448369452,0.0008493729609238866,0.010303108882992185,0.012706583261922616
@@ -0,0 +1,7 @@
1
+ ,P1,P2,P3,P4,P5,P6,P7,P8,P9
2
+ E,1.1189949459517485,1.2243078243318797,1.5330166615576915,2.2773085412033933,3.941877511129657,8.022262617851206,14.524773710478838,25.141467573528143,50.70819187632956
3
+ E_high,1.3205695488773035,1.35735973494876,1.6455684049665964,2.4085131711406396,4.232037606289004,8.583075879402369,15.940320711650292,27.99428048345101,93.4240711633911
4
+ E_low,0.9522566024311351,1.102293446859543,1.4229500249220528,2.1400666754741504,3.6420972316750593,7.500776323910487,13.218320268891286,22.53448253893071,27.4740949211543
5
+ GF,0.00339297797986906,0.00571929614975923,0.021130281674315715,0.03689541965989116,0.1054430318156869,0.17890016493482885,0.29476461271139304,0.6231813959101086,2.9513429087349863
6
+ GF+,7.030203790190552e-05,9.129652691551755e-05,0.00030163300997155043,0.0004892215265724503,0.0019201665354487973,0.0028302205209405906,0.006445965278190802,0.01621883132590607,0.552459940728137
7
+ GF-,7.572078970374992e-05,8.689289643919705e-05,0.00023488731133781277,0.0003486468143578045,0.0012759988952240758,0.0019258838489067398,0.004455788779096914,0.011031608006761173,0.32953106528026543
@@ -0,0 +1,7 @@
1
+ ,PE1,PE2,PE3,PE4
2
+ E,0.45931367423648206,0.8467093878154391,2.4472135858801662,8.62078620999237
3
+ E_high,0.5835638328078523,1.3993789826262908,5.740261671511515,12.363324426076735
4
+ E_low,0.36053695379899375,0.5129656053244083,1.0521095728476058,5.966611556969123
5
+ GF,0.0022727929598530916,0.0007287398814616956,0.0004874322583354253,8.321864358632426e-06
6
+ GF+,0.00012672825997297197,9.458119794145592e-05,0.00014601189498001342,8.15268503791107e-07
7
+ GF-,8.8425771732742e-05,6.38927182934762e-05,8.40519183610514e-05,5.204656666371053e-07
@@ -0,0 +1,152 @@
1
+ import glob
2
+ import os
3
+ import pooch
4
+ import requests
5
+ import sunpy
6
+ import warnings
7
+ import numpy as np
8
+ import pandas as pd
9
+
10
+ from astropy.utils.data import get_pkg_data_filename
11
+ from seppy.util import resample_df
12
+
13
+ # omit Pandas' PerformanceWarning
14
+ warnings.simplefilter(action='ignore', category=pd.errors.PerformanceWarning)
15
+
16
+
17
+ logger = pooch.get_logger()
18
+ logger.setLevel("WARNING")
19
+
20
+
21
+ def bepi_sixsp_download(date, path=None):
22
+ """Download BepiColombo/SIXS-P level 3 data file from SERPENTINE data server to local path
23
+
24
+ Parameters
25
+ ----------
26
+ date : datetime object
27
+ datetime of data to retrieve
28
+ path : str
29
+ local path where the files will be stored
30
+
31
+ Returns
32
+ -------
33
+ downloaded_file : str
34
+ full local path to downloaded file
35
+ """
36
+
37
+ # add a OS-specific '/' to end end of 'path'
38
+ if path:
39
+ if not path[-1] == os.sep:
40
+ path = f'{path}{os.sep}'
41
+
42
+ base = "https://data.serpentine-h2020.eu/l3data/bepi/l3/six_der"
43
+
44
+ fname = f"six_der_sc_{date.year}{date.strftime('%m')}_l3_data.csv"
45
+
46
+ url = f"{base}/{date.year}/{fname}"
47
+
48
+ try:
49
+ downloaded_file = pooch.retrieve(url=url, known_hash=None, fname=fname, path=path, progressbar=True)
50
+ except ModuleNotFoundError:
51
+ downloaded_file = pooch.retrieve(url=url, known_hash=None, fname=fname, path=path, progressbar=False)
52
+ except requests.HTTPError:
53
+ print(f'No corresponding BepiColombo/SIXS-P data found at {url}')
54
+ downloaded_file = []
55
+
56
+ return downloaded_file
57
+
58
+
59
+ def bepi_sixsp_l3_loader(startdate, enddate, resample=None, path=None, pos_timestamp='center'):
60
+ """Loads BepiColombo/SIXS-P level 3 data and returns it as Pandas dataframe together with a dictionary providing the energy ranges per channel
61
+
62
+ Parameters
63
+ ----------
64
+ startdate : str or datetime-like
65
+ start date
66
+ enddate : str or datetime-like
67
+ end date
68
+ resample : str, optional
69
+ resample frequency in format understandable by Pandas, e.g. '1min', by default None
70
+ path : str, optional
71
+ local path where the files are/should be stored, by default None, in which case the sunpy download folder will be used.
72
+ pos_timestamp : str, optional
73
+ change the position of the timestamp: 'center' or 'start' of the accumulation interval, by default 'center'.
74
+
75
+ Returns
76
+ -------
77
+ df : Pandas dataframe
78
+ Pandas dataframe of measured fluxes and uncertaintites
79
+ channels_dict_df : dict
80
+ Dictionary giving details on the measurement channels
81
+ """
82
+
83
+ channels_dict = {}
84
+ for side in range(0, 4): # omit Side4 info because it's not part of the L3 data product (22 Aug 2025)
85
+ for species in ['e', 'p', 'pe']:
86
+ filepath = get_pkg_data_filename(f'data/bepi_sixsp_instrumental_constants/sixsp_side{side}_{species}_gf_en.csv', package='seppy')
87
+ tdf = pd.read_csv(filepath, index_col=0).T
88
+ if species == 'e':
89
+ species_str = 'Electron'
90
+ channels_dict[f'Side{side}_{species_str}_Bins_str'] = ((tdf['E']*1000).round(0).astype(int).astype('str')+' keV').to_dict()
91
+ if species == 'p':
92
+ species_str = 'Proton'
93
+ channels_dict[f'Side{side}_{species_str}_Bins_str'] = (tdf['E'].round(2).astype('str')+' MeV').to_dict()
94
+ if species == 'pe':
95
+ species_str = 'Proton_As_Electron'
96
+ for i in ['PE4', 'PE5', 'PE6']:
97
+ try:
98
+ tdf.drop(index=i, inplace=True) # drop PE4, PE5, PE6 info because it's not part of the L3 data product (22 Aug 2025)
99
+ except KeyError:
100
+ pass
101
+ channels_dict[f'Side{side}_{species_str}_Bins_str'] = (tdf['E'].round(2).astype('str')+' MeV').to_dict()
102
+ channels_dict[f'Side{side}_{species_str}_Bins_Effective_Energy'] = tdf['E'].to_dict()
103
+ channels_dict[f'Side{side}_{species_str}_Bins_Low_Energy'] = tdf['E_low'].to_dict()
104
+ channels_dict[f'Side{side}_{species_str}_Bins_High_Energy'] = tdf['E_high'].to_dict()
105
+
106
+ if not path:
107
+ path = sunpy.config.get('downloads', 'download_dir') + os.sep
108
+ # create list of files to load:
109
+ startdate = sunpy.time.parse_time(startdate).to_datetime()
110
+ enddate = sunpy.time.parse_time(enddate).to_datetime()
111
+ dates = pd.date_range(start=startdate.replace(day=1), end=enddate, freq='MS')
112
+ filelist = []
113
+ for i, doy in enumerate(dates.month):
114
+ try:
115
+ f = glob.glob(f"{path}{os.sep}six_der_sc_{dates[i].year}{dates[i].strftime('%m')}_l3_data.csv")[0] # sept_{dates[i].year}_{doy}_*.dat")[0]
116
+ except IndexError:
117
+ # print(f"File not found locally from {path}, downloading...")
118
+ f = bepi_sixsp_download(dates[i], path)
119
+ if len(f) > 0:
120
+ filelist.append(f)
121
+ if len(filelist) > 0:
122
+ filelist = np.sort(filelist)
123
+
124
+ # read files into Pandas dataframes:
125
+ df = pd.read_csv(filelist[0])
126
+ if len(filelist) > 1:
127
+ for f in filelist[1:]:
128
+ t_df = pd.read_csv(f)
129
+ df = pd.concat([df, t_df])
130
+
131
+ # generate datetime index:
132
+ df.index = pd.to_datetime(df['TimeUTC'])
133
+ df.index.name = 'TimeUTC'
134
+ df.drop(['TimeUTC'], inplace=True, axis=1)
135
+
136
+ # replace bad data with np.nan:
137
+ # df = df.replace(-9999.900, np.nan)
138
+
139
+ # TODO: (as it's not really nicely done so far)
140
+ # careful!
141
+ # adjusting the position of the timestamp manually.
142
+ # requires knowledge of the original time resolution and timestamp position!
143
+ if pos_timestamp == 'start':
144
+ df.index = df.index-pd.Timedelta('60s')
145
+
146
+ # optional resampling:
147
+ if isinstance(resample, str):
148
+ df = resample_df(df, resample, pos_timestamp=pos_timestamp)
149
+ else:
150
+ df = []
151
+
152
+ return df, channels_dict
@@ -2,7 +2,7 @@
2
2
 
3
3
  import copy
4
4
  import os
5
- import warnings
5
+ # import warnings
6
6
 
7
7
  import cdflib
8
8
  import numpy as np
@@ -14,7 +14,7 @@ from sunpy.net import Fido
14
14
  from sunpy.net import attrs as a
15
15
  from sunpy.timeseries import TimeSeries
16
16
 
17
- from seppy.util import resample_df
17
+ from seppy.util import custom_warning, resample_df
18
18
 
19
19
  # Not needed atm as units are skipped in the modified read_cdf
20
20
  # if hasattr(sunpy, "__version__") and Version(sunpy.__version__) >= Version("5.0.0"):
@@ -199,8 +199,8 @@ def psp_isois_load(dataset, startdate, enddate, epilo_channel='F', epilo_thresho
199
199
  Name of PSP dataset:
200
200
  - 'PSP_ISOIS-EPIHI_L2-HET-RATES60'
201
201
  - 'PSP_ISOIS-EPIHI_L2-HET-RATES3600' (higher coverage than 'RATES60' before mid-2021)
202
- - 'PSP_ISOIS-EPIHI_L2-LET1-RATES60' (not yet supported)
203
- - 'PSP_ISOIS-EPIHI_L2-LET2-RATES60' (not yet supported)
202
+ - 'PSP_ISOIS-EPIHI_L2-LET1-RATES60'
203
+ - 'PSP_ISOIS-EPIHI_L2-LET2-RATES60'
204
204
  - 'PSP_ISOIS-EPILO_L2-PE'
205
205
  - 'PSP_ISOIS-EPILO_L2-IC'
206
206
  startdate, enddate : {datetime or str}
@@ -244,7 +244,7 @@ def psp_isois_load(dataset, startdate, enddate, epilo_channel='F', epilo_thresho
244
244
  if os.path.exists(f) and os.path.getsize(f) == 0:
245
245
  os.remove(f)
246
246
  if not os.path.exists(f):
247
- downloaded_file = Fido.fetch(result[0][i], path=path, max_conn=1)
247
+ _downloaded_file = Fido.fetch(result[0][i], path=path, max_conn=1)
248
248
 
249
249
  # loading for EPIHI
250
250
  if dataset.split('-')[1] == 'EPIHI_L2':
@@ -306,7 +306,7 @@ def psp_isois_load(dataset, startdate, enddate, epilo_channel='F', epilo_thresho
306
306
  energies_dict["H_FLUX_UNITS"] = cdf.varattsget('C_H_Flux')['UNITS']
307
307
  energies_dict["Electrons_Rate_UNITS"] = cdf.varattsget('C_Electrons_Rate')['UNITS']
308
308
  except ValueError:
309
- raise Warning(f"Can't obtain UNITS from metadata. Possibly an unsupported dataset is loaded!")
309
+ raise Warning("Can't obtain UNITS from metadata. Possibly an unsupported dataset is loaded!")
310
310
 
311
311
  # loading for EPILO
312
312
  if dataset.split('-')[1] == 'EPILO_L2':
@@ -415,7 +415,7 @@ def calc_av_en_flux_PSP_EPIHI(df, energies, en_channel, species, instrument, vie
415
415
  species_str = 'H'
416
416
  flux_key = 'H_Flux'
417
417
  en_str = energies[f'{species_str}_ENERGY_LABL']
418
- if type(en_channel) == list:
418
+ if type(en_channel) is list:
419
419
  energy_low = en_str[en_channel[0]].flat[0].split('-')[0]
420
420
  energy_up = en_str[en_channel[-1]].flat[0].split('-')[-1]
421
421
  en_channel_string = energy_low + '-' + energy_up
@@ -493,16 +493,16 @@ def calc_av_en_flux_PSP_EPILO(df, en_dict, en_channel, species, mode, chan, view
493
493
  if species.lower() in ['p', 'protons', 'i', 'ions', 'h']:
494
494
  species_str = 'H'
495
495
  flux_key = 'H_Flux'
496
- if type(en_channel) == int:
496
+ if type(en_channel) is int:
497
497
  en_channel = [en_channel]
498
- if type(viewing) == int:
498
+ if type(viewing) is int:
499
499
  viewing = [viewing]
500
500
 
501
501
  df_out = pd.DataFrame()
502
- flux_out_all = {}
502
+ # flux_out_all = {}
503
503
  en_channel_string_all = []
504
504
  for view in viewing:
505
- if type(en_channel) == list:
505
+ if type(en_channel) is list:
506
506
  # energy = en_dict[f'{species_str}_Chan{chan}_Energy'].filter(like=f'_P{view}').values
507
507
  energy = en_dict[f'{species_str}_Chan{chan}_Energy'][en_dict[f'{species_str}_Chan{chan}_Energy'].keys().str.endswith(f'_P{view}')].values
508
508
  # energy_low = energy - en_dict[f'{species_str}_Chan{chan}_Energy_DELTAMINUS'].filter(like=f'_P{view}').values
@@ -544,11 +544,9 @@ def calc_av_en_flux_PSP_EPILO(df, en_dict, en_channel, species, mode, chan, view
544
544
 
545
545
  # check if not all elements of en_channel_string_all are the same:
546
546
  if len(en_channel_string_all) != en_channel_string_all.count(en_channel_string_all[0]):
547
- print("You are combining viewing directions that have different energies. This is strongly advised against!")
547
+ custom_warning(f"PSP/EPI-Lo {mode.upper()}: You are combining viewing directions that have different energies. This is strongly advised against!")
548
548
  print(en_channel_string_all)
549
- return df_out2, en_channel_string_all[0]
550
- else:
551
- return df_out2, en_channel_string_all[0]
549
+ return df_out2, en_channel_string_all[0]
552
550
 
553
551
 
554
552
  psp_load = copy.copy(psp_isois_load)
@@ -584,15 +582,15 @@ def _read_cdf_psp(fname, index_key, ignore_vars=[]):
584
582
  ----------
585
583
  Space Physics Guidelines for CDF https://spdf.gsfc.nasa.gov/sp_use_of_cdf.html
586
584
  """
587
- import astropy.units as u
585
+ # import astropy.units as u
588
586
  from cdflib.epochs import CDFepoch
589
587
  from sunpy import log
590
- from sunpy.timeseries import GenericTimeSeries
588
+ # from sunpy.timeseries import GenericTimeSeries
591
589
  from sunpy.util.exceptions import warn_user
592
590
  cdf = cdflib.CDF(str(fname))
593
591
  # Extract the time varying variables
594
592
  cdf_info = cdf.cdf_info()
595
- meta = cdf.globalattsget()
593
+ # meta = cdf.globalattsget()
596
594
  if hasattr(cdflib, "__version__") and Version(cdflib.__version__) >= Version("1.0.0"):
597
595
  all_var_keys = cdf_info.rVariables + cdf_info.zVariables
598
596
  else:
@@ -619,7 +617,7 @@ def _read_cdf_psp(fname, index_key, ignore_vars=[]):
619
617
  # TODO: use to_astropy_time() instead here when we drop pandas in timeseries
620
618
  index = CDFepoch.to_datetime(index)
621
619
  # df = pd.DataFrame(index=pd.DatetimeIndex(name=index_key, data=index))
622
- units = {}
620
+ # units = {}
623
621
  df_dict = {}
624
622
 
625
623
  for var_key in var_keys:
@@ -15,7 +15,7 @@ from sunpy.net import Fido
15
15
  from sunpy.net import attrs as a
16
16
  from sunpy.timeseries import TimeSeries
17
17
 
18
- from seppy.util import custom_warning, resample_df
18
+ from seppy.util import custom_notification, custom_warning, resample_df
19
19
 
20
20
 
21
21
  logger = pooch.get_logger()
@@ -178,7 +178,7 @@ def soho_load(dataset, startdate, enddate, path=None, resample=None, pos_timesta
178
178
  return df, metadata
179
179
 
180
180
 
181
- def calc_av_en_flux_ERNE(df, channels_dict_df, avg_channels, species='p', sensor='HET'):
181
+ def calc_av_en_flux_ERNE(df, channels_dict_df, avg_channels, species='p', sensor='HED'):
182
182
  """
183
183
  avg_channels : list of int, optional
184
184
  averaging channels m to n if [m, n] is provided (both integers), by default None
@@ -342,15 +342,16 @@ def soho_ephin_loader(startdate, enddate, resample=None, path=None, all_columns=
342
342
  'H41 GM', 'H41 GR', 'H41 S1', 'H41 S23',
343
343
  'Spare 1', 'Spare 2', 'Spare 3'])
344
344
 
345
- # Proton and helium measurements need to be corrected for effects determined post-launch,
345
+ # TODO: Proton and helium measurements need to be corrected for effects determined post-launch,
346
346
  # cf. chapter 2.3 of https://www.ieap.uni-kiel.de/et/ag-heber/costep/materials/L2_spec_ephin.pdf
347
347
  # Until this correction has been implemented here, these data products are set to -9e9.
348
348
  # Setting use_uncorrected_data_on_own_risk=True skips this replacement, so that the uncorrected
349
349
  # data can be obtained at own risk!
350
350
  if use_uncorrected_data_on_own_risk:
351
351
  # warnings.warn("Proton and helium data is still uncorrected! Know what you're doing and use at own risk!")
352
- custom_warning("Proton and helium data is still uncorrected! Know what you're doing and use at own risk!")
352
+ custom_warning("SOHO/EPHIN proton and helium data is still uncorrected! Know what you're doing and use at own risk!")
353
353
  else:
354
+ custom_notification("SOHO/EPHIN proton and helium data are not supported at the moment and set to negative values of -9e9!")
354
355
  df.P4 = -9e9
355
356
  df.P8 = -9e9
356
357
  df.P25 = -9e9
@@ -392,7 +393,7 @@ def soho_ephin_loader(startdate, enddate, resample=None, path=None, all_columns=
392
393
  cs_he25 = '25 - 53 MeV/n'
393
394
  if max(fmodes)==2:
394
395
  # warnings.warn('Careful: EPHIN ring off!')
395
- custom_warning('Careful: EPHIN ring off!')
396
+ custom_warning('SOHO/EPHIN ring is off! This means high risk of contaminated measurements!')
396
397
 
397
398
  # failure mode D since 4 Oct 2017:
398
399
  # dates[-1].date() is enddate, used to catch cases when enddate is a string
@@ -402,7 +403,7 @@ def soho_ephin_loader(startdate, enddate, resample=None, path=None, all_columns=
402
403
  # dates[0].date() is startdate, used to catch cases when startdate is a string
403
404
  if dates[0].date() <= dt.date(2017, 10, 4):
404
405
  # warnings.warn('EPHIN instrument status (i.e., electron energy channels) changed during selected period (on Oct 4, 2017)!')
405
- custom_warning('EPHIN instrument status (i.e., electron energy channels) changed during selected period (on Oct 4, 2017)!')
406
+ custom_warning('SOHO/EPHIN instrument status (i.e., electron energy channels) changed during selected period (on Oct 4, 2017)!')
406
407
 
407
408
  # careful!
408
409
  # adjusting the position of the timestamp manually.
@@ -1,7 +1,10 @@
1
+ import datetime as dt
1
2
  import numpy as np
2
3
  import pandas as pd
4
+ import pytest
3
5
  from astropy.utils.data import get_pkg_data_filename
4
6
  from pathlib import Path
7
+ from seppy.loader.bepi import bepi_sixsp_l3_loader
5
8
  from seppy.loader.psp import psp_isois_load
6
9
  from seppy.loader.soho import soho_load
7
10
  from seppy.loader.solo import mag_load
@@ -9,6 +12,18 @@ from seppy.loader.stereo import stereo_load
9
12
  from seppy.loader.wind import wind3dp_load
10
13
 
11
14
 
15
+ def test_bepi_sixs_load_online():
16
+ startdate = dt.datetime(2020, 10, 9, 12, 0)
17
+ enddate = "2020/12/10 22:00:00"
18
+ df, meta = bepi_sixsp_l3_loader(startdate=startdate, enddate=enddate, resample="10min", path=None, pos_timestamp='center')
19
+ #
20
+ assert isinstance(df, pd.DataFrame)
21
+ assert df.shape == (8212, 309)
22
+ assert df['Side2_P2'].mean() == pytest.approx(np.float64(0.1928595238095238))
23
+ assert len(meta) == 48
24
+ assert meta['Side0_Electron_Bins_str']['E4'] == '278 keV'
25
+
26
+
12
27
  def test_psp_load_online():
13
28
  df, meta = psp_isois_load(dataset='PSP_ISOIS-EPIHI_L2-HET-RATES60', startdate="2021/05/31",
14
29
  enddate="2021/06/01", path=None, resample="1min")
@@ -36,13 +36,14 @@
36
36
  },
37
37
  {
38
38
  "cell_type": "code",
39
- "execution_count": 2,
39
+ "execution_count": null,
40
40
  "id": "2a6f4f3b",
41
41
  "metadata": {},
42
42
  "outputs": [],
43
43
  "source": [
44
44
  "from seppy.tools import Event\n",
45
45
  "import seppy.tools.widgets as w\n",
46
+ "from seppy.util import jupyterhub_data_path\n",
46
47
  "import datetime, os"
47
48
  ]
48
49
  },
@@ -145,13 +146,14 @@
145
146
  },
146
147
  {
147
148
  "cell_type": "code",
148
- "execution_count": 5,
149
+ "execution_count": null,
149
150
  "id": "c8b4570e",
150
151
  "metadata": {},
151
152
  "outputs": [],
152
153
  "source": [
153
- "# The path to where data is located / to be downloaded (by default the current directory)\n",
154
- "data_path = f\"{os.getcwd()}/data/\"\n",
154
+ "# Set your local path where you want to save the data files. If run on the project's JupyterHub server, it's set to a common data folder in the base directory. \n",
155
+ "data_path = f\"{os.getcwd()}{os.sep}data\"\n",
156
+ "data_path = jupyterhub_data_path(data_path)\n",
155
157
  "\n",
156
158
  "# Format of date: year, month, day\n",
157
159
  "startdate = datetime.date(2024, 5, 10)\n",
@@ -264,7 +266,7 @@
264
266
  ],
265
267
  "metadata": {
266
268
  "kernelspec": {
267
- "display_name": "Python 3 (ipykernel)",
269
+ "display_name": "serpentine",
268
270
  "language": "python",
269
271
  "name": "python3"
270
272
  },
@@ -1,6 +1,7 @@
1
1
  from astropy.utils.data import get_pkg_data_filename
2
2
  from pathlib import Path
3
3
  from seppy.tools import Event
4
+ from seppy.util import jupyterhub_data_path
4
5
  import datetime
5
6
  import os
6
7
  import matplotlib.pyplot as plt
@@ -14,7 +15,8 @@ plt.switch_backend("Agg")
14
15
  def test_onset_spectrum_tsa_SOLO_STEP_ions_old_data_online():
15
16
  startdate = datetime.date(2020, 9, 21)
16
17
  enddate = datetime.date(2020, 9, 21)
17
- lpath = f"{os.getcwd()}/data/"
18
+ lpath = f"{os.getcwd()}{os.sep}data"
19
+ lpath = jupyterhub_data_path(lpath)
18
20
  background_range = (datetime.datetime(2020, 9, 21, 0, 0, 0), datetime.datetime(2020, 9, 21, 2, 0, 0))
19
21
  #
20
22
  # ions
@@ -51,7 +53,8 @@ def test_onset_spectrum_tsa_SOLO_STEP_ions_old_data_online():
51
53
  def test_onset_spectrum_tsa_SOLO_STEP_ions_new_data_online():
52
54
  startdate = datetime.date(2022, 1, 9)
53
55
  enddate = datetime.date(2022, 1, 9)
54
- lpath = f"{os.getcwd()}/data/"
56
+ lpath = f"{os.getcwd()}{os.sep}data"
57
+ lpath = jupyterhub_data_path(lpath)
55
58
  background_range = (datetime.datetime(2022, 1, 9, 10, 0, 0), datetime.datetime(2022, 1, 9, 12, 0, 0))
56
59
  # ions
57
60
  Event1 = Event(spacecraft='Solar Orbiter', sensor='STEP', viewing='Pixel averaged', data_level='l2', species='ions', start_date=startdate, end_date=enddate, data_path=lpath)
@@ -91,7 +94,8 @@ def test_onset_spectrum_tsa_SOLO_STEP_ions_new_data_online():
91
94
  def test_onset_spectrum_tsa_SOLO_HET_online():
92
95
  startdate = datetime.date(2022, 11, 8)
93
96
  enddate = datetime.date(2022, 11, 8)
94
- lpath = f"{os.getcwd()}/data/"
97
+ lpath = f"{os.getcwd()}{os.sep}data"
98
+ lpath = jupyterhub_data_path(lpath)
95
99
  background_range = (datetime.datetime(2022, 11, 8, 0, 0, 0), datetime.datetime(2022, 11, 8, 1, 0, 0))
96
100
  # viewing "sun", single channel, protons
97
101
  Event1 = Event(spacecraft='Solar Orbiter', sensor='HET', viewing='sun', data_level='l2', species='protons', start_date=startdate, end_date=enddate, data_path=lpath)
@@ -129,7 +133,8 @@ def test_onset_spectrum_tsa_SOLO_HET_online():
129
133
  def test_onset_spectrum_tsa_SOLO_EPT_online():
130
134
  startdate = datetime.date(2022, 6, 6)
131
135
  enddate = datetime.date(2022, 6, 6)
132
- lpath = f"{os.getcwd()}/data/"
136
+ lpath = f"{os.getcwd()}{os.sep}data"
137
+ lpath = jupyterhub_data_path(lpath)
133
138
  background_range = (datetime.datetime(2022, 6, 6, 0, 0, 0), datetime.datetime(2022, 6, 6, 1, 0, 0))
134
139
  # viewing "sun", single channel, ions
135
140
  Event1 = Event(spacecraft='Solar Orbiter', sensor='EPT', viewing='sun', data_level='l2', species='ions', start_date=startdate, end_date=enddate, data_path=lpath)
@@ -167,7 +172,8 @@ def test_onset_spectrum_tsa_SOLO_EPT_online():
167
172
  def test_onset_spectrum_tsa_PSP_ISOIS_EPIHI_online():
168
173
  startdate = datetime.date(2021, 10, 28)
169
174
  enddate = datetime.date(2021, 10, 29)
170
- lpath = f"{os.getcwd()}/data/"
175
+ lpath = f"{os.getcwd()}{os.sep}data"
176
+ lpath = jupyterhub_data_path(lpath)
171
177
  background_range = (datetime.datetime(2021, 10, 28, 10, 0, 0), datetime.datetime(2021, 10, 28, 12, 0, 0))
172
178
  # viewing "A", single channel, electrons
173
179
  Event1 = Event(spacecraft='PSP', sensor='isois-epihi', viewing='A', data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath)
@@ -205,7 +211,8 @@ def test_onset_spectrum_tsa_PSP_ISOIS_EPIHI_online():
205
211
  def test_onset_spectrum_tsa_PSP_ISOIS_EPILO_e_online():
206
212
  startdate = datetime.date(2021, 10, 28)
207
213
  enddate = datetime.date(2021, 10, 29)
208
- lpath = f"{os.getcwd()}/data/"
214
+ lpath = f"{os.getcwd()}{os.sep}data"
215
+ lpath = jupyterhub_data_path(lpath)
209
216
  Event1 = Event(spacecraft='PSP', sensor='isois-epilo', viewing='7', data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath)
210
217
  print(Event1.print_energies())
211
218
  background_range = (datetime.datetime(2021, 10, 28, 10, 0, 0), datetime.datetime(2021, 10, 28, 12, 0, 0))
@@ -241,7 +248,8 @@ def test_onset_spectrum_tsa_PSP_ISOIS_EPILO_e_online():
241
248
  def test_onset_spectrum_tsa_Wind_3DP_p_online():
242
249
  startdate = datetime.date(2021, 10, 28)
243
250
  enddate = datetime.date(2021, 10, 29)
244
- lpath = f"{os.getcwd()}/data/"
251
+ lpath = f"{os.getcwd()}{os.sep}data"
252
+ lpath = jupyterhub_data_path(lpath)
245
253
  Event1 = Event(spacecraft='Wind', sensor='3DP', data_level='l2', viewing="Sector 3", species='protons', start_date=startdate, end_date=enddate, data_path=lpath)
246
254
  print(Event1.print_energies())
247
255
  background_range = (datetime.datetime(2021, 10, 28, 10, 0, 0), datetime.datetime(2021, 10, 28, 12, 0, 0))
@@ -278,7 +286,8 @@ def test_onset_spectrum_tsa_Wind_3DP_p_online():
278
286
  def test_onset_spectrum_tsa_Wind_3DP_e_online():
279
287
  startdate = datetime.date(2021, 10, 28)
280
288
  enddate = datetime.date(2021, 10, 29)
281
- lpath = f"{os.getcwd()}/data/"
289
+ lpath = f"{os.getcwd()}{os.sep}data"
290
+ lpath = jupyterhub_data_path(lpath)
282
291
  Event1 = Event(spacecraft='Wind', sensor='3DP', viewing="Sector 3", data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath) # TODO: radio_spacecraft=('wind', 'WIND')
283
292
  print(Event1.print_energies())
284
293
  background_range = (datetime.datetime(2021, 10, 28, 10, 0, 0), datetime.datetime(2021, 10, 28, 12, 0, 0))
@@ -315,7 +324,8 @@ def test_onset_spectrum_tsa_Wind_3DP_e_online():
315
324
  def test_onset_spectrum_tsa_STEREOB_HET_p_online():
316
325
  startdate = datetime.date(2006, 12, 13)
317
326
  enddate = datetime.date(2006, 12, 14)
318
- lpath = f"{os.getcwd()}/data/"
327
+ lpath = f"{os.getcwd()}{os.sep}data"
328
+ lpath = jupyterhub_data_path(lpath)
319
329
  Event1 = Event(spacecraft='STEREO-B', sensor='HET', data_level='l2', species='protons', start_date=startdate, end_date=enddate, data_path=lpath)
320
330
  print(Event1.print_energies())
321
331
  background_range = (datetime.datetime(2006, 12, 13, 0, 0, 0), datetime.datetime(2006, 12, 13, 2, 0, 0))
@@ -342,7 +352,8 @@ def test_onset_spectrum_tsa_STEREOB_HET_p_online():
342
352
  def test_onset_spectrum_tsa_STEREOB_HET_e_online():
343
353
  startdate = datetime.date(2006, 12, 13)
344
354
  enddate = datetime.date(2006, 12, 14)
345
- lpath = f"{os.getcwd()}/data/"
355
+ lpath = f"{os.getcwd()}{os.sep}data"
356
+ lpath = jupyterhub_data_path(lpath)
346
357
  Event1 = Event(spacecraft='STEREO-B', sensor='HET', data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath, radio_spacecraft=('behind', 'STEREO-B'))
347
358
  print(Event1.print_energies())
348
359
  background_range = (datetime.datetime(2006, 12, 13, 0, 0, 0), datetime.datetime(2006, 12, 13, 2, 0, 0))
@@ -369,7 +380,8 @@ def test_onset_spectrum_tsa_STEREOB_HET_e_online():
369
380
  def test_onset_spectrum_tsa_STEREOA_SEPT_p_online():
370
381
  startdate = datetime.date(2021, 10, 28)
371
382
  enddate = datetime.date(2021, 10, 28)
372
- lpath = f"{os.getcwd()}/data/"
383
+ lpath = f"{os.getcwd()}{os.sep}data"
384
+ lpath = jupyterhub_data_path(lpath)
373
385
  Event1 = Event(spacecraft='STEREO-A', sensor='SEPT', viewing="north", data_level='l2', species='ions', start_date=startdate, end_date=enddate, data_path=lpath)
374
386
  print(Event1.print_energies())
375
387
  background_range = (datetime.datetime(2021, 10, 28, 10, 0, 0), datetime.datetime(2021, 10, 28, 12, 0, 0))
@@ -396,7 +408,8 @@ def test_onset_spectrum_tsa_STEREOA_SEPT_p_online():
396
408
  def test_onset_spectrum_tsa_STEREOA_SEPT_e_online():
397
409
  startdate = datetime.date(2021, 10, 28)
398
410
  enddate = datetime.date(2021, 10, 28)
399
- lpath = f"{os.getcwd()}/data/"
411
+ lpath = f"{os.getcwd()}{os.sep}data"
412
+ lpath = jupyterhub_data_path(lpath)
400
413
  Event1 = Event(spacecraft='STEREO-A', sensor='SEPT', viewing="asun", data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath, radio_spacecraft=('ahead', 'STEREO-A'))
401
414
  print(Event1.print_energies())
402
415
  background_range = (datetime.datetime(2021, 10, 28, 10, 0, 0), datetime.datetime(2021, 10, 28, 12, 0, 0))
@@ -423,7 +436,8 @@ def test_onset_spectrum_tsa_STEREOA_SEPT_e_online():
423
436
  def test_onset_spectrum_tsa_SOHO_EPHIN_online():
424
437
  startdate = datetime.date(2021, 10, 28)
425
438
  enddate = datetime.date(2021, 10, 28)
426
- lpath = f"{os.getcwd()}/data/"
439
+ lpath = f"{os.getcwd()}{os.sep}data"
440
+ lpath = jupyterhub_data_path(lpath)
427
441
  Event1 = Event(spacecraft='SOHO', sensor='EPHIN', data_level='l2', species='electrons', start_date=startdate, end_date=enddate, data_path=lpath)
428
442
  print(Event1.print_energies())
429
443
  background_range = (datetime.datetime(2021, 10, 28, 10, 0, 0), datetime.datetime(2021, 10, 28, 12, 0, 0))
@@ -457,7 +471,8 @@ def test_onset_spectrum_tsa_SOHO_EPHIN_online():
457
471
  def test_onset_spectrum_tsa_SOHO_ERNE_online():
458
472
  startdate = datetime.date(2021, 10, 28)
459
473
  enddate = datetime.date(2021, 10, 29)
460
- lpath = f"{os.getcwd()}/data/"
474
+ lpath = f"{os.getcwd()}{os.sep}data"
475
+ lpath = jupyterhub_data_path(lpath)
461
476
  Event1 = Event(spacecraft='SOHO', sensor='ERNE-HED', data_level='l2', species='protons', start_date=startdate, end_date=enddate, data_path=lpath, radio_spacecraft=('ahead', 'STEREO-A'))
462
477
  print(Event1.print_energies())
463
478
  background_range = (datetime.datetime(2021, 10, 28, 10, 0, 0), datetime.datetime(2021, 10, 28, 12, 0, 0))
@@ -1,5 +1,6 @@
1
1
 
2
2
  import datetime
3
+ import psutil
3
4
  import warnings
4
5
 
5
6
  import astropy.constants as const
@@ -14,10 +15,19 @@ from sunpy.coordinates import get_horizons_coord
14
15
 
15
16
  def custom_formatwarning(message, *args, **kwargs):
16
17
  # ignore everything except the message
17
- FAIL = '\033[91m'
18
+ RED = '\033[91m'
18
19
  ENDC = '\033[0m'
19
20
  BOLD = "\033[1m"
20
- return BOLD+FAIL+'WARNING: '+ENDC+ str(message) + '\n'
21
+ return BOLD+RED+'WARNING: '+ENDC+ str(message) + '\n'
22
+
23
+
24
+ def custom_formatnotification(message, *args, **kwargs):
25
+ # ignore everything except the message
26
+ YELLOW = '\033[93m'
27
+ ENDC = '\033[0m'
28
+ BOLD = "\033[1m"
29
+ _yllw_str = '\x1b[38;5;226m'
30
+ return BOLD+YELLOW+'NOTE: '+ENDC+ str(message) + '\n'
21
31
 
22
32
 
23
33
  def custom_warning(message):
@@ -28,6 +38,14 @@ def custom_warning(message):
28
38
  return
29
39
 
30
40
 
41
+ def custom_notification(message):
42
+ formatwarning_orig = warnings.formatwarning
43
+ warnings.formatwarning = custom_formatnotification
44
+ warnings.warn(message)
45
+ warnings.formatwarning = formatwarning_orig
46
+ return
47
+
48
+
31
49
  def resample_df(df, resample, pos_timestamp="center", origin="start"):
32
50
  """
33
51
  Resamples a Pandas Dataframe or Series to a new frequency.
@@ -429,3 +447,14 @@ def intensity2vsd(species, kinetic_energy, intensity):
429
447
  p = energy2momentum(species, kinetic_energy)
430
448
  f = intensity / (p**2) * mass_dict[species]**3
431
449
  return f.to(u.s**3/(u.sr*u.cm**6))
450
+
451
+
452
+ def jupyterhub_data_path(path_org, path_hub='/home/jovyan/data'):
453
+ """
454
+ Checks if Notebook is run within SOLER/SERPENTINE JupyterHub. Returns the path of a common data folder if yes, and the original path if not.
455
+ """
456
+ if (psutil.Process().parent().name() == 'jupyterhub-sing') and all(x in psutil.Process().parent().environ()['PYTHONPATH'] for x in ['/home/jovyan/serpentine/', '/home/jovyan/soler/sep_tools/']):
457
+ print(f"JupyterHub detected. Adjusting data path to {path_hub}")
458
+ return path_hub
459
+ else:
460
+ return path_org
@@ -14,4 +14,4 @@ except Exception:
14
14
  )
15
15
  del warnings
16
16
 
17
- version = '0.2.0'
17
+ version = '0.3.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seppy
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: SEPpy
5
5
  Author-email: Jan Gieseler <jan.gieseler@utu.fi>
6
6
  License-Expression: BSD-3-Clause
@@ -102,7 +102,7 @@ The standard usecase is to utilize the ``***_load`` function, which returns Pand
102
102
  startdate="2021/04/16",
103
103
  enddate="2021/04/20")
104
104
 
105
- Note that the syntax is different for each loader! `Please refer to this Notebook for more info and examples for the different data sets! <https://github.com/jgieseler/serpentine/blob/main/notebooks/sep_analysis_tools/data_loader.ipynb>`_
105
+ Note that the syntax is different for each loader! `Please refer to this Notebook for more info and examples for the different data sets! <https://github.com/serpentine-h2020/serpentine/blob/main/notebooks/sep_analysis_tools/data_loader.ipynb>`_
106
106
 
107
107
 
108
108
 
@@ -1,5 +1,6 @@
1
1
  .gitignore
2
2
  .zenodo.json
3
+ CITATION.cff
3
4
  LICENSE.rst
4
5
  MANIFEST.in
5
6
  README.rst
@@ -25,6 +26,21 @@ seppy.egg-info/dependency_links.txt
25
26
  seppy.egg-info/not-zip-safe
26
27
  seppy.egg-info/requires.txt
27
28
  seppy.egg-info/top_level.txt
29
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side0_e_gf_en.csv
30
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side0_p_gf_en.csv
31
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side0_pe_gf_en.csv
32
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side1_e_gf_en.csv
33
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side1_p_gf_en.csv
34
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side1_pe_gf_en.csv
35
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side2_e_gf_en.csv
36
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side2_p_gf_en.csv
37
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side2_pe_gf_en.csv
38
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side3_e_gf_en.csv
39
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side3_p_gf_en.csv
40
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side3_pe_gf_en.csv
41
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side4_e_gf_en.csv
42
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side4_p_gf_en.csv
43
+ seppy/data/bepi_sixsp_instrumental_constants/sixsp_side4_pe_gf_en.csv
28
44
  seppy/data/test/20230719_side0.csv
29
45
  seppy/data/test/20230719_side1.csv
30
46
  seppy/data/test/20230719_side2.csv
@@ -35,6 +51,7 @@ seppy/data/test/solo_l2_mag-rtn-normal-1-minute_20210712_v01.cdf
35
51
  seppy/data/test/sta_l1_het_20211028_v01.cdf
36
52
  seppy/data/test/wi_sfsp_3dp_00000000_v01.cdf
37
53
  seppy/data/test/wi_sfsp_3dp_20200213_v01.cdf
54
+ seppy/loader/bepi.py
38
55
  seppy/loader/psp.py
39
56
  seppy/loader/soho.py
40
57
  seppy/loader/solo.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes