Пример #1
0
# You should see a load of tables with the results from our search.
# Each table is for a different wavelength we specified in Angstrom (10E-10 m).
# We searched images from the SDO instrument AIA, and set a.vso.Sample() greater than the time period we searched.
# This meant we only get one image for each wavelength in that time period (which is only 2 minutes to begin with!).
# We can now download the data.

download = Fido.fetch(result,path="./data/")

# Now the data is downloaded you should see a folder called data with a bunch of fits files inside.
# FITS stands for Flexible Interchangeable Transport System. It is the de facto image format for astronomy.
# The image contains a "header" which contains information about the image.
# HMI images have been downloaded for you and are already in the folder (using the online search form https://vso.nascom.nasa.gov/cgi-bin/search).
# Let's add the fits in our folder to the database.

db.add_from_dir("./data/", ignore_already_added=True,time_string_parse_format="%d/%m/%Y") 

# Let's see what's now in our database:

for database_entry in db:
    if database_entry.observation_time_start is None and database_entry.observation_time_end is None:
        db.remove(database_entry)
print(display_entries(db,['id', 'observation_time_start','instrument', 'wavemin']))

# We can now search the database. Here we are searching for images in wavelengths between 1-2 nm or 10-20 Angstrom.
# We have also chosen to sort our results by wavlength!

print(display_entries(db.search(a.Wavelength(1.0*u.nm, 2.0*u.nm)),['id', 'observation_time_start', 'instrument', 'wavemin'], sort=True))

# Another way to fetch data is to use:
# entries = db.fetch(a.Time('2019/05/06 12:00', '2019/05/06 12:01'),a.Instrument('aia'),a.vso.Sample(2*u.minute),a.Wavelength(94*u.angstrom))