Skip to content

Commit

Permalink
Merge pull request #50 from jgieseler/main
Browse files Browse the repository at this point in the history
0.1.12
  • Loading branch information
jgieseler authored Feb 2, 2024
2 parents 2ff9cb8 + 67004da commit 1be7097
Show file tree
Hide file tree
Showing 7 changed files with 384 additions and 46 deletions.
10 changes: 5 additions & 5 deletions seppy/loader/psp.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def psp_isois_load(dataset, startdate, enddate, epilo_channel='F', epilo_thresho
ignore = [f'Epoch_Chan{epilo_channel}_DELTA', f'HCI_Chan{epilo_channel}', f'HCI_Lat_Chan{epilo_channel}', f'HCI_Lon_Chan{epilo_channel}',
f'HCI_R_Chan{epilo_channel}', f'HGC_Lat_Chan{epilo_channel}', f'HGC_Lon_Chan{epilo_channel}', f'HGC_R_Chan{epilo_channel}',
f'{species_str}_Chan{epilo_channel}_Energy_LABL', f'{species_str}_Counts_Chan{epilo_channel}', f'RTN_Chan{epilo_channel}']
#ignore = ['Epoch_ChanP_DELTA', 'HCI_ChanP', 'HCI_Lat_ChanP', 'HCI_Lon_ChanP', 'HCI_R_ChanP', 'HGC_Lat_ChanP', 'HGC_Lon_ChanP', 'HGC_R_ChanP', 'H_ChanP_Energy', 'H_ChanP_Energy_DELTAMINUS', 'H_ChanP_Energy_DELTAPLUS', 'H_ChanP_Energy_LABL', 'H_CountRate_ChanP', 'H_Counts_ChanP', 'H_Flux_ChanP', 'H_Flux_ChanP_DELTA', 'PA_ChanP', 'Quality_Flag_ChanP', 'RTN_ChanP', 'SA_ChanP
# ignore = ['Epoch_ChanP_DELTA', 'HCI_ChanP', 'HCI_Lat_ChanP', 'HCI_Lon_ChanP', 'HCI_R_ChanP', 'HGC_Lat_ChanP', 'HGC_Lon_ChanP', 'HGC_R_ChanP', 'H_ChanP_Energy', 'H_ChanP_Energy_DELTAMINUS', 'H_ChanP_Energy_DELTAPLUS', 'H_ChanP_Energy_LABL', 'H_CountRate_ChanP', 'H_Counts_ChanP', 'H_Flux_ChanP', 'H_Flux_ChanP_DELTA', 'PA_ChanP', 'Quality_Flag_ChanP', 'RTN_ChanP', 'SA_ChanP

# read 0th cdf file
# # cdf = cdflib.CDF(downloaded_files[0])
Expand Down Expand Up @@ -463,7 +463,7 @@ def calc_av_en_flux_PSP_EPILO(df, en_dict, en_channel, species, mode, chan, view
chan : string
'E', 'F', 'G', 'P', 'T'. EPILO chan
viewing : int or list
EPILO viewing. 0 to 7 for electrons; 0 to 79 for ions
EPILO viewing. 0 to 7 for electrons; 0 to 79 for ions
(ions 70-79 correspond to electrons 7, i.e., the electron wedges are
split up into 10 viewings for ions)
Expand Down Expand Up @@ -491,7 +491,7 @@ def calc_av_en_flux_PSP_EPILO(df, en_dict, en_channel, species, mode, chan, view
en_channel = [en_channel]
if type(viewing) == int:
viewing = [viewing]

df_out = pd.DataFrame()
flux_out_all = {}
en_channel_string_all = []
Expand Down Expand Up @@ -529,7 +529,7 @@ def calc_av_en_flux_PSP_EPILO(df, en_dict, en_channel, species, mode, chan, view
if len(en_channel) == 1:
en_channel = en_channel[0]
flux_out = pd.DataFrame({f'viewing_{view}': df[f"{flux_key}_Chan{chan}_E{en_channel}_P{view}"]}, index=df.index)

df_out = pd.concat([df_out, flux_out], axis=1)

# calculate mean of all viewings:
Expand Down Expand Up @@ -563,7 +563,7 @@ def _read_cdf_psp(fname, index_key, ignore_vars=[]):
fname : path-like
Location of single CDF file to read.
index_key : str
The CDF key to use as the index in the output DataFrame.
The CDF key to use as the index in the output DataFrame.
For example, index_key='Epoch_ChanP'
ignore_vars : list
In case a CDF file has columns that are unused / not required, then
Expand Down
17 changes: 9 additions & 8 deletions seppy/loader/soho.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,22 @@ def _get_metadata(dataset, path_to_cdf):
"""
metadata = []
cdf = cdflib.CDF(path_to_cdf)
if dataset=='SOHO_ERNE-HED_L2-1MIN' or dataset=='SOHO_ERNE-LED_L2-1MIN':
if dataset in ['SOHO_COSTEP-EPHIN_L3I-1MIN', 'SOHO_ERNE-HED_L2-1MIN', 'SOHO_ERNE-LED_L2-1MIN']:
if dataset=='SOHO_COSTEP-EPHIN_L3I-1MIN':
alpha = 'He'
m = '_int'
if dataset=='SOHO_ERNE-HED_L2-1MIN':
alpha = 'A'
m = 'H'
if dataset=='SOHO_ERNE-LED_L2-1MIN':
alpha = 'A'
m = 'L'
metadata = {'He_E_label': cdf.varget('He_E_label')[0],
'He_energy': cdf.varget('He_energy'),
'He_energy_delta': cdf.varget('He_energy_delta'),
f'A{m}_LABL': cdf.varattsget(f'A{m}')['LABLAXIS'],
f'A{m}_UNITS': cdf.varattsget(f'A{m}')['UNITS'],
f'A{m}_FILLVAL': cdf.varattsget(f'A{m}')['FILLVAL'],
f'{alpha}{m}_LABL': cdf.varattsget(f'{alpha}{m}')['LABLAXIS'],
f'{alpha}{m}_UNITS': cdf.varattsget(f'{alpha}{m}')['UNITS'],
f'{alpha}{m}_FILLVAL': cdf.varattsget(f'{alpha}{m}')['FILLVAL'],
'P_E_label': cdf.varget('P_E_label')[0],
'P_energy': cdf.varget('P_energy'),
'P_energy_delta': cdf.varget('P_energy_delta'),
Expand Down Expand Up @@ -76,10 +81,6 @@ def soho_load(dataset, startdate, enddate, path=None, resample=None, pos_timesta
http://ulysses.physik.uni-kiel.de/costep/level2/rl2/
- 'SOHO_COSTEP-EPHIN_L3I-1MIN': SOHO COSTEP-EPHIN Level3 intensity 1 minute data
https://cdaweb.gsfc.nasa.gov/misc/NotesS.html#SOHO_COSTEP-EPHIN_L3I-1MIN
- 'SOHO_CELIAS-PM_30S': SOHO CELIAS-PM 30 second data
https://cdaweb.gsfc.nasa.gov/misc/NotesS.html#SOHO_CELIAS-PM_30S
- 'SOHO_CELIAS-SEM_15S': SOHO CELIAS-SEM 15 second data
https://cdaweb.gsfc.nasa.gov/misc/NotesS.html#SOHO_CELIAS-SEM_15S
- 'SOHO_ERNE-LED_L2-1MIN': SOHO ERNE-LED Level2 1 minute data - VERY OFTEN NO DATA!
https://cdaweb.gsfc.nasa.gov/misc/NotesS.html#SOHO_ERNE-LED_L2-1MIN
- 'SOHO_ERNE-HED_L2-1MIN': SOHO ERNE-HED Level2 1 minute data
Expand Down
Loading

0 comments on commit 1be7097

Please sign in to comment.