sunpy / sunpy-soar

A sunpy plugin for accessing data in the Solar Orbiter Archive (SOAR).
https://docs.sunpy.org/projects/soar/
BSD 2-Clause "Simplified" License
17 stars 12 forks source link

Take full advantage of meta information available from the SOAR #66

Open hayesla opened 1 year ago

hayesla commented 1 year ago

Describe the feature

Its certainly useful to search the metadata of the available data to perform more specific searches, for example you can query the EUI fits files using the TAP protocal and get at the dfferent table information such as the eui_fits headersL

e.g.

from astroquery.utils.tap.core import TapPlus

SOAR = TapPlus(url="http://soar.esac.esa.int/soar-sl-tap/tap")
eui_fits_table = SOAR.load_table('soar.v_eui_sc_fits')
for column in (eui_fits_table.columns):
    print(column.name)

Retrieving table 'soar.v_eui_sc_fits'
apid
binning_factor
bit_pixel
blank
bscale
btype
bunit
bzero
c_delt1
c_delt2
c_delt3
checksum
complete_flag
compressed_ratio
creator
cr_pix1
cr_pix2
cr_pix3
cr_val1
cr_val2
cr_val3
ctype1
ctype2
ctype3
cunit1
cunit2
cunit3
data_item_oid
data_max
data_min
datasum
....

this hence means you can search on these, for example say you want between a timerange and only ones with a reference coord between -100, 100

results = SOAR.launch_job("SELECT * FROM soar.v_eui_sc_fits "
                          "WHERE date_average>='2022-02-30T00:00:00'"
                          "AND level='L2'"
                          "AND cr_val1<=100 AND cr_val1>=-100 "
                          "AND cr_val2<=100 AND cr_val2>=-100"
                                )
r = results.get_results()
print(r.filename)
solo_L2_eui-fsi304-image_20220303T043556272_V01.fits
solo_L2_eui-fsi304-image_20220303T043556272_V01.fits
solo_L2_eui-fsi304-image_20220303T043600274_V01.fits
solo_L2_eui-fsi304-image_20220303T043600274_V01.fits
solo_L2_eui-fsi304-image_20220303T043604248_V01.fits
solo_L2_eui-fsi304-image_20220303T043604248_V01.fits
solo_L2_eui-fsi304-image_20220303T043608247_V01.fits
solo_L2_eui-fsi304-image_20220303T043608247_V01.fits
...
solo_L2_eui-fsi304-image_20220330T223015210_V01.fits
solo_L2_eui-fsi304-image_20220330T230015214_V01.fits
solo_L2_eui-fsi304-image_20220330T230015214_V01.fits
solo_L2_eui-fsi304-image_20220330T233015217_V01.fits
solo_L2_eui-fsi304-image_20220330T233015217_V01.fits
solo_L2_eui-fsi304-image_20220331T000015220_V01.fits
solo_L2_eui-fsi304-image_20220331T000015220_V01.fits

so lots to do here, I'm not sure the best approach and we could probably have to scope out the functionality that would live within sunpy_soar but having it as a wider sunpy-interface with the SOAR definitely has its benefits!

ebuchlin commented 1 year ago

Is this related to #46?