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

Incorporate SIS data #2

Open
jgieseler opened this issue Jan 14, 2022 · 2 comments
Open

Incorporate SIS data #2

jgieseler opened this issue Jan 14, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@jgieseler
Copy link
Owner

The Suprathermal Ion Spectrograph (SIS) is the fourth sensor of the EPD suite, and not incorporate yet.

Function get_available_soar_files already is capable of checking for SIS CDF files (level 2 and low-latency) available at SOAR:

>>> from solo_epd_loader import *
>>> get_available_soar_files(20210101, 20210101, 'sis', 'l2')
['solo_L2_epd-sis-a-rates-medium_20210101_V04.cdf', 'solo_L2_epd-sis-a-rates-slow_20210101_V04.cdf', 'solo_L2_epd-sis-b-rates-medium_20210101_V04.cdf', 'solo_L2_epd-sis-b-rates-slow_20210101_V04.cdf']
>>> get_available_soar_files(20210101, 20210101, 'sis', 'll')
['solo_LL02_epd-sis-a-rates_20210101T000046-20210102T000045_V03C.cdf', 'solo_LL02_epd-sis-b-rates_20210101T000046-20210102T000045_V03C.cdf']

Next steps to take:

  • Modify functions _epd_l2_download and _epd_ll_download to work with sensor='sis', so that downloads from SOAR are working
  • Write new function to actually load the SIS CDF data files, analog to _read_step_cdf and _read_epd_cdf (latter is for EPT and HET). Problem is that SIS data product is structured a bit differently.
  • Include sensor=SIS option in epd_load (easy).
@jgieseler jgieseler added the enhancement New feature or request label Jan 14, 2022
@jgieseler
Copy link
Owner Author

Maybe it's a better approach to write a new function _read_sis_cdf() that utilizes SunPy's Fido (resp. sunpy_soar) to download the data:

import sunpy_soar
from sunpy.net import Fido
import sunpy.net.attrs as a
from sunpy.timeseries import TimeSeries

# Create search attributes
instrument = a.Instrument("EPD")
time = a.Time("2021-02-01", "2021-02-02")
level = a.Level(2)

# Search
results = Fido.search(instrument & time & level)
print(results)

This lists all the available data products, which then could directly be accessed:

product = a.soar.Product("EPD-SIS-A-RATES-MEDIUM")

# Do search
result = Fido.search(instrument & time & level & product)
print(result)

# Download files
files = Fido.fetch(result)
print(files)

So for that, one would need to hard-code all the interesting data product strings.

Afterwards, the reading could be really easy if the cdf files behave nicely (i.e., there are no 3d data):

solo_sis = TimeSeries(files, concatenate=True)
df_solo_sis = solo_sis.to_dataframe()
return df_solo_sis

@jgieseler
Copy link
Owner Author

So, a full working function would already be the following (for one specific data product):

import sunpy_soar
from sunpy.net import Fido
import sunpy.net.attrs as a
from sunpy.timeseries import TimeSeries

def read_sis(startdate, enddate, instrument="EPD", level=2, sis_product="EPD-SIS-A-RATES-MEDIUM"):
    # Create search attributes
    instrument = a.Instrument(instrument)
    time = a.Time(startdate, enddate)
    level = a.Level(level)
    product = a.soar.Product(sis_product)

    # Do search
    result = Fido.search(instrument & time & level & product)
  
    # Download files
    files = Fido.fetch(result)
  
    solo_sis = TimeSeries(files, concatenate=True)
    df_solo_sis = solo_sis.to_dataframe()
    return df_solo_sis

df = read_sis(startdate="2021-02-01", enddate= "2021-02-02", instrument="EPD", level=2, sis_product="EPD-SIS-A-RATES-MEDIUM")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant