Commit e273b93c authored by Vigeesh Gangadharan's avatar Vigeesh Gangadharan
Browse files

correct astropywarning, closes #48

parent b4977370
Pipeline #3583 passed with stage
in 2 minutes and 57 seconds
......@@ -1073,11 +1073,9 @@ def create_map(
# get thw wcs
wcs = WCS(header)
# set the figure size
aspect_ratio = abs((data.shape[0]*wcs.wcs.cdelt[1]) / (data.shape[1]*wcs.wcs.cdelt[0]))
shape_inches = (max([8 / aspect_ratio + 0.5, 3]) + 1.0, 8)
fig = plt.figure(figsize=shape_inches, dpi=dpi, constrained_layout=True)
# create the grid
......@@ -1090,14 +1088,17 @@ def create_map(
hspace=0.0,
)
# add the main plot axis
ax = fig.add_subplot(spec[:, 0], projection=wcs, slices=["x", "y", 0])
# add the colorbar axis
cax = fig.add_subplot(spec[1, 1])
#empty subplot for constrained layout
cax2 = fig.add_subplot(spec[0, 1])
cax2.axis('off')
# plot the data
cb = ax.imshow(
data.value,
......@@ -1227,6 +1228,7 @@ def plot_image(
# if single map
if header["RMAPS"] == 1:
print_message(f"Creating preview {preview}")
unit_data, unit_vmin, unit_vmax = convert_units(data, vmin, vmax)
# a quick correction for plots of field
......@@ -1404,7 +1406,7 @@ def set_axis_lon_lat(ax, grid=None, spacing=None):
lat.set_axislabel("HPLT-TAN")
# set the ticks for the longitude and latitude
if spacing:
if spacing != None:
lon.set_ticks(spacing=spacing, color="dimgray")
lat.set_ticks(spacing=spacing, color="dimgray")
else:
......@@ -1415,8 +1417,8 @@ def set_axis_lon_lat(ax, grid=None, spacing=None):
canvas = ax.figure.canvas
canvas.draw()
# # Switch axis if the labels are not created.
# # in cases where the slits are horionzatally-oriented.
# Switch axis if the labels are not created.
# in cases where the slits are horionzatally-oriented.
switch_coordinates(lon, lat, canvas)
# Add gris lines for longitude and latitude
......
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