Skip to content

Commit

Permalink
catch missing ephin-5/15 file
Browse files Browse the repository at this point in the history
  • Loading branch information
jgieseler committed Dec 14, 2022
1 parent ba322c8 commit 4eb3c92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions seppy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,11 @@ def load_data(self, spacecraft, sensor, viewing, data_level,
dataset = "ephin_flux_2020-2022.csv"
datacols = ["date", "E5", "E15"]

df = pd.read_csv(f"{self.data_path}{os.sep}{dataset}", usecols=datacols,
index_col="date", parse_dates=True)
if os.path.isfile(f"{self.data_path}{dataset}"):
df = pd.read_csv(f"{self.data_path}{dataset}", usecols=datacols,
index_col="date", parse_dates=True)
else:
raise Warning(f"File {dataset} not found at {self.data_path}! Please verify that 'data_path' is correct.")
meta = {"E5": "0.45 - 0.50 MeV",
"E15": "0.70 - 1.10 MeV"}

Expand Down

0 comments on commit 4eb3c92

Please sign in to comment.