plotastrodata 1.4.4__tar.gz → 1.4.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 (23) hide show
  1. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/PKG-INFO +1 -1
  2. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/__init__.py +1 -1
  3. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/plot_utils.py +27 -9
  4. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata.egg-info/PKG-INFO +1 -1
  5. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/LICENSE +0 -0
  6. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/README.md +0 -0
  7. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/analysis_utils.py +0 -0
  8. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/const_utils.py +0 -0
  9. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/coord_utils.py +0 -0
  10. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/ext_utils.py +0 -0
  11. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/fft_utils.py +0 -0
  12. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/fits_utils.py +0 -0
  13. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/fitting_utils.py +0 -0
  14. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/los_utils.py +0 -0
  15. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/matrix_utils.py +0 -0
  16. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata/other_utils.py +0 -0
  17. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata.egg-info/SOURCES.txt +0 -0
  18. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata.egg-info/dependency_links.txt +0 -0
  19. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata.egg-info/not-zip-safe +0 -0
  20. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata.egg-info/requires.txt +0 -0
  21. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/plotastrodata.egg-info/top_level.txt +0 -0
  22. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/setup.cfg +0 -0
  23. {plotastrodata-1.4.4 → plotastrodata-1.4.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plotastrodata
3
- Version: 1.4.4
3
+ Version: 1.4.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', UserWarning)
4
- __version__ = '1.4.4'
4
+ __version__ = '1.4.5'
@@ -481,7 +481,8 @@ class PlotAstroData(AstroFrame):
481
481
  def add_beam(self,
482
482
  beam: list[float | None, float | None, float | None] = [None, None, None],
483
483
  beamcolor: str = 'gray',
484
- beampos: list[float, float] | None = None) -> None:
484
+ beampos: list[float, float] | None = None,
485
+ **kwargs) -> None:
485
486
  """Use add_region(). All the arguments may be a list of each format.
486
487
 
487
488
  Args:
@@ -505,10 +506,12 @@ class PlotAstroData(AstroFrame):
505
506
  if self.swapxy:
506
507
  bp = np.transpose(bp)
507
508
  bpa = 90 - bpa
509
+ _kw = {'facecolor': bc, 'edgecolor': None}
510
+ _kw.update(kwargs)
508
511
  self.add_region(patch=patch, poslist=bp,
509
512
  majlist=bmaj, minlist=bmin, palist=bpa,
510
513
  include_chan=include_chan,
511
- facecolor=bc, edgecolor=None)
514
+ **_kw)
512
515
 
513
516
  def add_marker(self, poslist: list[str | list[float, float]] = [],
514
517
  include_chan: list[int] | None = None, **kwargs) -> None:
@@ -646,7 +649,9 @@ class PlotAstroData(AstroFrame):
646
649
  cbformat: float = '%.1e', cbticks: list[float] | None = None,
647
650
  cbticklabels: list[str] | None = None, cblocation: str = 'right',
648
651
  show_beam: bool = True, beamcolor: str = 'gray',
649
- beampos: list[float, float] | None = None, **kwargs) -> None:
652
+ beampos: list[float, float] | None = None,
653
+ beam_kwargs: dict = {},
654
+ **kwargs) -> None:
650
655
  """Use Axes.pcolormesh of matplotlib. kwargs must include the arguments of AstroData to specify the data to be plotted.
651
656
 
652
657
  Args:
@@ -663,6 +668,7 @@ class PlotAstroData(AstroFrame):
663
668
  show_beam (bool, optional): Defaults to True.
664
669
  beamcolor (str, optional): Matplotlib color. Defaults to 'gray'.
665
670
  beampos (list, optional): Relative position. Defaults to None.
671
+ beam_kwargs (dict, optional): Keyword arguments for add_beam(). Defaults to {}.
666
672
  """
667
673
  _kw = {'cmap': 'cubehelix', 'alpha': 1, 'edgecolors': 'none', 'zorder': 1}
668
674
  _kw.update(kwargs)
@@ -724,12 +730,15 @@ class PlotAstroData(AstroFrame):
724
730
  ticklin = cmin_org * ticklin**(1 / (1 - stretchpower))
725
731
  cb.set_ticklabels([f'{d:{cbformat[1:]}}' for d in ticklin])
726
732
  if show_beam:
727
- self.add_beam(beam=beam, beamcolor=beamcolor, beampos=beampos)
733
+ self.add_beam(beam=beam, beamcolor=beamcolor, beampos=beampos,
734
+ **beam_kwargs)
728
735
 
729
736
  def add_contour(self, xskip: int = 1, yskip: int = 1,
730
737
  levels: list[float] = [-12, -6, -3, 3, 6, 12, 24, 48, 96, 192, 384],
731
738
  show_beam: bool = True, beamcolor: str = 'gray',
732
- beampos: list[float, float] | None = None, **kwargs) -> None:
739
+ beampos: list[float, float] | None = None,
740
+ beam_kwargs: dict = {},
741
+ **kwargs) -> None:
733
742
  """Use Axes.contour of matplotlib. kwargs must include the arguments of AstroData to specify the data to be plotted.
734
743
 
735
744
  Args:
