Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/quvac/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "1.0.1"
2 changes: 1 addition & 1 deletion src/quvac/cluster/gridscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/quvac/cluster/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
28 changes: 21 additions & 7 deletions src/quvac/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
fontsize=18, add_colorbar=True, return_image=False):
"""
Plot data on a Mollweide projection.

Expand All @@ -125,6 +126,12 @@ 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
Return pcolormesh image for further use, by default False.

Returns
-------
Expand All @@ -140,17 +147,24 @@ 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])
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)])
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(18)
item.set_fontsize(fontsize)
ax.grid()
if return_image:
return im, ax, cbar
return ax, cbar


Expand Down
Loading