plotastrodata 1.7.8__tar.gz → 1.7.10__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.7.8/plotastrodata.egg-info → plotastrodata-1.7.10}/PKG-INFO +1 -1
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/__init__.py +1 -1
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/analysis_utils.py +2 -1
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/fits_utils.py +1 -1
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/other_utils.py +20 -11
- {plotastrodata-1.7.8 → plotastrodata-1.7.10/plotastrodata.egg-info}/PKG-INFO +1 -1
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/LICENSE +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/MANIFEST.in +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/README.md +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/const_utils.py +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/coord_utils.py +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/ext_utils.py +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/fft_utils.py +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/fitting_utils.py +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/los_utils.py +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/matrix_utils.py +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata/plot_utils.py +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata.egg-info/SOURCES.txt +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata.egg-info/dependency_links.txt +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata.egg-info/not-zip-safe +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata.egg-info/requires.txt +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/plotastrodata.egg-info/top_level.txt +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/setup.cfg +0 -0
- {plotastrodata-1.7.8 → plotastrodata-1.7.10}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotastrodata
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.10
|
|
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
|
|
@@ -379,7 +379,8 @@ class AstroData():
|
|
|
379
379
|
Returns:
|
|
380
380
|
tuple: (bins, histogram)
|
|
381
381
|
"""
|
|
382
|
-
hist, hbin = np.histogram(self.data,
|
|
382
|
+
hist, hbin = np.histogram(self.data[~np.isnan(self.data)],
|
|
383
|
+
**kwargs)
|
|
383
384
|
hbin = (hbin[:-1] + hbin[1:]) / 2
|
|
384
385
|
return hbin, hist
|
|
385
386
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import warnings
|
|
2
2
|
import numpy as np
|
|
3
3
|
from scipy.optimize import curve_fit, OptimizeWarning
|
|
4
|
-
from scipy.special import
|
|
4
|
+
from scipy.special import exp1
|
|
5
5
|
from scipy.interpolate import RegularGridInterpolator as RGI
|
|
6
6
|
|
|
7
7
|
from plotastrodata.matrix_utils import Mrot, dot2d
|
|
@@ -104,21 +104,30 @@ def estimate_rms(data: np.ndarray, sigma: float | str | None = 'hist'
|
|
|
104
104
|
m0, s0 = np.nanmean(data), np.nanstd(data)
|
|
105
105
|
hist, hbin = np.histogram(data[~np.isnan(data)],
|
|
106
106
|
bins=100, density=True,
|
|
107
|
-
range=(m0 - s0 * 5,
|
|
107
|
+
range=(m0 - s0 * 3.5,
|
|
108
|
+
m0 + s0 * 3.5))
|
|
108
109
|
hist, hbin = hist * s0, (hbin[:-1] + hbin[1:]) / 2 / s0
|
|
109
110
|
if sigma[4:] == '-pbcor':
|
|
110
|
-
def g(x, s,
|
|
111
|
-
xn =
|
|
112
|
-
|
|
111
|
+
def g(x, s, R):
|
|
112
|
+
xn = x / np.sqrt(2) / s
|
|
113
|
+
pbcor = np.exp2(R**2)
|
|
114
|
+
y1 = xn**2
|
|
115
|
+
y2 = y1 / pbcor**2
|
|
116
|
+
area = 2 * np.sqrt(2 * np.pi) * s * (pbcor - 1)
|
|
117
|
+
p = (exp1(y2) - exp1(y1)) / area
|
|
118
|
+
return p
|
|
119
|
+
popt, _ = curve_fit(g, hbin, hist, p0=[1, 1],
|
|
120
|
+
bounds=[[0.001, 0.001], [2, 2]])
|
|
121
|
+
ave = 0
|
|
122
|
+
noise = popt[0]
|
|
113
123
|
else:
|
|
114
|
-
def g(x, s, c
|
|
124
|
+
def g(x, s, c):
|
|
115
125
|
xn = (x - c) / np.sqrt(2) / s
|
|
116
126
|
return np.exp(-xn**2) / np.sqrt(2 * np.pi) / s
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
noise = popt[0]
|
|
127
|
+
popt, _ = curve_fit(g, hbin, hist, p0=[1, 0],
|
|
128
|
+
bounds=[[0.001, -2], [2, 2]])
|
|
129
|
+
ave = popt[1]
|
|
130
|
+
noise = popt[0]
|
|
122
131
|
warning_offset(ave, noise)
|
|
123
132
|
noise = noise * s0
|
|
124
133
|
return noise
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotastrodata
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.10
|
|
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
|