@@ -738,6 +747,7 @@ class PlotAstroData(AstroFrame):
738
747
  show_beam (bool, optional): Defaults to True.
739
748
  beamcolor (str, optional): Matplotlib color. Defaults to 'gray'.
740
749
  beampos (list, optional): Relative position. Defaults to None.
750
+ beam_kwargs (dict, optional): Keyword arguments for add_beam(). Defaults to {}.
741
751
  """
742
752
  _kw = {'colors': 'gray', 'linewidths': 1.0, 'zorder': 2}
743
753
  _kw.update(kwargs)
@@ -752,7 +762,8 @@ class PlotAstroData(AstroFrame):
752
762
  for axnow, cnow in zip(self.ax, c):
753
763
  axnow.contour(x, y, cnow, np.sort(levels) * sigma, **_kw)
754
764
  if show_beam:
755
- self.add_beam(beam=beam, beamcolor=beamcolor, beampos=beampos)
765
+ self.add_beam(beam=beam, beamcolor=beamcolor, beampos=beampos,
766
+ **beam_kwargs)
756
767
 
757
768
  def add_segment(self, ampfits: str = None, angfits: str = None,
758
769
  Ufits: str = None, Qfits: str = None,
@@ -765,7 +776,9 @@ class PlotAstroData(AstroFrame):
765
776
  rotation: float = 0.,
766
777
  cutoff: float = 3.,
767
778
  show_beam: bool = True, beamcolor: str = 'gray',
768
- beampos: list[float, float] | None = None, **kwargs) -> None:
779
+ beampos: list[float, float] | None = None,
780
+ beam_kwargs: dict = {},
781
+ **kwargs) -> None:
769
782
  """Use Axes.quiver of matplotlib. kwargs must include the arguments of AstroData to specify the data to be plotted. fitsimage = [ampfits, angfits, Ufits, Qfits]. data = [amp, ang, stU, stQ].
770
783
 
771
784
  Args:
@@ -785,6 +798,7 @@ class PlotAstroData(AstroFrame):
785
798
  show_beam (bool, optional): Defaults to True.
786
799
  beamcolor (str, optional): Matplotlib color. Defaults to 'gray'.
787
800
  beampos (list, optional): Relative position. Defaults to None.
801
+ beam_kwargs (dict, optional): Keyword arguments for add_beam(). Defaults to {}.
788
802
  """
789
803
  _kw = {'angles': 'xy', 'scale_units': 'xy', 'color': 'gray',
790
804
  'pivot': 'mid', 'headwidth': 0, 'headlength': 0,
@@ -820,7 +834,8 @@ class PlotAstroData(AstroFrame):
820
834
  for axnow, unow, vnow in zip(self.ax, U, V):
821
835
  axnow.quiver(x, y, unow, vnow, **_kw)
822
836
  if show_beam:
823
- self.add_beam(beam=beam, beamcolor=beamcolor, beampos=beampos)
837
+ self.add_beam(beam=beam, beamcolor=beamcolor, beampos=beampos,
838
+ **beam_kwargs)
824
839
 
825
840
  def add_rgb(self, xskip: int = 1, yskip: int = 1,
826
841
  stretch: list[str, str, str] = ['linear'] * 3,
@@ -829,6 +844,7 @@ class PlotAstroData(AstroFrame):
829
844
  show_beam: bool = True,
830
845
  beamcolor: list[str, str, str] = ['red', 'green', 'blue'],
831
846
  beampos: list[list[float, float] | None] = [None, None, None],
847
+ beam_kwargs: dict = {},
832
848
  **kwargs) -> None:
833
849
  """Use PIL.Image and imshow of matplotlib. kwargs must include the arguments of AstroData to specify the data to be plotted. A three-element array ([red, green, blue]) is supposed for all arguments, except for xskip, yskip and show_beam, including vmax and vmin.
834
850
 
@@ -840,6 +856,7 @@ class PlotAstroData(AstroFrame):
840
856
  show_beam (bool, optional): Defaults to True.
841
857
  beamcolor (list, optional): Matplotlib color. Defaults to ['red', 'green', 'blue'].
842
858
  beampos (list, optional): Relative position. Defaults to None.
859
+ beam_kwargs (dict, optional): Keyword arguments for add_beam(). Defaults to {}.
843
860
  """
844
861
  from PIL import Image
845
862
 
@@ -873,7 +890,8 @@ class PlotAstroData(AstroFrame):
873
890
  axnow.imshow(im, extent=[x[0], x[-1], y[0], y[-1]])
874
891
  axnow.set_aspect(np.abs((x[-1]-x[0]) / (y[-1]-y[0])))
875
892
  if show_beam:
876
- self.add_beam(beam=beam, beamcolor=beamcolor, beampos=beampos)
893
+ self.add_beam(beam=beam, beamcolor=beamcolor, beampos=beampos,
894
+ **beam_kwargs)
877
895
 
878
896
  def _set_axis_shared(self, pa2: PlotAxes2D, title: dict | str | None):
879
897
  """Internal method used in set_axis() and set_axis_radec().
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plotastrodata
3
- Version: 1.4.4
3
+ Version: 1.4.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