Skip to content

Commit

Permalink
Minor modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
cchandre committed Oct 19, 2024
1 parent e057175 commit e51d98d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pypolar/PyPOLAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 64,7 @@
class Polarimetry(CTk.CTk):

__version__ = '2.6.4'
dict_versions = {'2.1': 'December 5, 2022', '2.2': 'January 22, 2023', '2.3': 'January 28, 2023', '2.4': 'February 2, 2023', '2.4.1': 'February 25, 2023', '2.4.2': 'March 2, 2023', '2.4.3': 'March 13, 2023', '2.4.4': 'March 29, 2023', '2.4.5': 'May 10, 2023', '2.5': 'May 23, 2023', '2.5.3': 'October 11, 2023', '2.6': 'October 16, 2023', '2.6.2': 'April 4, 2024', '2.6.3': 'July 18, 2024', '2.6.4': 'October 18, 2024'}
dict_versions = {'2.1': 'December 5, 2022', '2.2': 'January 22, 2023', '2.3': 'January 28, 2023', '2.4': 'February 2, 2023', '2.4.1': 'February 25, 2023', '2.4.2': 'March 2, 2023', '2.4.3': 'March 13, 2023', '2.4.4': 'March 29, 2023', '2.4.5': 'May 10, 2023', '2.5': 'May 23, 2023', '2.5.3': 'October 11, 2023', '2.6': 'October 16, 2023', '2.6.2': 'April 4, 2024', '2.6.3': 'July 18, 2024', '2.6.4': 'October 19, 2024'}
__version_date__ = dict_versions.get(__version__, date.today().strftime('%B %d, %Y'))

ratio_app = 3 / 4
Expand Down
26 changes: 10 additions & 16 deletions pypolar/pypolar_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,33 414,27 @@ def __init__(self, method:str, label:str='no distortions') -> None:
vars = (file.stem, 0)
try:
self.invKmat = np.linalg.pinv(np.genfromtxt(str(folder / (vars[0] '.txt')), dtype=np.float64))
if self.invKmat.shape != (int(method[-2]) 1, 4):
raise ValueError('Error in the dimension of the calibration matrix')
except:
showerror('Calibration data', 'Incorrect calibration data\n Download another file')
vars = (' ', 0)
else:
vars = (' ', 0)
self.name = vars[0]
self.offset_default = vars[1]
self.name, self.offset_default = vars

def display(self, colorblind:bool=False) -> None:
fig, axs = plt.subplots(ncols=2, figsize=(13, 8))
fig.canvas.manager.set_window_title('Disk Cone: ' self.name)
cmap = m_colorwheel if colorblind else 'hsv'
h = axs[0].imshow(self.RhoPsi[:, :, 0], cmap=cmap, interpolation='nearest', extent=[-1, 1, -1, 1], vmin=0, vmax=180)
axs[0].set_title('Rho Test')
ax_divider = make_axes_locatable(axs[0])
cax = ax_divider.append_axes('right', size='7%', pad='2%')
fig.colorbar(h, cax=cax)
cmap = 'viridis' if colorblind else 'jet'
h = axs[1].imshow(self.RhoPsi[:, :, 1], cmap=cmap, interpolation='nearest', extent=[-1, 1, -1, 1], vmin=0, vmax=180)
axs[1].set_title('Psi Test')
ax_divider = make_axes_locatable(axs[1])
cax = ax_divider.append_axes('right', size='7%', pad='2%')
fig.colorbar(h, cax=cax)
plt.subplots_adjust(wspace=0.4)
for ax in axs:
labels = ['Rho Test', 'Psi Test']
cmaps = [m_colorwheel, 'viridis'] if colorblind else ['hsv', 'jet']
for _, (label, cmap, ax) in enumerate(zip(labels, cmaps, axs)):
h = ax.imshow(self.RhoPsi[:, :, _], cmap=cmap, interpolation='nearest', extent=[-1, 1, -1, 1], vmin=0, vmax=180)
ax.set_title(label)
ax.set_xlabel('$B_2$')
ax.set_ylabel('$A_2$')
fig.colorbar(h, cax=make_axes_locatable(ax).append_axes('right', size='7%', pad='2%'))
plt.subplots_adjust(wspace=0.4)

def list(self, method:str) -> str:
if method == '1PF':
Expand Down

0 comments on commit e51d98d

Please sign in to comment.