Adds Sensor column in Fido QueryResponseTable if present in SOAR metadata#206
Conversation
…n metadata EPD uses the 'sensor' key instead of 'detector' in pulled metadata. Exposing this in the search table allows for easier filtering for this instrument.
|
thanks for this PR @daraghhollman! it would be nice to also be able to build a query with the sensor in it, i.e. liek It looks like these are unique sensor names in the table it queries, from the |
|
Yeah I think that would be ideal. I'm also curious about If there are no overlaps, do you still think it's worth creating a new attr, |
|
The above commit implements e.g. from sunpy.net import Fido
from sunpy.net import attrs as a
import sunpy_soar
search = Fido.search(
a.Time("2021-11-20", "2021-11-22"),
a.Level(2),
a.Instrument.epd,
a.soar.Sensor("EPT"),
)I guess this will need some documentation additions too? |
…ch_attrs.py` Sensors 'NARROW' and 'WIDE' are still missing descriptions
|
The above commit adds |
hayesla
left a comment
There was a problem hiding this comment.
This is looking great @daraghhollman - a lil test would be nice, and a small example, even just the EPD/EPT would be great!
| @@ -0,0 +1,32 @@ | |||
| { | |||
| "BIAS": "Radio and Plasma Waves Bias Unit", | |||
There was a problem hiding this comment.
did you pull these from the data table with a tap query? we coul dmaybe add this to the tools on how this was generated :)
There was a problem hiding this comment.
No this was sadly a manual process. Searching product names via the SOAR search page directly, and looking at the metadata for matching files.
There was a problem hiding this comment.
ah ok, I'm hesitant to putting this hardcoded attrs into the repo. You can see https://github.com/sunpy/sunpy-soar/blob/main/tools/update_data.py is how we generate the attrs info data. We can maybe do something liek
soar = TapPlus(url="http://soar.esac.esa.int/soar-sl-tap/tap")
def get_all_sensors():
print("Updating sensor descriptors...")
job = soar.launch_job("SELECT * FROM soar.sensor")
res = job.get_results()
sensor_names = {}
for row in res:
sensor_names[row["name"]] = row.get("long_name", "")
return sensor_nameswhich i think is correct, and returns:
{'EPT': np.str_('Electron Proton Telescope'),
'HET': np.str_('High-Energy Telescope'),
'SIS': np.str_('Suprathermal Ion Spectrograph'),
'STEP': np.str_('SupraThermal Electrons and Protons'),
'EPTHET1': np.str_('Electron Proton Telescope and High-Energy Telescope 1'),
'EPTHET2': np.str_('Electron Proton Telescope and High-Energy Telescope 2'),
'FSI': np.str_('Full Sun Imager'),
'FSI174': np.str_('Full Sun Imager at 174 Angstrom'),
'FSI304': np.str_('Full Sun Imager at 304 Angstrom'),
'HRI': np.str_('High Resolution Imager'),
'HRI174': np.str_('High Resolution Imager at 174 Angstrom'),
'HRI1216': np.str_('High Resolution Imager at 1216 Angstrom'),
'IBS': np.str_('Inboard Sensor'),
'OBS': np.str_('Outboard Sensor'),
'VL': np.str_('Visible Light'),
'UV': np.str_('Ultraviolet'),
'FDT': np.str_('Full Disk Telescope'),
'HRT': np.str_('High Resolution Telescope'),
'LFR': np.str_('Low Frequency Receiver'),
'TDS': np.str_('Time Domain Sampler'),
'TNR': np.str_('Thermal Noise Receiver'),
'HFR': np.str_('High Frequency Receiver'),
'BIAS': np.str_('Biasing Unit'),
'NARROW': np.str_('Narrow Slits'),
'WIDE': np.str_('Wide Slit'),
'EAS': np.str_('Electron Analyser System'),
'EAS1': np.str_('Electron Analyser Sensor 1'),
'EAS2': np.str_('Electron Analyser Sensor 2'),
'HIS': np.str_('Heavy Ion Sensor'),
'PAS': np.str_('Proton and Alpha Particle Sensor')}
There was a problem hiding this comment.
Yeah that makes a lot of sense! I'll give it a whirl and verify.
There was a problem hiding this comment.
I've added this function to tools/update_data.py and call it in the __main__ step, writing to sunpy_soar/data/sensor_attrs.json.
Returns a Dict[str, str] containing sensor names and descriptions. This is called at the end of this file and writes to `sunpy_soar/data/sensor_attrs.json`
Checks if the sensor `ept` is in the registered sensors.
hayesla
left a comment
There was a problem hiding this comment.
This is looking great @daraghhollman - just some small suggestions
| @@ -0,0 +1,3 @@ | |||
| Added ``a.soar.Sensor`` to attrs, enabling users to query with a specific instrument sensor, e.g. the EPT sensor on the EPD instrument. | |||
| This was required as ``a.Detector`` does not provide a comprenhensive listing of all available sensors on Solar Orbiter. | |||
There was a problem hiding this comment.
dont need this sentence
| This was required as ``a.Detector`` does not provide a comprenhensive listing of all available sensors on Solar Orbiter. |
| # L0, L1, L2, L3, LL01, LL02, LL03 | ||
| # | ||
| # For specific instrument detectors or sensors, see ``a.Detector``. However, some SOAR products require the use of ``a.soar.Sensor`` attribute instead. | ||
| ##################################################### |
There was a problem hiding this comment.
I'd put this after the .products.
| @@ -0,0 +1,34 @@ | |||
| """ | |||
| =========================================================== | |||
| Searching for Solar Orbiter data using the Sensor attribute | |||
There was a problem hiding this comment.
| Searching for Solar Orbiter data using the Sensor attribute | |
| Searching for EPD/EPT data with the `a.soar.Sensor` attribute |
Move `a.soar.Sensor` to after `a.soar.Product` Update `a.soar.Sensor` EPD/EPT example title Update changelog, removing redundant line

PR Description
The EPD instrument on Solar Orbiter uses the 'sensor' key instead of 'detector' in the SOAR metadata. A 'Detector' column hence doesn't exist in the
QueryReponseTableoutput from Fido. This makes it difficult to only source data from a specfic sensor, with the only current workaround being to filter by string in the 'Data product' column (see #205).These (ableit small) changes create a 'Sensor' column in the table output if the 'sensor' key is present in the metadata, allowing for simple table filtering based on column values. e.g.
This PR partially addresses #205, however, I think a full solution should enable filtering by sensor during the Fido query (i.e. implementing these sensors in
a.Detector) - though I think this is outside my ability / current understanding of the codebase.AI Assistance Disclosure
AI tools were used for: