plotastrodata 1.9.19__tar.gz → 1.9.20__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.19/plotastrodata.egg-info → plotastrodata-1.9.20}/PKG-INFO +6 -7
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/README.md +4 -4
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/__init__.py +1 -1
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/analysis_utils.py +1 -1
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/fitting_utils.py +15 -14
- {plotastrodata-1.9.19 → plotastrodata-1.9.20/plotastrodata.egg-info}/PKG-INFO +6 -7
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata.egg-info/requires.txt +0 -1
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/setup.cfg +1 -2
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/LICENSE +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/MANIFEST.in +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/const_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/coord_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/ext_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/fft_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/fits_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/los_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/matrix_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/noise_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/other_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata/plot_utils.py +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata.egg-info/SOURCES.txt +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata.egg-info/dependency_links.txt +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata.egg-info/not-zip-safe +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/plotastrodata.egg-info/top_level.txt +0 -0
- {plotastrodata-1.9.19 → plotastrodata-1.9.20}/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.20
|
|
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
|
|
@@ -8,7 +8,7 @@ Author: yusukeaso-astron
|
|
|
8
8
|
License: GNU General Public License Version 3
|
|
9
9
|
Keywords: astronomy,FITS,plot
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: astropy>=7.2
|
|
@@ -16,7 +16,6 @@ Requires-Dist: corner
|
|
|
16
16
|
Requires-Dist: dynesty
|
|
17
17
|
Requires-Dist: emcee
|
|
18
18
|
Requires-Dist: matplotlib
|
|
19
|
-
Requires-Dist: multiprocess
|
|
20
19
|
Requires-Dist: numpy>=2.0
|
|
21
20
|
Requires-Dist: pillow
|
|
22
21
|
Requires-Dist: plotly
|
|
@@ -81,14 +80,14 @@ plotastrodata can do the following things.
|
|
|
81
80
|
|
|
82
81
|
## Requirement
|
|
83
82
|
|
|
84
|
-
*
|
|
83
|
+
* Python >= 3.11
|
|
84
|
+
* astropy >= 7.2
|
|
85
85
|
* corner (only for fitting)
|
|
86
86
|
* dynesty (only for fitting)
|
|
87
|
-
* emcee (only for fitting)
|
|
87
|
+
* emcee >= 3.0 (only for fitting)
|
|
88
88
|
* ffmpeg (only for movie)
|
|
89
89
|
* matplotlib
|
|
90
|
-
*
|
|
91
|
-
* numpy
|
|
90
|
+
* numpy >= 2.0
|
|
92
91
|
* pillow (only for RGB figures)
|
|
93
92
|
* plotly (only for html cube)
|
|
94
93
|
* ptemcee (only for fitting)
|
|
@@ -52,14 +52,14 @@ plotastrodata can do the following things.
|
|
|
52
52
|
|
|
53
53
|
## Requirement
|
|
54
54
|
|
|
55
|
-
*
|
|
55
|
+
* Python >= 3.11
|
|
56
|
+
* astropy >= 7.2
|
|
56
57
|
* corner (only for fitting)
|
|
57
58
|
* dynesty (only for fitting)
|
|
58
|
-
* emcee (only for fitting)
|
|
59
|
+
* emcee >= 3.0 (only for fitting)
|
|
59
60
|
* ffmpeg (only for movie)
|
|
60
61
|
* matplotlib
|
|
61
|
-
*
|
|
62
|
-
* numpy
|
|
62
|
+
* numpy >= 2.0
|
|
63
63
|
* pillow (only for RGB figures)
|
|
64
64
|
* plotly (only for html cube)
|
|
65
65
|
* ptemcee (only for fitting)
|
|
@@ -856,6 +856,6 @@ class AstroFrame():
|
|
|
856
856
|
d.beam = _as_list(d.beam, d.n, isbeam=True)
|
|
857
857
|
grid = [d.x, d.y, d.v]
|
|
858
858
|
for i in range(d.n):
|
|
859
|
-
self._read_one(d, i, grid.copy())
|
|
859
|
+
self._read_one(d, i, grid.copy()) # .copy() not to updated d.x again ang again.
|
|
860
860
|
for name in ASTRODATA_ARGS + ['beam']:
|
|
861
861
|
setattr(d, name, _scalar_if_single(getattr(d, name), d.n))
|
|
@@ -38,9 +38,9 @@ def logp(x: np.ndarray) -> float:
|
|
|
38
38
|
def _get_GR(samples: np.ndarray, nwalkers: int, ndata: int, dim: int
|
|
39
39
|
) -> np.ndarray:
|
|
40
40
|
"""Calculate the Gelman-Rubin statistics."""
|
|
41
|
-
B = np.std(np.mean(samples, axis=
|
|
42
|
-
W = np.mean(np.std(samples, axis=
|
|
43
|
-
V = (len(samples
|
|
41
|
+
B = np.std(np.mean(samples, axis=0), axis=0)
|
|
42
|
+
W = np.mean(np.std(samples, axis=0), axis=0)
|
|
43
|
+
V = (len(samples) - 1) / len(samples) * W \
|
|
44
44
|
+ (nwalkers + 1) / (nwalkers - 1) * B
|
|
45
45
|
d = ndata - dim - 1
|
|
46
46
|
GR = np.sqrt((d + 3) / (d + 1) * V / W)
|
|
@@ -66,7 +66,7 @@ class EmceeCorner():
|
|
|
66
66
|
|
|
67
67
|
This class wraps ``emcee`` and ``ptemcee`` for simple bounded-parameter fitting. The likelihood can be supplied directly through ``logl``, or it can be constructed from ``model``, ``xdata``, ``ydata``, and ``sigma``. Parameters are sampled with a uniform prior inside ``bounds`` and zero prior probability outside them.
|
|
68
68
|
|
|
69
|
-
After calling :meth:`fit`, the main results are stored as attributes:``samples`` for the post-burn-in chain, ``popt`` for the maximum-likelihood parameter set, and ``plow``, ``pmid``, and ``phigh`` for posterior percentiles.
|
|
69
|
+
After calling :meth:`fit`, the main results are stored as attributes:``samples`` for the post-burn-in chain, ``popt`` for the maximum-likelihood parameter set, and ``plow``, ``pmid``, and ``phigh`` for posterior percentiles. ``samples`` has the shape ``(steps, walkers, dimensions)``. The samples can be visualized with :meth:`plotcorner` and :meth:`plotchain`.
|
|
70
70
|
|
|
71
71
|
Args:
|
|
72
72
|
bounds (np.ndarray): Parameter bounds with shape ``(dim, 2)``. logl (Callable, optional): Log-likelihood function. Defaults to None.
|
|
@@ -146,22 +146,23 @@ class EmceeCorner():
|
|
|
146
146
|
pt: bool) -> np.ndarray:
|
|
147
147
|
"""Extract post-burn-in samples from sampler chain."""
|
|
148
148
|
if pt:
|
|
149
|
-
|
|
149
|
+
chain = sampler.chain[0] # walkers, steps, dim
|
|
150
|
+
return np.swapaxes(chain, 0, 1)[nburnin:, :, :] # steps, walkers, dim
|
|
150
151
|
else:
|
|
151
|
-
return sampler.
|
|
152
|
+
return sampler.get_chain(discard=nburnin) # steps, walkers, dim
|
|
152
153
|
|
|
153
154
|
def _get_lnp_popt(self, sampler: Any, pt: bool, nburnin: int,
|
|
154
155
|
) -> tuple[np.ndarray, np.ndarray]:
|
|
155
156
|
"""Get log probabilities and best-fit parameters from sampler."""
|
|
156
157
|
if pt:
|
|
157
|
-
lnp = sampler.logprobability[0]
|
|
158
|
-
chain = sampler.chain[0]
|
|
158
|
+
lnp = np.swapaxes(sampler.logprobability[0], 0, 1)
|
|
159
|
+
chain = np.swapaxes(sampler.chain[0], 0, 1)
|
|
159
160
|
else:
|
|
160
|
-
lnp = sampler.
|
|
161
|
-
chain = sampler.
|
|
161
|
+
lnp = sampler.get_log_prob() # steps, walkers
|
|
162
|
+
chain = sampler.get_chain() # steps, walkers, dim
|
|
162
163
|
idx_best = np.unravel_index(np.argmax(lnp), lnp.shape)
|
|
163
164
|
popt = chain[idx_best]
|
|
164
|
-
lnp = lnp[:,
|
|
165
|
+
lnp = lnp[nburnin:, :]
|
|
165
166
|
return lnp, popt
|
|
166
167
|
|
|
167
168
|
def _get_percentiles(self, samples: np.ndarray
|
|
@@ -266,14 +267,14 @@ class EmceeCorner():
|
|
|
266
267
|
if ylim is None:
|
|
267
268
|
ylim = self.bounds
|
|
268
269
|
fig = plt.figure(figsize=(4, 2 * self.dim))
|
|
269
|
-
x = np.arange(np.shape(self.samples)[
|
|
270
|
+
x = np.arange(np.shape(self.samples)[0])
|
|
270
271
|
naverage = max(1, len(x) // 100)
|
|
271
272
|
nend = len(x) - len(x) % 100 if naverage > 1 else len(x)
|
|
272
273
|
x = x[:nend:naverage]
|
|
273
274
|
for i in range(self.dim):
|
|
274
|
-
y = self.samples[:, :, i] #
|
|
275
|
+
y = self.samples[:, :, i] # steps, walkers, dim
|
|
275
276
|
plist = [self.percent[0], 50, self.percent[1]]
|
|
276
|
-
y = [np.percentile(y, p, axis=
|
|
277
|
+
y = [np.percentile(y, p, axis=1) for p in plist] # percent over the walkers, steps
|
|
277
278
|
y = [[np.percentile(np.reshape(yy[:nend], (naverage, -1)), p, axis=0)
|
|
278
279
|
for p in plist] for yy in y] # percent over the walkers, percent over the steps
|
|
279
280
|
ax = fig.add_subplot(self.dim, 1, i + 1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotastrodata
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.20
|
|
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
|
|
@@ -8,7 +8,7 @@ Author: yusukeaso-astron
|
|
|
8
8
|
License: GNU General Public License Version 3
|
|
9
9
|
Keywords: astronomy,FITS,plot
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: astropy>=7.2
|
|
@@ -16,7 +16,6 @@ Requires-Dist: corner
|
|
|
16
16
|
Requires-Dist: dynesty
|
|
17
17
|
Requires-Dist: emcee
|
|
18
18
|
Requires-Dist: matplotlib
|
|
19
|
-
Requires-Dist: multiprocess
|
|
20
19
|
Requires-Dist: numpy>=2.0
|
|
21
20
|
Requires-Dist: pillow
|
|
22
21
|
Requires-Dist: plotly
|
|
@@ -81,14 +80,14 @@ plotastrodata can do the following things.
|
|
|
81
80
|
|
|
82
81
|
## Requirement
|
|
83
82
|
|
|
84
|
-
*
|
|
83
|
+
* Python >= 3.11
|
|
84
|
+
* astropy >= 7.2
|
|
85
85
|
* corner (only for fitting)
|
|
86
86
|
* dynesty (only for fitting)
|
|
87
|
-
* emcee (only for fitting)
|
|
87
|
+
* emcee >= 3.0 (only for fitting)
|
|
88
88
|
* ffmpeg (only for movie)
|
|
89
89
|
* matplotlib
|
|
90
|
-
*
|
|
91
|
-
* numpy
|
|
90
|
+
* numpy >= 2.0
|
|
92
91
|
* pillow (only for RGB figures)
|
|
93
92
|
* plotly (only for html cube)
|
|
94
93
|
* ptemcee (only for fitting)
|
|
@@ -14,14 +14,13 @@ classifiers = Programming Language :: Python :: 3
|
|
|
14
14
|
[options]
|
|
15
15
|
packages = find:
|
|
16
16
|
zip_safe = False
|
|
17
|
-
python_requires = >=3.
|
|
17
|
+
python_requires = >=3.11
|
|
18
18
|
install_requires =
|
|
19
19
|
astropy >= 7.2
|
|
20
20
|
corner
|
|
21
21
|
dynesty
|
|
22
22
|
emcee
|
|
23
23
|
matplotlib
|
|
24
|
-
multiprocess
|
|
25
24
|
numpy >= 2.0
|
|
26
25
|
pillow
|
|
27
26
|
plotly
|
|
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
|