Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit be949c45 authored by PAduverne's avatar PAduverne
Browse files

Made the plot of tghe background image consistent for all the cli scripts.

parent 160435af
......@@ -67,7 +67,7 @@ def plot_sementation_image(segmentation, path2save=None):
fig.savefig(path2save + '/segmentation.png')
plt.close(fig)
def plot_background(data, background, dif=False):
def plot_background(data, background, dif=False, save=False, path=None):
"""
Display backgroung image or the result of the background subtraction.
......@@ -78,6 +78,10 @@ def plot_background(data, background, dif=False):
dif : boolean, optional
wether or not display the result of the background subtraction.
The default is False.
save : boolean, optional
Save the figure.
path : str, optional
Path where the figure is saved.
Returns
-------
......@@ -93,9 +97,19 @@ def plot_background(data, background, dif=False):
imshow_norm(data-background, ax[2], origin='lower', cmap = 'Greys_r',
interval=ZScaleInterval(), stretch=SqrtStretch())
else:
fig, ax = plt.subplots(1, 1, figsize=(10, 12.5))
imshow_norm(background, ax, origin='lower', cmap = 'Greys_r',
fig, ax = plt.subplots(1, 1, figsize=(12.5, 12.5))
im, norm = imshow_norm(background, ax, origin='lower', cmap = 'Greys_r',
interval=ZScaleInterval(), stretch=SqrtStretch())
ax.set_xlabel(r'$X$')
ax.set_ylabel(r'$Y$')
ax.set_title(r'$Background$ $Map$')
fig.colorbar(im, ax=ax)
if save:
try:
fig.savefig(path)
plt.close(fig)
except ValueError:
raise ValueError("Need a path where to save the plot.")
def plot_calib(band, source, fit_coef, path2save=None):
"""
......@@ -281,4 +295,4 @@ def plot_star_ref(file, telescope, band, clipping_psf=3.0,
plt.close(fig)
if not display:
plt.close(fig)
\ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment