Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed get_channel_energy() -method returning incorrect amount of chan… #52

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions seppy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,8 +1599,13 @@ def combine_grids_and_ybins(grid, grid1, y_arr, y_arr1):
s_identifier = "protons"
if instrument.lower() == "ephin":
particle_data = self.current_df_e
# Here drop the E300 channel altogether from the dataframe if the data is produced after Oct 4, 2017,
# for it contains no valid data. Keyword axis==1 refers to the columns axis.
if self.start_date > pd.to_datetime("2017-10-04").date():
particle_data = particle_data.drop("E300", axis=1)

s_identifier = "electrons"
raise Warning('SOHO/EPHIN is not implemented yet in the dynamic spectrum tool!')
# raise Warning('SOHO/EPHIN is not implemented yet in the dynamic spectrum tool!')

if spacecraft == "psp":
if instrument.lower() == "isois-epihi":
Expand Down Expand Up @@ -2285,11 +2290,11 @@ def get_channel_energy_values(self, returns: str = "num") -> list:
energy_ranges = self.current_energies["channels_dict_df_p"]["ch_strings"].values
if self.sensor.lower() == "ephin":
# Choose only the first 4 channels (E150, E300, E1300 and E3000)
# This are the only electron channels (rest p and He), and we
# These are the only electron channels (rest are p and He), and we
# use only electron data here.
energy_ranges = [val for val in self.current_energies.values()][:4]
if self.sensor.lower() in ("ephin-5", "ephin-15"):
energy_ranges = [value for key, value in self.current_energies.items()]
energy_ranges = [value for _, value in self.current_energies.items()]

if self.spacecraft == "psp":
energy_dict = self.meta
Expand Down
Loading