Esempio n. 1
0
        img[:,distance] = 255

    return img

m2deg = 360./(2*3.1415926*6.96e8)

cube = sunpy.make_map("/home/hayesla/fits/data/", type = "cube")
dmap = cube[2] - cube[1]
dmap.show()

# need an even number of maps so get rid of one
cube = cube[0:4]

import util

tmap = util.map_hpc_to_hg(dmap)

ttmap = util.map_hpc_to_hg_rotate(dmap, epi_lon = 9.5, epi_lat = 20.44)
input_maps = []

for map in cube:
    print("Unraveling map at "+str(map.date))
    input_maps += [util.map_hpc_to_hg_rotate(map, epi_lon = 9.5, epi_lat = 20.44)]

#wave_maps = wave2d.simulate(params, verbose = True)
#visualize(wave_maps)
#
# Use Albert's wavemaps to test the hough transform as a means
# of detecting EIT waves

#
Esempio n. 2
0
import util
"""
Prototype code
"""

cube = sunpy.make_map("/Users/schriste/Downloads/data2/AIA2010*", type = "cube")[:, 512:2048, 2048:3584]

# Blur maps
blurred = []
for map_ in cube:
    blurred.append(AIAMap(ndimage.gaussian_filter(map_, 10), map_.header))

# Plot map 3 - map 1
diff = blurred[2] - blurred[4]

tmap = util.map_hpc_to_hg(diff)

# Labeling
labels, nr_nuclei = ndimage.label(diff.clip(diff.min(), 0))

print("Number of nuclei found: %d" % nr_nuclei)

# Watershed
areas = np.array([(labels == s).sum() for s in np.arange(nr_nuclei) + 1])
max_area_label = areas.argmax() + 1

# Plot
fig = plt.figure()
axes = plt.imshow(labels == max_area_label, origin='lower')
plt.colorbar(axes)
plt.show()
Esempio n. 3
0
    return img


m2deg = 360. / (2 * 3.1415926 * 6.96e8)

cube = sunpy.make_map("/Users/schriste/Downloads/eitdata_19970512/*.fits",
                      type="cube")
dmap = cube[2] - cube[1]
dmap.show()

# need an even number of maps so get rid of one
cube = cube[0:4]

import util

tmap = util.map_hpc_to_hg(dmap)

ttmap = util.map_hpc_to_hg_rotate(dmap, epi_lon=9.5, epi_lat=20.44)
input_maps = []

for map in cube:
    print("Unraveling map at " + str(map.date))
    input_maps += [util.map_hpc_to_hg_rotate(map, epi_lon=9.5, epi_lat=20.44)]

#wave_maps = wave2d.simulate(params, verbose = True)
#visualize(wave_maps)
#
# Use Albert's wavemaps to test the hough transform as a means
# of detecting EIT waves

#
Esempio n. 4
0
import sunpy
from sunpy.wcs import wcs
import util

aia = sunpy.Map(sunpy.AIA_171_IMAGE).resample([500,500])

tmap = util.map_hpc_to_hg(aia)
tmap.show()

tmap_rot = util.map_hpc_to_hg_rotate(aia, epi_lon = 0, epi_lat = 0)
tmap_rot.show()
# BUG at the edges where the Sun wraps around, HPC to HG gives the same longitude
# for points behind and in front of the limb.

# no rotation, or put the NP at the NP
rotmap = util.map_hpc_to_hg_rotate(aia, epi_lon = 0, epi_lat = 90)

# the following command puts a feature at -6, -32 to the NP
rotmap = util.map_hpc_to_hg_rotate(aia, epi_lon = -6, epi_lat = -32)

ttmap = util.map_hg_to_hpc(tmap)
ttmap.show()

# WARNING!
# if the following line is run after the previousl line than it gives an error
# but not otherwise...not sure why...
ttmap = util.map_hg_to_hpc(tmap, xbin = 5, ybin = 5)