Note
Click here to download the full example code
GONG helper functionsΒΆ
import os
import numpy as np
def get_gong_map():
"""
Automatically download and unzip a sample GONG synoptic map.
"""
if not os.path.exists('190310t0014gong.fits') and not os.path.exists('190310t0014gong.fits.gz'):
import urllib.request
urllib.request.urlretrieve(
'https://gong2.nso.edu/oQR/zqs/201903/mrzqs190310/mrzqs190310t0014c2215_333.fits.gz',
'190310t0014gong.fits.gz')
if not os.path.exists('190310t0014gong.fits'):
import gzip
with gzip.open('190310t0014gong.fits.gz', 'rb') as f:
with open('190310t0014gong.fits', 'wb') as g:
g.write(f.read())
return '190310t0014gong.fits'
Total running time of the script: ( 0 minutes 0.000 seconds)