plotastrodata 1.9.5__tar.gz → 1.9.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plotastrodata-1.9.5/plotastrodata.egg-info → plotastrodata-1.9.6}/PKG-INFO +1 -1
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/__init__.py +1 -1
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/plot_utils.py +60 -48
- {plotastrodata-1.9.5 → plotastrodata-1.9.6/plotastrodata.egg-info}/PKG-INFO +1 -1
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/LICENSE +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/MANIFEST.in +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/README.md +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/analysis_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/const_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/coord_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/ext_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/fft_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/fits_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/fitting_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/los_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/matrix_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/noise_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata/other_utils.py +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata.egg-info/SOURCES.txt +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata.egg-info/dependency_links.txt +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata.egg-info/not-zip-safe +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata.egg-info/requires.txt +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/plotastrodata.egg-info/top_level.txt +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/setup.cfg +0 -0
- {plotastrodata-1.9.5 → plotastrodata-1.9.6}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotastrodata
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.6
|
|
4
4
|
Summary: plotastrodata is a tool for astronomers to create figures from FITS files and perform fundamental data analyses with ease.
|
|
5
5
|
Home-page: https://github.com/yusukeaso-astron/plotastrodata
|
|
6
6
|
Download-URL: https://github.com/yusukeaso-astron/plotastrodata
|
|
@@ -366,65 +366,77 @@ class PlotAxes2D():
|
|
|
366
366
|
grid: dict | None = None
|
|
367
367
|
aspect: dict | float | None = None
|
|
368
368
|
|
|
369
|
-
def
|
|
369
|
+
def _set_scale(self):
|
|
370
|
+
ax = self.ax
|
|
370
371
|
if self.loglog is not None:
|
|
371
|
-
self.xscale = 'log'
|
|
372
|
-
self.yscale = 'log'
|
|
372
|
+
self.xscale = self.yscale = 'log'
|
|
373
373
|
self.samexy = True
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
374
|
+
for axis in ["x", "y"]:
|
|
375
|
+
attr = f"{axis}lim"
|
|
376
|
+
lim = getattr(self, attr)
|
|
377
|
+
if lim is not None:
|
|
378
|
+
lim[0] = lim[1] / self.loglog
|
|
379
|
+
setattr(self, attr, lim)
|
|
378
380
|
ax.set_xscale(self.xscale)
|
|
379
381
|
ax.set_yscale(self.yscale)
|
|
382
|
+
|
|
383
|
+
def _init_ticks(self, axis):
|
|
384
|
+
ax = self.ax
|
|
385
|
+
ticks_attr = f"{axis}ticks"
|
|
386
|
+
ticklabels_attr = f"{axis}ticklabels"
|
|
387
|
+
scale = getattr(self, f"{axis}scale")
|
|
388
|
+
lim = getattr(self, f"{axis}lim")
|
|
389
|
+
ticks = getattr(self, ticks_attr)
|
|
390
|
+
if ticks is None:
|
|
391
|
+
ticks = getattr(ax, f"get_{axis}ticks")()
|
|
392
|
+
if scale == "log":
|
|
393
|
+
ticks, ticklabels = logticks(ticks, lim)
|
|
394
|
+
setattr(self, ticklabels_attr, ticklabels)
|
|
395
|
+
setattr(self, ticks_attr, ticks)
|
|
396
|
+
|
|
397
|
+
def _make_ticks(self, ticks, ticksminor):
|
|
398
|
+
dt = ticks[1] - ticks[0]
|
|
399
|
+
t = np.r_[ticks[0] - dt, ticks, ticks[-1] + dt]
|
|
400
|
+
num = ticksminor * (len(t) - 1) + 1
|
|
401
|
+
return np.linspace(t[0], t[-1], num)
|
|
402
|
+
|
|
403
|
+
def _set_ticks(self, axis):
|
|
404
|
+
ax = self.ax
|
|
405
|
+
attr = f"{axis}ticks"
|
|
406
|
+
ticks = getattr(self, attr)
|
|
407
|
+
getattr(ax, f"set_{attr}")(ticks)
|
|
408
|
+
ticksminor = getattr(self, f"{attr}minor")
|
|
409
|
+
if ticksminor is not None:
|
|
410
|
+
if isinstance(ticksminor, int):
|
|
411
|
+
ticksminor = self._make_ticks(ticks, ticksminor)
|
|
412
|
+
getattr(ax, f"set_{attr}")(ticksminor, minor=True)
|
|
413
|
+
|
|
414
|
+
def _apply_if_not_none(self, axis, attr):
|
|
415
|
+
ax = self.ax
|
|
416
|
+
method = getattr(ax, f"set_{axis}{attr}")
|
|
417
|
+
value = getattr(self, f"{axis}{attr}")
|
|
418
|
+
if value is not None:
|
|
419
|
+
if attr == "lim":
|
|
420
|
+
method(*value)
|
|
421
|
+
else:
|
|
422
|
+
method(value)
|
|
423
|
+
|
|
424
|
+
def set_xyaxes(self, ax):
|
|
425
|
+
self.ax = ax
|
|
426
|
+
self._set_scale()
|
|
380
427
|
if self.samexy:
|
|
381
428
|
ax.set_xticks(ax.get_yticks())
|
|
382
429
|
ax.set_yticks(ax.get_xticks())
|
|
383
430
|
ax.set_aspect(1)
|
|
384
|
-
|
|
385
|
-
self.
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
if self.yticks is None:
|
|
390
|
-
self.yticks = ax.get_yticks()
|
|
391
|
-
if self.yscale == 'log':
|
|
392
|
-
self.yticks, self.yticklabels \
|
|
393
|
-
= logticks(self.yticks, self.ylim)
|
|
394
|
-
ax.set_xticks(self.xticks)
|
|
395
|
-
ax.set_yticks(self.yticks)
|
|
396
|
-
if self.xticksminor is not None:
|
|
397
|
-
if type(self.xticksminor) is int:
|
|
398
|
-
t = ax.get_xticks()
|
|
399
|
-
dt = t[1] - t[0]
|
|
400
|
-
t = np.r_[t[0] - dt, t, t[-1] + dt]
|
|
401
|
-
num = self.xticksminor * (len(t) - 1) + 1
|
|
402
|
-
self.xticksminor = np.linspace(t[0], t[-1], num)
|
|
403
|
-
ax.set_xticks(self.xticksminor, minor=True)
|
|
404
|
-
if self.yticksminor is not None:
|
|
405
|
-
if type(self.yticksminor) is int:
|
|
406
|
-
t = ax.get_yticks()
|
|
407
|
-
dt = t[1] - t[0]
|
|
408
|
-
t = np.r_[t[0] - dt, t, t[-1] + dt]
|
|
409
|
-
num = self.yticksminor * (len(t) - 1) + 1
|
|
410
|
-
self.yticksminor = np.linspace(t[0], t[-1], num)
|
|
411
|
-
ax.set_yticks(self.yticksminor, minor=True)
|
|
412
|
-
if self.xticklabels is not None:
|
|
413
|
-
ax.set_xticklabels(self.xticklabels)
|
|
414
|
-
if self.yticklabels is not None:
|
|
415
|
-
ax.set_yticklabels(self.yticklabels)
|
|
416
|
-
if self.xlabel is not None:
|
|
417
|
-
ax.set_xlabel(self.xlabel)
|
|
418
|
-
if self.ylabel is not None:
|
|
419
|
-
ax.set_ylabel(self.ylabel)
|
|
420
|
-
if self.xlim is not None:
|
|
421
|
-
ax.set_xlim(*self.xlim)
|
|
422
|
-
if self.ylim is not None:
|
|
423
|
-
ax.set_ylim(*self.ylim)
|
|
431
|
+
for axis in ["x", "y"]:
|
|
432
|
+
self._init_ticks(axis)
|
|
433
|
+
self._set_ticks(axis)
|
|
434
|
+
for attr in ["ticklabels", "label", "lim"]:
|
|
435
|
+
self._apply_if_not_none(axis, attr)
|
|
424
436
|
if self.grid is not None:
|
|
425
437
|
ax.grid(**({} if self.grid is True else self.grid))
|
|
426
438
|
if self.aspect is not None:
|
|
427
|
-
if
|
|
439
|
+
if isinstance(self.aspect, dict):
|
|
428
440
|
ax.set_aspect(**self.aspect)
|
|
429
441
|
else:
|
|
430
442
|
ax.set_aspect(self.aspect)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotastrodata
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.6
|
|
4
4
|
Summary: plotastrodata is a tool for astronomers to create figures from FITS files and perform fundamental data analyses with ease.
|
|
5
5
|
Home-page: https://github.com/yusukeaso-astron/plotastrodata
|
|
6
6
|
Download-URL: https://github.com/yusukeaso-astron/plotastrodata
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|