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 11 forks source link

Register Solar Orbiter instruments from SOAR to search for instrument #52

Closed hayesla closed 1 year ago

hayesla commented 1 year ago

It would be nice to be able to search the soar based on instrument i.e.a.soar.Instrument("SWA") or even better register it within a.Instrument.

At the moment this can be done with EUI but only as it searches through the VSO, so if you do a Fido search with a timerange and a.Instrument("EUI"), it will only go and look at the VSO.

I'm happy to take a look at this, but would probably need to be pointed in the right direction

dstansby commented 1 year ago

Thanks for reporting! This seems like a bug - the README says sunpy-soar should be able to do this, and a quick look at the source code seems to indicate it should work.

For EUI the following script returns both VSO and SOAR results:

import sunpy_soar
from sunpy.net import Fido, attrs as a

result = Fido.search(a.Time('2020-06-01', '2020-07-01'), a.Instrument('EUI'))

print(result)

Can you share the query you're using that isn't picking up results from the SOAR?

hayesla commented 1 year ago

ah yes sorry I just retried and it worked - that's so weird! thanks!

It would be nice to be able to do a a.Instrument and it would register the instruments available within through the SOAR?

dstansby commented 1 year ago

What do you mean by register - perhaps autocompletion, or a way to find out which instruments you can search by when using a.Instrument with the SOAR?

hayesla commented 1 year ago

sorry register is the wrong word to use, I mean that when you type a.Instrument then the list of available instruments can be searched is listed - does that make sense?

<class 'sunpy.net.attrs.Instrument'>
sunpy.net.attrs.Instrument

Specifies the Instrument name for the search.

       Attribute Name          Client          Full Name                                           Description                                   
--------------------------- ----------- ------------------------ --------------------------------------------------------------------------------
aia                         VSO         AIA                      Atmospheric Imaging Assembly                                                    
bcs                         VSO         BCS                      Bragg Crystal Spectrometer                                                      
be_continuum                VSO         BE-Continuum             INAF-OACT Barra Equatoriale Continuum Instrument                                
be_halpha                   VSO         BE-Halpha                INAF-OACT Barra Equatoriale Hα Instrument                                       
bigbear                     VSO         Big Bear                 Big Bear Solar Observatory, California TON and GONG+ sites                      
caii                        VSO         CAII                     Kanzelhöhe Ca II k Instrument                                                   
cds                         VSO         CDS                      Coronal Diagnostic Spectrometer                                                 
celias                      VSO         CELIAS                   Charge, Element, and Isotope Analysis System                                    
cerrotololo                 VSO         Cerro Tololo             Cerro Tololo, Chile GONG+ site                                                  
chp                         VSO         chp                      Chromospheric Helium-I Imaging Photometer                                       
chrotel                     VSO         ChroTel                  Chromospheric Telescope                                                         
climso                      VSO         CLIMSO                   Christian Latouche IMageur SOlaire                                              
cook                        VSO         Cook                     None                                                     
hayesla commented 1 year ago

and I guess the ability to autocomplete

dstansby commented 1 year ago

👍 - to do that it should be possible to follow the code in https://github.com/sunpy/sunpy-soar/pull/36, and change it to scrape the instrument names instead of the data identifiers.

hayesla commented 1 year ago

great thanks @dstansby - I'll take a look at this :)

wtbarnes commented 1 year ago

Is this closed by #71?