From 5da666e4539e502d9b423cbaf622176d9db0919b Mon Sep 17 00:00:00 2001 From: maxbalrog Date: Wed, 17 Jun 2026 13:14:46 +0200 Subject: [PATCH 1/7] add option to return pcolormesh image with plot_mollweide --- src/quvac/plotting.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/quvac/plotting.py b/src/quvac/plotting.py index b42f5dc..991140e 100644 --- a/src/quvac/plotting.py +++ b/src/quvac/plotting.py @@ -105,7 +105,8 @@ def plot_roi(ax, x0, y0, dx, dy, line_kwargs): return ax -def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None): +def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None, + add_colorbar=True, return_image=False): """ Plot data on a Mollweide projection. @@ -125,6 +126,10 @@ def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None): Colormap, by default 'coolwarm'. norm : matplotlib.colors.Normalize, optional Normalization for the colormap, by default None. + add_colorbar : bool, optional + Whether to add colorbar to the plot or not, by default True. + return_image : bool, optional + Return pcolormesh image for further use, by default False. Returns ------- @@ -140,7 +145,10 @@ def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None): im = ax.pcolormesh(phi_mesh, theta_mesh, data, cmap=cmap, shading='gouraud', rasterized=True, norm=norm) - cbar = fig.colorbar(im, ax=ax, shrink=0.5) + if add_colorbar: + cbar = fig.colorbar(im, ax=ax, shrink=0.5) + else: + cbar = None ax.set_xticks([-2, -1, 0, 1, 2]) ax.set_yticks([-1.5, -1, -0.5, 0, 0.5, 1, 1.5]) @@ -151,6 +159,8 @@ def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None): for item in ax.xaxis.get_ticklabels() + ax.yaxis.get_ticklabels(): item.set_fontsize(18) ax.grid() + if return_image: + return im, ax, cbar return ax, cbar From 1ea77fae5ae140f98a6d7b0ab4a707fe9fa96da2 Mon Sep 17 00:00:00 2001 From: maxbalrog Date: Wed, 17 Jun 2026 13:16:44 +0200 Subject: [PATCH 2/7] add option for setting the fontsize for tick labels --- src/quvac/plotting.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/quvac/plotting.py b/src/quvac/plotting.py index 991140e..6cdd5c1 100644 --- a/src/quvac/plotting.py +++ b/src/quvac/plotting.py @@ -106,7 +106,7 @@ def plot_roi(ax, x0, y0, dx, dy, line_kwargs): def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None, - add_colorbar=True, return_image=False): + fontsize=18, add_colorbar=True, return_image=False): """ Plot data on a Mollweide projection. @@ -126,6 +126,8 @@ def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None, Colormap, by default 'coolwarm'. norm : matplotlib.colors.Normalize, optional Normalization for the colormap, by default None. + fontsize : int + Fontsize for tick labels add_colorbar : bool, optional Whether to add colorbar to the plot or not, by default True. return_image : bool, optional @@ -157,7 +159,7 @@ def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None, ytick_labels = np.linspace(0, 180, 7, endpoint=True, dtype=int)[::-1] ax.yaxis.set_ticklabels(f'${num}^{{\\circ}}$' for num in ytick_labels) for item in ax.xaxis.get_ticklabels() + ax.yaxis.get_ticklabels(): - item.set_fontsize(18) + item.set_fontsize(fontsize) ax.grid() if return_image: return im, ax, cbar From 20f5ea9d985f715ccf413587f618691bad6ba735 Mon Sep 17 00:00:00 2001 From: maxbalrog Date: Wed, 17 Jun 2026 13:25:29 +0200 Subject: [PATCH 3/7] add additional check when when calculating discernible signal in the detector --- src/quvac/cluster/optimization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quvac/cluster/optimization.py b/src/quvac/cluster/optimization.py index 2038d31..2ad2220 100755 --- a/src/quvac/cluster/optimization.py +++ b/src/quvac/cluster/optimization.py @@ -110,7 +110,7 @@ def objective_signal_in_detector(data, obj_params, discernible=False): align_to_max=False) N_detector_disc = 0 - if discernible: + if discernible and "discernible" in list(data.keys()): discernible_mask = data["discernible"] for detector in detectors: N_detector_disc += signal_in_detector( From a7862d6533e8f9eac3102a6fb81bb5fd4ecf4533 Mon Sep 17 00:00:00 2001 From: maxbalrog Date: Fri, 19 Jun 2026 15:18:38 +0200 Subject: [PATCH 4/7] fix gridlines location on mollweide plot --- src/quvac/plotting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quvac/plotting.py b/src/quvac/plotting.py index 6cdd5c1..ef6beec 100644 --- a/src/quvac/plotting.py +++ b/src/quvac/plotting.py @@ -152,8 +152,8 @@ def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None, else: cbar = None - ax.set_xticks([-2, -1, 0, 1, 2]) - ax.set_yticks([-1.5, -1, -0.5, 0, 0.5, 1, 1.5]) + ax.set_xticks([pi/3*i for i in range(-2,3)]) + ax.set_yticks([pi/6*i for i in range(-3,4)]) xtick_labels = np.linspace(60, 360, 5, endpoint=False, dtype=int) ax.xaxis.set_ticklabels(f'${num}^{{\\circ}}$' for num in xtick_labels) ytick_labels = np.linspace(0, 180, 7, endpoint=True, dtype=int)[::-1] From fb607ec47882314730a7c508ff3c88edf00f0f31 Mon Sep 17 00:00:00 2001 From: maxbalrog Date: Fri, 19 Jun 2026 15:42:37 +0200 Subject: [PATCH 5/7] remove pole labels on the mollweide plot --- src/quvac/plotting.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/quvac/plotting.py b/src/quvac/plotting.py index ef6beec..0ce027c 100644 --- a/src/quvac/plotting.py +++ b/src/quvac/plotting.py @@ -152,12 +152,14 @@ def plot_mollweide(fig, ax, phi, theta, data, cmap='coolwarm', norm=None, else: cbar = None + ax.set_yticks([pi/6*i for i in range(-2,3)]) + ytick_labels = np.linspace(30, 150, 5, endpoint=True, dtype=int)[::-1] + ax.yaxis.set_ticklabels([f'${num}^{{\\circ}}$' for num in ytick_labels]) + ax.set_xticks([pi/3*i for i in range(-2,3)]) - ax.set_yticks([pi/6*i for i in range(-3,4)]) xtick_labels = np.linspace(60, 360, 5, endpoint=False, dtype=int) ax.xaxis.set_ticklabels(f'${num}^{{\\circ}}$' for num in xtick_labels) - ytick_labels = np.linspace(0, 180, 7, endpoint=True, dtype=int)[::-1] - ax.yaxis.set_ticklabels(f'${num}^{{\\circ}}$' for num in ytick_labels) + for item in ax.xaxis.get_ticklabels() + ax.yaxis.get_ticklabels(): item.set_fontsize(fontsize) ax.grid() From bdf7eab9f127dc5d5614dbd17910622f6a6dd180 Mon Sep 17 00:00:00 2001 From: maxbalrog Date: Thu, 2 Jul 2026 12:40:49 +0200 Subject: [PATCH 6/7] remove parameter rounding in gridscan folder naming --- src/quvac/cluster/gridscan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quvac/cluster/gridscan.py b/src/quvac/cluster/gridscan.py index c0c4beb..4bcad88 100755 --- a/src/quvac/cluster/gridscan.py +++ b/src/quvac/cluster/gridscan.py @@ -145,7 +145,7 @@ def create_ini_files_for_gridscan(ini_default, param_names, param_grids, save_pa else: ini_current[category][param_name] = float(param) - param = int(param) if np.isclose(param, int(param)) else param + # param = int(param) if np.isclose(param, int(param)) else param param_str = f"{category}:{param_name}_{param:.3g}" name_local = "#".join([name_local, param_str]) save_path_local = os.path.join(save_path, name_local, "ini.yml") From fd6cec60979ab8f21b5f4111b2877d27e15b8571 Mon Sep 17 00:00:00 2001 From: maxbalrog Date: Mon, 6 Jul 2026 18:51:34 +0200 Subject: [PATCH 7/7] update version number --- src/quvac/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quvac/__init__.py b/src/quvac/__init__.py index d538f87..0058b93 100644 --- a/src/quvac/__init__.py +++ b/src/quvac/__init__.py @@ -1 +1 @@ -__version__ = "1.0.0" \ No newline at end of file +__version__ = "1.0.1" \ No newline at end of file