Skip to content

Provide a way in sunpy to make composite image maps that combine short and long exposure time images #6727

@kreevescfa

Description

@kreevescfa

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    DiscussionAn issue opened for, or undergoing discussion.Feature RequestNew feature wanted.mapAffects the map submodule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions