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

correct constrained_layout, closes #49

parent 324d236f
Pipeline #3581 passed with stage
in 3 minutes and 9 seconds
......@@ -1096,6 +1096,8 @@ def create_map(
# add the colorbar axis
cax = fig.add_subplot(spec[1, 1])
cax2 = fig.add_subplot(spec[0, 1])
cax2.axis('off')
# plot the data
cb = ax.imshow(
data.value,
......@@ -1224,7 +1226,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
......@@ -1253,10 +1255,12 @@ def plot_image(
# create a temp directory
td = TemporaryDirectory()
rmaps = header["RMAPS"]
previewgif = preview.replace("png","gif")
print_message(f"Creating preview {previewgif}")
for imap in tqdm(
range(rmaps),
bar_format=termcolors.text
+ "Creating animation {n_fmt}/{total_fmt}: {desc}|{bar:30}|"
+ "Creating animation {n_fmt}/{total_fmt}: {desc}|{bar:30}|"
+ termcolors.end
+ "{percentage:3.0f}% ({elapsed_s:3.1f}s)",
):
......@@ -1271,11 +1275,11 @@ def plot_image(
outpath = os.path.join(td.name, f"{imap:03d}_" + preview.split("/")[-1])
annotate_starttime = False
annotate_endtime = False
if imap == 0:
annotate_starttime = True
bbox = None
if imap == header["RMAPS"] - 1:
annotate_endtime = True
# if imap == 0:
# annotate_starttime = True
# bbox = None
# if imap == header["RMAPS"] - 1:
# annotate_endtime = True
bbox = create_map(
unit_data[imap, ...],
......@@ -1296,7 +1300,7 @@ def plot_image(
filelist = glob(os.path.join(td.name, "*"))
merge_to_gif(filelist, preview.replace(".png", ".gif"))
merge_to_gif(filelist, previewgif)
td.cleanup()
return None
......@@ -2142,8 +2146,10 @@ class VFISVpackage:
@click.option("--errors", type=str, help="Filename to save the uncertainties")
@click.option("--diagnose", type=str, help="Filename to write the inversion fits")
@click.option("--log", type=str, help="Filename to write the log file")
@click.version_option(get_version())
def main(path, id, out, numproc, line, width, preview, errors, diagnose, log):
"""SDC:GRIS Inversion Pipeline code"""
"""SDC:GRIS Inversion Pipeline code """
# Get the MPI Communicator
comm = MPI.COMM_WORLD
......
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