-
-
Notifications
You must be signed in to change notification settings - Fork 645
Open
Labels
DiscussionAn issue opened for, or undergoing discussion.An issue opened for, or undergoing discussion.Feature RequestNew feature wanted.New feature wanted.mapAffects the map submoduleAffects the map submodule
Description
Describe the feature
It would be nice to have a function that would make a composite map from short and long exposure time images that are close in time. Saturated pixels from the (exposure-time normalized) long exposure time image would be substituted with pixels from the (exposure-time normalized) short exposure time image. Care would have to be taken with the meta data, since two images are combined into one.
Proposed solution
Here is my (basic!) code to do this with AIA images if helpful (some things hardcoded for AIA).
import copy
def make_composite_image(file1,file2):
map1 = sunpy.map.Map(file1)
map2 = sunpy.map.Map(file2)
#check wavelengths are the same
if map1.wavelength.value == map2.wavelength.value:
#check that there is a short exposure time
if map1.exposure_time.value < 1.0 or map2.exposure_time.value < 1.0:
if map1.exposure_time > map2.exposure_time:
long_map = map1
short_map = map2
else:
long_map = map2
short_map = map1
saturated_indicies = (long_map.data > 4000).nonzero()
composite_map = copy.deepcopy(long_map)
composite_map.data[saturated_indicies] = short_map.data[saturated_indicies]
return composite_map
else: print("no short exposure time")
else: print("files need to be the same wavelength")
namurphy
Metadata
Metadata
Assignees
Labels
DiscussionAn issue opened for, or undergoing discussion.An issue opened for, or undergoing discussion.Feature RequestNew feature wanted.New feature wanted.mapAffects the map submoduleAffects the map submodule