plotastrodata 1.8.8__tar.gz → 1.8.9__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.8/plotastrodata.egg-info → plotastrodata-1.8.9}/PKG-INFO +1 -1
  2. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/__init__.py +1 -1
  3. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/plot_utils.py +19 -14
  4. {plotastrodata-1.8.8 → plotastrodata-1.8.9/plotastrodata.egg-info}/PKG-INFO +1 -1
  5. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/LICENSE +0 -0
  6. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/MANIFEST.in +0 -0
  7. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/README.md +0 -0
  8. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/analysis_utils.py +0 -0
  9. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/const_utils.py +0 -0
  10. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/coord_utils.py +0 -0
  11. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/ext_utils.py +0 -0
  12. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/fft_utils.py +0 -0
  13. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/fits_utils.py +0 -0
  14. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/fitting_utils.py +0 -0
  15. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/los_utils.py +0 -0
  16. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/matrix_utils.py +0 -0
  17. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/noise_utils.py +0 -0
  18. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata/other_utils.py +0 -0
  19. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata.egg-info/SOURCES.txt +0 -0
  20. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata.egg-info/dependency_links.txt +0 -0
  21. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata.egg-info/not-zip-safe +0 -0
  22. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata.egg-info/requires.txt +0 -0
  23. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/plotastrodata.egg-info/top_level.txt +0 -0
  24. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/setup.cfg +0 -0
  25. {plotastrodata-1.8.8 → plotastrodata-1.8.9}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plotastrodata
3
- Version: 1.8.8
3
+ Version: 1.8.9
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.8'
4
+ __version__ = '1.8.9'
@@ -308,8 +308,10 @@ def set_minmax(data: np.ndarray, stretch: str, stretchscale: float,
308
308
  for k in ['vmin', 'vmax']:
309
309
  if k not in kw:
310
310
  kw[k] = [None] * n
311
- stretch = np.where(np.equal(stretch, None), sigma, stretch)
312
- cmin = np.where(np.equal(kw['vmin'], None), sigma, kw['vmin'])
311
+ isnan = np.equal(stretchscale, None)
312
+ stretchscale = np.where(isnan, sigma, stretchscale)
313
+ isnan = np.equal(kw['vmin'], None)
314
+ cmin = np.where(isnan, sigma, kw['vmin'])
313
315
 
314
316
  argslist = (stretch, stretchscale, stretchpower)
315
317
  for i, stretch_args in enumerate(zip(*argslist)):
@@ -861,20 +863,21 @@ class PlotAstroData(AstroFrame):
861
863
  cbticks = do_stretch(cbticks, *stretch_args)
862
864
  if cbticks is None and stretch == 'log':
863
865
  cbticks, cbticklabels = logcbticks()
864
- if cbticks is not None:
865
- cond = (vmin < cbticks) * (cbticks < vmax)
866
- cb.set_ticks(cbticks[cond])
867
- if cbticklabels is not None:
868
- tl = np.array(cbticklabels)[cond]
869
- else:
870
- t = undo_stretch(cb.get_ticks(), *stretch_args)
871
- tl = [f'{d:{cbformat[1:]}}' for d in t]
872
- cb.set_ticklabels(tl)
866
+ if cbticks is None:
867
+ cbticks = cb.get_ticks()
868
+ cond = (vmin < cbticks) * (cbticks < vmax)
869
+ cb.set_ticks(cbticks[cond])
870
+ if cbticklabels is not None:
871
+ tl = np.array(cbticklabels)[cond]
872
+ else:
873
+ t = undo_stretch(cb.get_ticks(), *stretch_args)
874
+ tl = [f'{d:{cbformat[1:]}}' for d in t]
875
+ cb.set_ticklabels(tl)
873
876
 
874
877
  def add_color(self,
875
878
  stretch: str = 'linear',
876
879
  stretchscale: float | None = None,
877
- stretchpower: float = 1,
880
+ stretchpower: float = 0.5,
878
881
  show_cbar: bool = True,
879
882
  cblabel: str | None = None,
880
883
  cbformat: float = '%.1e',
@@ -887,7 +890,7 @@ class PlotAstroData(AstroFrame):
887
890
  Args:
888
891
  stretch (str, optional): 'log', 'asinh', 'power', or 'linear'. Any other means 'linear'. 'log' means the mapped data are logarithmic. 'asinh' means the mapped data are arc sin hyperbolic. 'power' means the mapped data are power-law (see also stretchpower). Defaults to 'linear'.
889
892
  stretchscale (float, optional): Color scale is asinh(data / stretchscale). Defaults to None.
890
- stretchpower (float, optional): Color scale is ((data / stretchscale)**stretchpower - 1) / stretchpower / ln(10). 1 means the linear scale, while 0 means the logarithmic scale. Defaults to 1.
893
+ stretchpower (float, optional): Color scale is ((data / stretchscale)**stretchpower - 1) / stretchpower / ln(10). 1 means the linear scale, while 0 means the logarithmic scale. Defaults to 0.5.
891
894
  show_cbar (bool, optional): Show color bar. Defaults to True.
892
895
  cblabel (str, optional): Colorbar label. Defaults to None.
893
896
  cbformat (float, optional): Format for ticklabels of colorbar. Defaults to '%.1e'.
@@ -905,7 +908,9 @@ class PlotAstroData(AstroFrame):
905
908
 
906
909
  if cblabel is None:
907
910
  cblabel = bunit
908
-
911
+ if stretchscale is None:
912
+ stretchscale = sigma
913
+
909
914
  stretch_args = (stretch, stretchscale, stretchpower)
910
915
  c = set_minmax(c, *stretch_args, sigma, _kw)
911
916
  c = self.vskipfill(c, v)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plotastrodata
3
- Version: 1.8.8
3
+ Version: 1.8.9
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