Skip to content

bmampaey/SOLARNET-python-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOLARNET Virtual Observatory (SVO)

The SVO is a service first supported by the SOLARNET project, funded by the European Commission’s FP7 Capacities Programme under the Grant Agreement 312495. Then made operational thanks to the SOLARNET2 project, funded by the the European Union's Horizon 2020 Research and Innovation Programme under Grant Agreement 824135.

It's purpose is to collect metadata from as many solar observations as possible, especially those made thanks to the SOLARNET projects, in a common catalog and make them available to the scientific community.

A first prototype version was released in February 2016, and the operational version is available now at https://solarnet2.oma.be

The SVO code is split in several parts:

SOLARNET API python client

This package can be used as a client or as an example how to work with the API using Python 3

Example usage

from SOLARNET import datasets

# See all available datasets
for dataset in datasets:
	print(dataset)

# Get a specific dataset
aia_lev1 = datasets['AIA level 1']

# Filter the record in that dataset for June 2012 the 6th with a wavelength of 171A
filtered_aia_lev1 = aia_lev1.filter('DATE-OBS', '2012 June 6', WAVELNTH = 171)

# Display the date of observation and the wavelength in that filtered dataset
for record in filtered_aia_lev1:
	print(record.metadata['DATE-OBS'], record.metadata['WAVELNTH'])

# Download the data from a record
record = filtered_aia_lev1[0]
record.download('/tmp')

# Get the data as a BytesIO [1] without saving to disk
data = record.data()

# Open the data as a fits file (see astropy.io.fits [2])
hdus = record.HDUs()

[1] BytesIO [2] astropy.io.fits

About

Python3 client for the SOLARNET Virtual Observatory RESTful API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages