コード例 #1
0
def test__individual_attributes_are_output(imaging_ci_7x7, plot_path,
                                           plot_patch):

    imaging_ci_plotter = aplt.ImagingCIPlotter(
        imaging=imaging_ci_7x7,
        mat_plot_2d=aplt.MatPlot2D(
            output=aplt.Output(plot_path, format="png")),
        mat_plot_1d=aplt.MatPlot1D(
            output=aplt.Output(plot_path, format="png")),
    )

    imaging_ci_7x7.cosmic_ray_map[0, 0] = 1.0

    imaging_ci_plotter.figures_2d(
        image=True,
        noise_map=True,
        pre_cti_data=True,
        signal_to_noise_map=True,
        cosmic_ray_map=True,
    )

    assert path.join(plot_path, "image_2d.png") in plot_patch.paths
    assert path.join(plot_path, "noise_map.png") in plot_patch.paths
    assert path.join(plot_path, "pre_cti_data.png") in plot_patch.paths
    assert path.join(plot_path, "signal_to_noise_map.png") in plot_patch.paths
    assert path.join(plot_path, "cosmic_ray_map.png") in plot_patch.paths

    plot_patch.paths = []

    imaging_ci_plotter.figures_2d(image=True, pre_cti_data=True)

    assert path.join(plot_path, "image_2d.png") in plot_patch.paths
    assert path.join(plot_path, "noise_map.png") not in plot_patch.paths
    assert path.join(plot_path, "pre_cti_data.png") in plot_patch.paths
    assert path.join(plot_path,
                     "signal_to_noise_map.png") not in plot_patch.paths
コード例 #2
0
   direction.
 - Loading and storing exposure information (e.g. date of observation, exposure time).
 - Using this information to convert the units of the image to counts, which are the appropriate unit for **arcticpy**.

"""

frame = ac.acs.ImageACS.from_fits(file_path=f"{dataset_path}.fits",
                                  quadrant_letter="A")
"""
We can use the **PyAutoCTI** visualization libary to plot this `Frame2D`. 

The image wouldn't not display clearly using the default color scale (which is the default color scale of matplotlib)
so we've updated it below.
"""

plotter = aplt.MatPlot2D(cmap=aplt.Cmap(norm="linear", vmax=2800.0))
aplt.Frame2D(frame=frame, plotter=plotter)
"""
To correct the ACS data, we need a CTI model describing:
 
 - The properties of the `Trap`'s on the CCD that are responsible for CTI by capturing and releasing electrons during 
   read-out.
 - The volume-filling behaviour of electrons in CCD pixels, as this effects whether `Trap`'s are able to captrue them
   or not!
   
**PyAutoCTI** again has in-built tools for automatically loading the CTI model appropriate for correcting ACS data, 
using the date of observation loaded in the `ACSFrame` object to choose a model based on the date of observation.
"""

# trap_list = ac.acs.trap_list.from_header(header=header)
# ccd = ac.acs.CCD()