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

correct non-standard stepsize plot, closes #47

parent 15306ab0
Pipeline #3553 passed with stage
in 3 minutes and 6 seconds
......@@ -213,7 +213,6 @@ def vfisv(
vfisv_data = VFISVpackage(path, id, line, width)
# Spawn jobs to the grisinv:master+slaves
print('spawning on',numproc)
pycomm = MPI.COMM_SELF.Spawn(get_executable(), maxprocs=numproc)
# Merge intercommunicator
......@@ -754,7 +753,6 @@ def write_fits(data, header, out, errors=None):
errors, overwrite=True, output_verify="silentfix+exception", checksum=True
)
print('Return after Dones')
return None
......@@ -1077,8 +1075,9 @@ def create_map(
wcs = WCS(header)
# set the figure size
aspect_ratio = (data.shape[0]*wcs.wcs.cdelt[0])/ (data.shape[1]*wcs.wcs.cdelt[1])
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
......@@ -1097,10 +1096,16 @@ def create_map(
# add the colorbar axis
cax = fig.add_subplot(spec[1, 1])
# show the data
# plot the data
cb = ax.imshow(
data.value, origin="lower", vmin=unit_vmin, vmax=unit_vmax, cmap=cmap
)
data.value,
origin="lower",
vmin=unit_vmin,
vmax=unit_vmax,
cmap=cmap,
interpolation='none',
aspect='auto',
)
# add title
fig.suptitle(title)
......@@ -1144,7 +1149,8 @@ def create_map(
bbox=dict(facecolor="white", alpha=1.0, edgecolor="None", pad=0.5),
)
# add th colobar
# add the colobar
cbar = plt.colorbar(cb, cax=cax, format=cfmt)
# add the ticks to the colobar
......@@ -1160,7 +1166,6 @@ def create_map(
# else:
plt.savefig(filename, bbox_inches="tight")
# plt.show()
# close plot
plt.close("all")
......@@ -2042,6 +2047,7 @@ class VFISVpackage:
sv = data[3, self.pix_ini : self.pix_end + 1, :, 0].copy()
ic = data[0, self.pix_cont, :, 0].copy()
return (
si.T,
sq.T,
......@@ -2143,7 +2149,7 @@ def main(path, id, out, numproc, line, width, preview, errors, diagnose, log):
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
print(size,rank)
# Get the MPI timer
start_time = MPI.Wtime()
......@@ -2190,7 +2196,6 @@ def main(path, id, out, numproc, line, width, preview, errors, diagnose, log):
if log:
write_log_file(log, header, data, stokes, total_time, numproc)
print('exit')
if __name__ == "__main__":
main()
from grisinv import vfisv
\ No newline at end of file
from grisinv import vfisv
\ No newline at end of file
......@@ -4,7 +4,7 @@ mpi4py = pytest.importorskip("mpi4py",reason='mpi4py not available')
def test_mpi4py():
from mpi4py import MPI
from grisinv import vfisv
#from grisinv import vfisv
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
......
from grisinv import vfisv
\ 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