Пример #1
0
# 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))
# This automatically adds the observations to our database and downloads files checking for duplicates.

# Now we have our images let's plot them!

AIA = db.search(a.Wavelength(.1*u.nm, 60.0*u.nm))
AIAplotDic = {}
for obs in AIA:
    AIAplotDic[int(obs.wavemin*10)] = [obs.path,"sdoaia"+str(int(obs.wavemin*10))]

# fig = plt.figure(num=3, figsize=(len(AIA)*2,2))
# count = 1
# for im in sorted(AIAplotDic.keys()):