plotastrodata 1.0.3__tar.gz → 1.0.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 (21) hide show
  1. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/PKG-INFO +14 -8
  2. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/README.md +13 -6
  3. plotastrodata-1.0.5/plotastrodata/__init__.py +5 -0
  4. plotastrodata-1.0.5/plotastrodata/const_utils.py +83 -0
  5. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata/other_utils.py +5 -8
  6. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata.egg-info/PKG-INFO +14 -8
  7. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata.egg-info/SOURCES.txt +1 -0
  8. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata.egg-info/requires.txt +0 -1
  9. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/setup.cfg +0 -1
  10. plotastrodata-1.0.3/plotastrodata/__init__.py +0 -5
  11. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/LICENSE +0 -0
  12. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata/analysis_utils.py +0 -0
  13. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata/fft_utils.py +0 -0
  14. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata/fits_utils.py +0 -0
  15. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata/fitting_utils.py +0 -0
  16. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata/los_utils.py +0 -0
  17. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata/plot_utils.py +0 -0
  18. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata.egg-info/dependency_links.txt +0 -0
  19. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata.egg-info/not-zip-safe +0 -0
  20. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/plotastrodata.egg-info/top_level.txt +0 -0
  21. {plotastrodata-1.0.3 → plotastrodata-1.0.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plotastrodata
3
- Version: 1.0.3
3
+ Version: 1.0.5
4
4
  Summary: plotastrodata can be used mainly to make figures from FITS files, as well as other analyses in astronomy.
5
5
  Home-page: https://github.com/yusukeaso-astron/plotastrodata
6
6
  Download-URL: https://github.com/yusukeaso-astron/plotastrodata
@@ -13,7 +13,6 @@ License-File: LICENSE
13
13
  Requires-Dist: astropy
14
14
  Requires-Dist: corner
15
15
  Requires-Dist: dynesty
16
- Requires-Dist: ffmpeg
17
16
  Requires-Dist: matplotlib
18
17
  Requires-Dist: multiprocess
19
18
  Requires-Dist: numpy
@@ -29,18 +28,25 @@ Python package to make figures from radio astronomical data by astropy and matpl
29
28
 
30
29
 
31
30
  ## Demo and Usage
32
-
33
- The file example.py will help to find how to use this package.
31
+ For the installation, conda and are available.
32
+ ```bash
33
+ conda install conda-forge::plotastrodata
34
+ ```
35
+ or
36
+ ```bash
37
+ pip install plotastrodata
38
+ ```
39
+ The following is the way to install plotastrodata manually. The file example.py will help you find out how to use this package.
34
40
  ```bash
35
41
  git clone https://github.com/yusukeaso-astron/plotastrodata
36
42
  cd plotastrodata
37
43
  python example.py
38
44
  ```
39
- To keep the package updated, type the command below in the directory plotastrodata, always before you use.
45
+ To keep the package updated, always type the command below in the directory plotastrodata before you use it.
40
46
  ```bash
41
47
  git pull
42
48
  ```
43
- Also, setting the path in .bashrc (or .zshrc etc.) will be useful.
49
+ Also, setting the path in .bashrc (or .zshrc, etc.) will be useful.
44
50
  ```bash
45
51
  export PYTHONPATH=${PYTHONPATH}:/YOUR_PATH_TO/plotastrodata
46
52
  ```
@@ -94,7 +100,7 @@ git clone https://github.com/yusukeaso-astron/plotastrodata
94
100
 
95
101
  ## Note
96
102
 
97
- * For 3D data, a 1D velocity array or a FITS file with a velocity axis must be given to set up channels in each page.
103
+ * For 3D data, a 1D velocity array or a FITS file with a velocity axis must be given to set up channels on each page.
98
104
  * For 2D/3D data, the spatial center can be read from a FITS file or manually given.
99
105
  * len(v)=1 (default) means to make a 2D figure.
100
106
  * Spatial lengths are in the unit of arcsec, or au if dist (!= 1) is given.
@@ -102,7 +108,7 @@ git clone https://github.com/yusukeaso-astron/plotastrodata
102
108
  * For region, line, arrow, label, and marker, a single input can be treated without a list, e.g., anglelist=60, as well as anglelist=[60].
103
109
  * Each element of poslist supposes a text coordinate like '01h23m45.6s 01d23m45.6s' or a list of relative x and y like [0.2, 0.3] (0 is left or bottom, 1 is right or top).
104
110
  * Parameters for original methods in matplotlib.axes.Axes can be used as kwargs; see the default kwargs0 for reference.
105
- * Position-velocity diagrams (pv=True) does not yet suppot region, line, arrow, and segment because the units of abscissa and ordinate are different.
111
+ * Position-velocity diagrams (pv=True) do not yet support region, line, arrow, and segment because the units of abscissa and ordinate are different.
106
112
 
107
113
  ## Author
108
114
 
@@ -3,18 +3,25 @@ Python package to make figures from radio astronomical data by astropy and matpl
3
3
 
4
4
 
5
5
  ## Demo and Usage
6
-
7
- The file example.py will help to find how to use this package.
6
+ For the installation, conda and are available.
7
+ ```bash
8
+ conda install conda-forge::plotastrodata
9
+ ```
10
+ or
11
+ ```bash
12
+ pip install plotastrodata
13
+ ```
14
+ The following is the way to install plotastrodata manually. The file example.py will help you find out how to use this package.
8
15
  ```bash
9
16
  git clone https://github.com/yusukeaso-astron/plotastrodata
10
17
  cd plotastrodata
11
18
  python example.py
12
19
  ```
13
- To keep the package updated, type the command below in the directory plotastrodata, always before you use.
20
+ To keep the package updated, always type the command below in the directory plotastrodata before you use it.
14
21
  ```bash
15
22
  git pull
16
23
  ```
17
- Also, setting the path in .bashrc (or .zshrc etc.) will be useful.
24
+ Also, setting the path in .bashrc (or .zshrc, etc.) will be useful.
18
25
  ```bash
19
26
  export PYTHONPATH=${PYTHONPATH}:/YOUR_PATH_TO/plotastrodata
20
27
  ```
@@ -68,7 +75,7 @@ git clone https://github.com/yusukeaso-astron/plotastrodata
68
75
 
69
76
  ## Note
70
77
 
71
- * For 3D data, a 1D velocity array or a FITS file with a velocity axis must be given to set up channels in each page.
78
+ * For 3D data, a 1D velocity array or a FITS file with a velocity axis must be given to set up channels on each page.
72
79
  * For 2D/3D data, the spatial center can be read from a FITS file or manually given.
73
80
  * len(v)=1 (default) means to make a 2D figure.
74
81
  * Spatial lengths are in the unit of arcsec, or au if dist (!= 1) is given.
@@ -76,7 +83,7 @@ git clone https://github.com/yusukeaso-astron/plotastrodata
76
83
  * For region, line, arrow, label, and marker, a single input can be treated without a list, e.g., anglelist=60, as well as anglelist=[60].
77
84
  * Each element of poslist supposes a text coordinate like '01h23m45.6s 01d23m45.6s' or a list of relative x and y like [0.2, 0.3] (0 is left or bottom, 1 is right or top).
78
85
  * Parameters for original methods in matplotlib.axes.Axes can be used as kwargs; see the default kwargs0 for reference.
79
- * Position-velocity diagrams (pv=True) does not yet suppot region, line, arrow, and segment because the units of abscissa and ordinate are different.
86
+ * Position-velocity diagrams (pv=True) do not yet support region, line, arrow, and segment because the units of abscissa and ordinate are different.
80
87
 
81
88
  ## Author
82
89
 
@@ -0,0 +1,5 @@
1
+ import warnings
2
+
3
+ warnings.simplefilter('ignore', UserWarning)
4
+ __version_info__ = (1, 0, 5)
5
+ __version__ = '.'.join(map(str, __version_info__))
@@ -0,0 +1,83 @@
1
+ from astropy import constants
2
+ from astropy import units
3
+
4
+ # astropy.units in the SI unit system
5
+ au = units.au.to('m')
6
+ pc = units.pc.to('m')
7
+ arcsec = units.arcsec.to('radian')
8
+ Jy = units.Jy.to('J*s**(-1)*m**(-2)*Hz**(-1)')
9
+ deg = units.deg.to('radian')
10
+ year = units.year.to('s')
11
+ gauss = units.gauss.to('T')
12
+ cm = units.cm.to('m')
13
+ km = units.km.to('m')
14
+ gram = units.gram.to('kg')
15
+ debye = units.debye.to('A*s*m')
16
+ erg = units.erg.to('J')
17
+
18
+ # astropy.constants in the SI unit system
19
+ G = constants.G.si.value
20
+ N_A = constants.N_A.si.value
21
+ R = constants.R.si.value
22
+ Ryd = constants.Ryd.si.value
23
+ a0 = constants.a0.si.value
24
+ alpha = constants.alpha.si.value
25
+ atm = constants.atm.si.value
26
+ b_wien = constants.b_wien.si.value
27
+ c = constants.c.si.value
28
+ e = constants.e.si.value
29
+ eps0 = constants.eps0.si.value
30
+ g0 = constants.g0.si.value
31
+ h = constants.h.si.value
32
+ hbar = constants.hbar.si.value
33
+ k_B = constants.k_B.si.value
34
+ m_e = constants.m_e.si.value
35
+ m_n = constants.m_n.si.value
36
+ m_p = constants.m_p.si.value
37
+ mu0 = constants.mu0.si.value
38
+ muB = constants.muB.si.value
39
+ sigma_T = constants.sigma_T.si.value
40
+ sigma_sb = constants.sigma_sb.si.value
41
+ u = constants.u.si.value
42
+ GM_earth = constants.GM_earth.si.value
43
+ GM_jup = constants.GM_jup.si.value
44
+ GM_sun = constants.GM_sun.si.value
45
+ L_bol0 = constants.L_bol0.si.value
46
+ L_sun = constants.L_sun.si.value
47
+ M_earth = constants.M_earth.si.value
48
+ M_jup = constants.M_jup.si.value
49
+ M_sun = constants.M_sun.si.value
50
+ R_earth = constants.R_earth.si.value
51
+ R_jup = constants.R_jup.si.value
52
+ R_sun = constants.R_sun.si.value
53
+ kpc = constants.kpc.si.value
54
+
55
+ # Metric prefix
56
+ quetta = 1e30
57
+ ronna = 1e27
58
+ yotta = 1e24
59
+ zetta = 1e21
60
+ exa = 1e18
61
+ peta = 1e15
62
+ tera = 1e12
63
+ giga = 1e9
64
+ mega = 1e6
65
+ kilo = 1e3
66
+ hecto = 1e2
67
+ deca = 1e1
68
+ deci = 1e-1
69
+ centi = 1e-2
70
+ milli = 1e-3
71
+ micro = 1e-6
72
+ nano = 1e-9
73
+ pico = 1e-12
74
+ femto = 1e-15
75
+ atto = 1e-18
76
+ zepto = 1e-21
77
+ yocto = 1e-24
78
+ ronto = 1e-27
79
+ quecto = 1e-30
80
+
81
+ # Others
82
+ mumol = 2.37 * m_p # kg; Kauffmann et al. 2008, for sound speed
83
+ muH2 = 2.8 * m_p # kg; Kauffmann et al. 2008, for mass-H2 conversion
@@ -2,10 +2,12 @@ import subprocess
2
2
  import shlex
3
3
  import numpy as np
4
4
  from astropy.coordinates import SkyCoord
5
- from astropy import units, constants
5
+ from astropy import units
6
6
  from scipy.optimize import curve_fit
7
7
  from scipy.special import erf
8
8
 
9
+ from plotastrodata import const_utils as cu
10
+
9
11
 
10
12
  def terminal(cmd: str, **kwargs) -> None:
11
13
  """Run a terminal command through subprocess.run.
@@ -312,10 +314,7 @@ def BnuT(T: float = 30, nu: float = 230e9) -> float:
312
314
  Returns:
313
315
  float: Planck function in the SI units.
314
316
  """
315
- hh = constants.h.si.value
316
- cc = constants.c.si.value
317
- k_B = constants.k_B.si.value
318
- return 2 * hh * nu**3 / cc**2 / (np.exp(hh * nu / k_B / T) - 1)
317
+ return 2 * cu.h * nu**3 / cu.c**2 / (np.exp(cu.h * nu / cu.k_B / T) - 1)
319
318
 
320
319
 
321
320
  def JnuT(T: float = 30, nu: float = 230e9) -> float:
@@ -328,9 +327,7 @@ def JnuT(T: float = 30, nu: float = 230e9) -> float:
328
327
  Returns:
329
328
  float: Brightness temperature of Planck function in the unit of K.
330
329
  """
331
- hh = constants.h.si.value
332
- k_B = constants.k_B.si.value
333
- return hh * nu / k_B / (np.exp(hh * nu / k_B / T) - 1)
330
+ return cu.h * nu / cu.k_B / (np.exp(cu.h * nu / cu.k_B / T) - 1)
334
331
 
335
332
 
336
333
  def gaussian2d(xy: np.ndarray,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plotastrodata
3
- Version: 1.0.3
3
+ Version: 1.0.5
4
4
  Summary: plotastrodata can be used mainly to make figures from FITS files, as well as other analyses in astronomy.
5
5
  Home-page: https://github.com/yusukeaso-astron/plotastrodata
6
6
  Download-URL: https://github.com/yusukeaso-astron/plotastrodata
@@ -13,7 +13,6 @@ License-File: LICENSE
13
13
  Requires-Dist: astropy
14
14
  Requires-Dist: corner
15
15
  Requires-Dist: dynesty
16
- Requires-Dist: ffmpeg
17
16
  Requires-Dist: matplotlib
18
17
  Requires-Dist: multiprocess
19
18
  Requires-Dist: numpy
@@ -29,18 +28,25 @@ Python package to make figures from radio astronomical data by astropy and matpl
29
28
 
30
29
 
31
30
  ## Demo and Usage
32
-
33
- The file example.py will help to find how to use this package.
31
+ For the installation, conda and are available.
32
+ ```bash
33
+ conda install conda-forge::plotastrodata
34
+ ```
35
+ or
36
+ ```bash
37
+ pip install plotastrodata
38
+ ```
39
+ The following is the way to install plotastrodata manually. The file example.py will help you find out how to use this package.
34
40
  ```bash
35
41
  git clone https://github.com/yusukeaso-astron/plotastrodata
36
42
  cd plotastrodata
37
43
  python example.py
38
44
  ```
39
- To keep the package updated, type the command below in the directory plotastrodata, always before you use.
45
+ To keep the package updated, always type the command below in the directory plotastrodata before you use it.
40
46
  ```bash
41
47
  git pull
42
48
  ```
43
- Also, setting the path in .bashrc (or .zshrc etc.) will be useful.
49
+ Also, setting the path in .bashrc (or .zshrc, etc.) will be useful.
44
50
  ```bash
45
51
  export PYTHONPATH=${PYTHONPATH}:/YOUR_PATH_TO/plotastrodata
46
52
  ```
@@ -94,7 +100,7 @@ git clone https://github.com/yusukeaso-astron/plotastrodata
94
100
 
95
101
  ## Note
96
102
 
97
- * For 3D data, a 1D velocity array or a FITS file with a velocity axis must be given to set up channels in each page.
103
+ * For 3D data, a 1D velocity array or a FITS file with a velocity axis must be given to set up channels on each page.
98
104
  * For 2D/3D data, the spatial center can be read from a FITS file or manually given.
99
105
  * len(v)=1 (default) means to make a 2D figure.
100
106
  * Spatial lengths are in the unit of arcsec, or au if dist (!= 1) is given.
@@ -102,7 +108,7 @@ git clone https://github.com/yusukeaso-astron/plotastrodata
102
108
  * For region, line, arrow, label, and marker, a single input can be treated without a list, e.g., anglelist=60, as well as anglelist=[60].
103
109
  * Each element of poslist supposes a text coordinate like '01h23m45.6s 01d23m45.6s' or a list of relative x and y like [0.2, 0.3] (0 is left or bottom, 1 is right or top).
104
110
  * Parameters for original methods in matplotlib.axes.Axes can be used as kwargs; see the default kwargs0 for reference.
105
- * Position-velocity diagrams (pv=True) does not yet suppot region, line, arrow, and segment because the units of abscissa and ordinate are different.
111
+ * Position-velocity diagrams (pv=True) do not yet support region, line, arrow, and segment because the units of abscissa and ordinate are different.
106
112
 
107
113
  ## Author
108
114
 
@@ -4,6 +4,7 @@ setup.cfg
4
4
  setup.py
5
5
  plotastrodata/__init__.py
6
6
  plotastrodata/analysis_utils.py
7
+ plotastrodata/const_utils.py
7
8
  plotastrodata/fft_utils.py
8
9
  plotastrodata/fits_utils.py
9
10
  plotastrodata/fitting_utils.py
@@ -1,7 +1,6 @@
1
1
  astropy
2
2
  corner
3
3
  dynesty
4
- ffmpeg
5
4
  matplotlib
6
5
  multiprocess
7
6
  numpy
@@ -19,7 +19,6 @@ install_requires =
19
19
  astropy
20
20
  corner
21
21
  dynesty
22
- ffmpeg
23
22
  matplotlib
24
23
  multiprocess
25
24
  numpy
@@ -1,5 +0,0 @@
1
- import warnings
2
-
3
- warnings.simplefilter('ignore', UserWarning)
4
- __version_info__ = (1, 0, 3)
5
- __version__ = '.'.join(map(str, __version_info__))
File without changes
File without changes