plotastrodata 1.4.13__tar.gz → 1.4.15__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.4.13 → plotastrodata-1.4.15}/PKG-INFO +1 -1
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/__init__.py +1 -1
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/analysis_utils.py +20 -22
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/plot_utils.py +2 -1
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata.egg-info/PKG-INFO +1 -1
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/LICENSE +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/README.md +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/const_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/coord_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/ext_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/fft_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/fits_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/fitting_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/los_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/matrix_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata/other_utils.py +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata.egg-info/SOURCES.txt +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata.egg-info/dependency_links.txt +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata.egg-info/not-zip-safe +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata.egg-info/requires.txt +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/plotastrodata.egg-info/top_level.txt +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/setup.cfg +0 -0
- {plotastrodata-1.4.13 → plotastrodata-1.4.15}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotastrodata
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.15
|
|
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
|
|
@@ -97,6 +97,7 @@ class AstroData():
|
|
|
97
97
|
restfreq: float | None = None
|
|
98
98
|
cfactor: float = 1
|
|
99
99
|
pvpa: float | None = None
|
|
100
|
+
pv: bool = False
|
|
100
101
|
|
|
101
102
|
def __post_init__(self):
|
|
102
103
|
n = 0
|
|
@@ -124,7 +125,6 @@ class AstroData():
|
|
|
124
125
|
self.sigma_org = None
|
|
125
126
|
self.beam_org = None
|
|
126
127
|
self.fitsheader = None
|
|
127
|
-
self.pv = False
|
|
128
128
|
|
|
129
129
|
def binning(self, width: list[int, int, int] = [1, 1, 1]):
|
|
130
130
|
"""Binning up neighboring pixels in the v, y, and x domain.
|
|
@@ -204,7 +204,9 @@ class AstroData():
|
|
|
204
204
|
g1 /= np.sqrt(np.pi/4/np.log(2) * bmin * np.sqrt(1 - bmin**2/bmaj**2))
|
|
205
205
|
g = np.zeros((ny, nx))
|
|
206
206
|
g[:, (nx - 1) // 2] = g1
|
|
207
|
-
d =
|
|
207
|
+
d = self.data.copy()
|
|
208
|
+
d[np.isnan(d)] = 0
|
|
209
|
+
d = to4dim(d)
|
|
208
210
|
d = [[convolve(c, g, mode='same') for c in cc] for cc in d]
|
|
209
211
|
self.data = np.squeeze(d)
|
|
210
212
|
self.rotate(bpa)
|
|
@@ -461,7 +463,7 @@ class AstroData():
|
|
|
461
463
|
d = {'data': self.data, 'x': self.x, 'y': self.y, 'v': self.v,
|
|
462
464
|
'fitsimage': self.fitsimage, 'beam': self.beam, 'Tb': self.Tb,
|
|
463
465
|
'restfreq': self.restfreq, 'cfactor': self.cfactor,
|
|
464
|
-
'sigma': self.sigma, 'center': self.center}
|
|
466
|
+
'sigma': self.sigma, 'center': self.center, 'pv': self.pv}
|
|
465
467
|
return d
|
|
466
468
|
|
|
467
469
|
def writetofits(self, fitsimage: str = 'out.fits', header: dict = {}):
|
|
@@ -473,7 +475,8 @@ class AstroData():
|
|
|
473
475
|
"""
|
|
474
476
|
fhd = self.fitsheader
|
|
475
477
|
h = {}
|
|
476
|
-
|
|
478
|
+
nocent = self.pv or self.center is None
|
|
479
|
+
cx, cy = (0, 0) if nocent else coord2xy(self.center)
|
|
477
480
|
h['NAXIS1'] = len(self.x)
|
|
478
481
|
h['CRPIX1'] = np.argmin(np.abs(self.x)) + 1
|
|
479
482
|
h['CRVAL1'] = cx
|
|
@@ -673,21 +676,19 @@ class AstroFrame():
|
|
|
673
676
|
d.beam[i] = fd.get_beam(dist=self.dist)
|
|
674
677
|
d.bunit[i] = fd.get_header('BUNIT')
|
|
675
678
|
if d.data[i] is not None:
|
|
676
|
-
d.pv[i] = self.pv
|
|
677
679
|
d.sigma_org[i] = d.sigma[i]
|
|
678
680
|
d.sigma[i] = estimate_rms(d.data[i], d.sigma[i])
|
|
679
681
|
d.data[i], grid = trim(data=d.data[i],
|
|
680
682
|
x=grid[0], y=grid[1], v=grid[2],
|
|
681
683
|
xlim=self.xlim, ylim=self.ylim,
|
|
682
684
|
vlim=self.vlim, pv=self.pv)
|
|
683
|
-
|
|
684
|
-
|
|
685
|
+
v = grid[2]
|
|
686
|
+
has_v = v is not None and len(v) > 1
|
|
687
|
+
if has_v and v[1] < v[0]:
|
|
688
|
+
d.data[i], v = d.data[i][::-1], v[::-1]
|
|
685
689
|
print('Velocity has been inverted.')
|
|
686
|
-
d.v =
|
|
687
|
-
|
|
688
|
-
d.dv = d.v[1] - d.v[0]
|
|
689
|
-
else:
|
|
690
|
-
d.dv = None
|
|
690
|
+
d.v = v
|
|
691
|
+
d.dv = v[1] - v[0] if has_v else None
|
|
691
692
|
grid = grid[:3:2] if self.pv else grid[:2]
|
|
692
693
|
if self.swapxy:
|
|
693
694
|
grid = [grid[1], grid[0]]
|
|
@@ -699,15 +700,11 @@ class AstroFrame():
|
|
|
699
700
|
a = a[::yskip, ::xskip]
|
|
700
701
|
a = np.moveaxis(a, [0, 1], [-2, -1])
|
|
701
702
|
d.data[i] = a
|
|
702
|
-
d.x, d.y = grid
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
if d.y is not None and len(d.y) > 1:
|
|
708
|
-
d.dy = d.y[1] - d.y[0]
|
|
709
|
-
else:
|
|
710
|
-
d.dy = None
|
|
703
|
+
x, y = d.x, d.y = grid
|
|
704
|
+
has_x = x is not None and len(x) > 1
|
|
705
|
+
d.dx = x[1] - x[0] if has_x else None
|
|
706
|
+
has_y = y is not None and len(y) > 1
|
|
707
|
+
d.dy = y[1] - y[0] if has_y else None
|
|
711
708
|
if self.quadrants is not None:
|
|
712
709
|
d.data[i], d.x, d.y \
|
|
713
710
|
= quadrantmean(d.data[i], d.x, d.y, self.quadrants)
|
|
@@ -724,7 +721,7 @@ class AstroFrame():
|
|
|
724
721
|
header['BMIN'] = d.beam[i][1] / 3600 / self.dist
|
|
725
722
|
d.data[i] = d.data[i] * Jy2K(header=header)
|
|
726
723
|
d.sigma[i] = d.sigma[i] * Jy2K(header=header)
|
|
727
|
-
if self.pv and None not in d.beam[i]:
|
|
724
|
+
if self.pv and not d.pv[i] and None not in d.beam[i]:
|
|
728
725
|
bmaj, bmin, bpa = d.beam_org[i] = d.beam[i]
|
|
729
726
|
if d.pvpa[i] is None:
|
|
730
727
|
d.pvpa[i] = bpa
|
|
@@ -732,6 +729,7 @@ class AstroFrame():
|
|
|
732
729
|
p = np.radians(bpa - d.pvpa[i])
|
|
733
730
|
b = 1 / np.hypot(np.cos(p) / bmaj, np.sin(p) / bmin)
|
|
734
731
|
d.beam[i] = np.array([np.abs(d.dv), b, 0])
|
|
732
|
+
d.pv[i] = self.pv
|
|
735
733
|
d.Tb[i] = False
|
|
736
734
|
d.cfactor[i] = 1
|
|
737
735
|
if d.fitsimage[i] is not None:
|
|
@@ -686,7 +686,8 @@ class PlotAstroData(AstroFrame):
|
|
|
686
686
|
cbticklabels (list, optional): Ticklabels of colorbar. Defaults to None.
|
|
687
687
|
cblocation (str, optional): 'left', 'top', 'left', 'right'. Only for 2D images. Defaults to 'right'.
|
|
688
688
|
"""
|
|
689
|
-
_kw = {'cmap': 'cubehelix', 'alpha': 1,
|
|
689
|
+
_kw = {'cmap': 'cubehelix', 'alpha': 1,
|
|
690
|
+
'edgecolors': 'none', 'zorder': 1}
|
|
690
691
|
beam_kwargs = kwargs2beamargs(kwargs)
|
|
691
692
|
_kw.update(kwargs)
|
|
692
693
|
d = kwargs2AstroData(_kw)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotastrodata
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.15
|
|
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
|