plotastrodata 1.8.4__tar.gz → 1.8.5__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.
Files changed (25) hide show
  1. {plotastrodata-1.8.4/plotastrodata.egg-info → plotastrodata-1.8.5}/PKG-INFO +1 -1
  2. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/__init__.py +1 -1
  3. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/noise_utils.py +6 -0
  4. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/plot_utils.py +24 -1
  5. {plotastrodata-1.8.4 → plotastrodata-1.8.5/plotastrodata.egg-info}/PKG-INFO +1 -1
  6. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/LICENSE +0 -0
  7. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/MANIFEST.in +0 -0
  8. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/README.md +0 -0
  9. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/analysis_utils.py +0 -0
  10. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/const_utils.py +0 -0
  11. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/coord_utils.py +0 -0
  12. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/ext_utils.py +0 -0
  13. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/fft_utils.py +0 -0
  14. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/fits_utils.py +0 -0
  15. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/fitting_utils.py +0 -0
  16. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/los_utils.py +0 -0
  17. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/matrix_utils.py +0 -0
  18. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata/other_utils.py +0 -0
  19. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata.egg-info/SOURCES.txt +0 -0
  20. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata.egg-info/dependency_links.txt +0 -0
  21. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata.egg-info/not-zip-safe +0 -0
  22. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata.egg-info/requires.txt +0 -0
  23. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/plotastrodata.egg-info/top_level.txt +0 -0
  24. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/setup.cfg +0 -0
  25. {plotastrodata-1.8.4 → plotastrodata-1.8.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plotastrodata
3
- Version: 1.8.4
3
+ Version: 1.8.5
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
@@ -1,4 +1,4 @@
1
1
  import warnings
2
2
 
3
3
  warnings.simplefilter('ignore', FutureWarning)
4
- __version__ = '1.8.4'
4
+ __version__ = '1.8.5'
@@ -142,6 +142,9 @@ class Noise:
142
142
  """
143
143
  _kw = {'nwalkersperdim': 4, 'nsteps': 200, 'nburnin': 0}
144
144
  _kw.update(kwargs)
145
+ if not hasattr(self, 'hist'):
146
+ self.gen_histogram()
147
+ print('Noise.gen_histogram() was done with default arguments.')
145
148
  f = gauss_pbcor if 'pbcor' in self.sigma else gauss
146
149
  model = normalize(range=self.range, bins=self.bins)(f)
147
150
  bounds = [[0.1, 2], [-2, 2]]
@@ -167,6 +170,9 @@ class Noise:
167
170
  savefig (dict or str, optional): For plt.figure().savefig(). Defaults to None.
168
171
  show (bool, optional): True means doing plt.show(). Defaults to False.
169
172
  """
173
+ if not hasattr(self, 'model'):
174
+ self.fit_histogram()
175
+ print('Noise.fit_histogram() was done with default arguments.')
170
176
  fig, ax = plt.subplots()
171
177
  ax.plot(self.hbin, self.hist, drawstyle='steps-mid')
172
178
  ax.plot(self.hbin, self.model, '-')
@@ -65,6 +65,26 @@ def logticks(ticks: list[float], lim: list[float, float]
65
65
  return newticks, newlabels
66
66
 
67
67
 
68
+ def logcbticks(vmin: float, vmax: float):
69
+ ticks = np.outer(np.logspace(-3, 3, 7), np.arange(1, 10))
70
+ ticklabels = []
71
+ for i in range(-3, 4):
72
+ ii = np.abs(min(i, 0))
73
+ ii = f'{ii:d}'
74
+ for j in range(1, 10):
75
+ jj = j * 10**i
76
+ if j in [1, 2, 5]:
77
+ s = f'{jj:.{ii}f}'
78
+ else:
79
+ s = ''
80
+ ticklabels.append(s)
81
+ ticks = np.log10(np.ravel(ticks))
82
+ ticklabels = np.ravel(ticklabels)
83
+ ticklabels = ticklabels[((vmin < ticks) * (ticks < vmax))]
84
+ ticks = ticks[((vmin < ticks) * (ticks < vmax))]
85
+ return ticks, ticklabels
86
+
87
+
68
88
  @dataclass
69
89
  class PlotAxes2D():
70
90
  """Use Axes.set_* to adjust x and y axes.
@@ -771,6 +791,7 @@ class PlotAstroData(AstroFrame):
771
791
  stretchscale = sigma
772
792
  cmin_org = _kw['vmin'] if 'vmin' in _kw else sigma
773
793
  c = set_minmax(c, stretch, stretchscale, stretchpower, sigma, _kw)
794
+ cmin, cmax = np.nanmin(c), np.nanmax(c)
774
795
  c = self.vskipfill(c, v)
775
796
  if type(self.channelnumber) is int:
776
797
  c = [c[self.channelnumber]]
@@ -810,13 +831,15 @@ class PlotAstroData(AstroFrame):
810
831
  p = 1 - stretchpower
811
832
  cbticks = (cbticks / cmin_org)**p - 1
812
833
  cbticks = cbticks / p / np.log(10)
834
+ if stretch == 'log' and cbticks is None:
835
+ cbticks, cbticklabels = logcbticks(cmin, cmax)
813
836
  if cbticks is not None:
814
837
  cb.set_ticks(cbticks)
815
838
  if cbticklabels is not None:
816
839
  cb.set_ticklabels(cbticklabels)
817
840
  elif stretch in ['log', 'asinh', 'power']:
818
841
  t = cb.get_ticks()
819
- t = t[(_kw['vmin'] < t) * (t < _kw['vmax'])]
842
+ t = t[(cmin < t) * (t < cmax)]
820
843
  cb.set_ticks(t)
821
844
  if stretch == 'log':
822
845
  ticklin = 10**t
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plotastrodata
3
- Version: 1.8.4
3
+ Version: 1.8.5
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