plotastrodata 1.6.2__tar.gz → 1.6.3.post1__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.6.2 → plotastrodata-1.6.3.post1}/PKG-INFO +4 -2
  2. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/README.md +2 -1
  3. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/__init__.py +1 -1
  4. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/analysis_utils.py +0 -2
  5. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/coord_utils.py +51 -53
  6. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata.egg-info/PKG-INFO +4 -2
  7. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/setup.cfg +2 -2
  8. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/LICENSE +0 -0
  9. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/const_utils.py +0 -0
  10. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/ext_utils.py +0 -0
  11. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/fft_utils.py +0 -0
  12. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/fits_utils.py +0 -0
  13. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/fitting_utils.py +0 -0
  14. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/los_utils.py +0 -0
  15. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/matrix_utils.py +0 -0
  16. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/other_utils.py +0 -0
  17. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata/plot_utils.py +0 -0
  18. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata.egg-info/SOURCES.txt +0 -0
  19. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata.egg-info/dependency_links.txt +0 -0
  20. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata.egg-info/not-zip-safe +0 -0
  21. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata.egg-info/requires.txt +0 -0
  22. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/plotastrodata.egg-info/top_level.txt +0 -0
  23. {plotastrodata-1.6.2 → plotastrodata-1.6.3.post1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plotastrodata
3
- Version: 1.6.2
3
+ Version: 1.6.3.post1
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
@@ -9,6 +9,7 @@ License: GNU General Public License Version 3
9
9
  Keywords: astronomy,FITS,plot
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
12
13
  License-File: LICENSE
13
14
  Requires-Dist: astropy
14
15
  Requires-Dist: corner
@@ -28,6 +29,8 @@ Dynamic: license-file
28
29
 
29
30
  # plotastrodata
30
31
  Python package to make figures from radio astronomical data by astropy and matplotlib.
32
+ The API, examples, and gallery are available in [readthedocs](https://plotastrodata.readthedocs.io/en/latest/).
33
+ The PDF manual is available [here](https://github.com/yusukeaso-astron/plotastrodata/blob/main/plotastrodata_manual.pdf).
31
34
 
32
35
 
33
36
  ## Demo and Usage
@@ -58,7 +61,6 @@ Or directly in your script,
58
61
  import sys
59
62
  sys.path.append( "/YOUR_PATH_TO/plotastrodata" )
60
63
  ```
61
- The Sphinx html document is available from docs/_build/index.html or [readthedocs](https://plotastrodata.readthedocs.io/en/latest/).
62
64
 
63
65
  ## Features
64
66
 
@@ -1,5 +1,7 @@
1
1
  # plotastrodata
2
2
  Python package to make figures from radio astronomical data by astropy and matplotlib.
3
+ The API, examples, and gallery are available in [readthedocs](https://plotastrodata.readthedocs.io/en/latest/).
4
+ The PDF manual is available [here](https://github.com/yusukeaso-astron/plotastrodata/blob/main/plotastrodata_manual.pdf).
3
5
 
4
6
 
5
7
  ## Demo and Usage
@@ -30,7 +32,6 @@ Or directly in your script,
30
32
  import sys
31
33
  sys.path.append( "/YOUR_PATH_TO/plotastrodata" )
32
34
  ```
33
- The Sphinx html document is available from docs/_build/index.html or [readthedocs](https://plotastrodata.readthedocs.io/en/latest/).
34
35
 
35
36
  ## Features
36
37
 
@@ -1,4 +1,4 @@
1
1
  import warnings
2
2
 
3
3
  warnings.simplefilter('ignore', UserWarning)
4
- __version__ = '1.6.2'
4
+ __version__ = '1.6.3-1'
@@ -346,8 +346,6 @@ class AstroData():
346
346
  if (center := self.center) is not None:
347
347
  xy = popt[1:3] / 3600
348
348
  newcenter = xy2coord(xy, coordorg=center)
349
- if len(c := center.split()) == 3:
350
- newcenter = f'{c[0]} {newcenter}'
351
349
  else:
352
350
  newcenter = None
353
351
  return {'popt': popt, 'pcov': pcov,
@@ -3,41 +3,11 @@ from astropy.coordinates import SkyCoord, FK5, FK4
3
3
  from astropy import units
4
4
 
5
5
 
6
- def _getframe(coord: str, s: str = '') -> tuple:
7
- """Internal function to pick up the frame name from the coordinates.
8
-
9
- Args:
10
- coord (str): something like "J2000 01h23m45.6s 01d23m45.6s"
11
- s (str, optional): To distinguish coord and coordorg. Defaults to ''.
12
-
13
- Returns:
14
- tuple: updated coord and frame. frame is FK5(equinox='J2000), FK4(equinox='B1950'), or 'icrs'.
15
- """
16
- if len(c := coord.split()) == 3:
17
- coord = f'{c[1]} {c[2]}'
18
- if 'J2000' in c[0]:
19
- frame = FK5(equinox='J2000')
20
- elif 'FK5' in c[0]:
21
- frame = FK5(equinox='J2000')
22
- elif 'B1950' in c[0]:
23
- frame = FK4(equinox='B1950')
24
- elif 'FK4' in c[0]:
25
- frame = FK4(equinox='B1950')
26
- elif 'ICRS' in c[0]:
27
- frame = 'icrs'
28
- else:
29
- print(f'Unknown equinox found in coord{s}. ICRS is used')
30
- frame = 'icrs'
31
- else:
32
- frame = None
33
- return coord, frame
34
-
35
-
36
6
  def _updateframe(frame: str) -> str:
37
7
  """Internal function to str frame to astropy frame.
38
8
 
39
9
  Args:
40
- frame (str): _description_
10
+ frame (str): This should be one of 'J2000', 'B1950', 'FK5', 'FK4', and 'ICRS'.
41
11
 
42
12
  Returns:
43
13
  str: frame as is, FK5(equinox='J2000'), FK4(equinox='B1950'), or 'icrs'.
@@ -48,11 +18,41 @@ def _updateframe(frame: str) -> str:
48
18
  a = FK5(equinox='J2000')
49
19
  elif 'B1950' in frame or 'FK4' in frame:
50
20
  a = FK4(equinox='B1950')
21
+ elif type(frame) is str:
22
+ print(f'Unknown frame ({frame}) was found. Use ICRS instead.')
23
+ a = 'icrs'
51
24
  else:
52
25
  a = frame
53
26
  return a
54
27
 
55
28
 
29
+ def _getframe(coord: str) -> tuple:
30
+ """Internal function to pick up the frame name from the coordinates. When coord is a list, frame and framename are picked up from the first element.
31
+
32
+ Args:
33
+ coord (str): something like "J2000 01h23m45.6s 01d23m45.6s" or a list of them.
34
+
35
+ Returns:
36
+ tuple: updated coord and frame. frame is FK5(equinox='J2000), FK4(equinox='B1950'), or 'icrs'.
37
+ """
38
+ def getframe_single(s: str) -> tuple:
39
+ c = s.split()
40
+ hasframe = len(c) == 3
41
+ hmsdms = f'{c[1]} {c[2]}' if hasframe else s
42
+ frame = _updateframe(c[0]) if hasframe else None
43
+ framename = c[0] if hasframe else None
44
+ return hmsdms, frame, framename
45
+
46
+ if type(coord) is str:
47
+ return getframe_single(coord)
48
+ else:
49
+ outlist = [getframe_single(c) for c in coord]
50
+ hmsdms = [a[0] for a in outlist]
51
+ frame = outlist[0][1]
52
+ framename = outlist[0][2]
53
+ return hmsdms, frame, framename
54
+
55
+
56
56
  def coord2xy(coords: str | list, coordorg: str = '00h00m00s 00d00m00s',
57
57
  frame: str | None = None, frameorg: str | None = None,
58
58
  ) -> np.ndarray:
@@ -67,23 +67,18 @@ def coord2xy(coords: str | list, coordorg: str = '00h00m00s 00d00m00s',
67
67
  Returns:
68
68
  np.ndarray: [(array of) alphas, (array of) deltas] in degree. The shape of alphas and deltas is the input shape. With a single input, the output is [alpha0, delta0].
69
69
  """
70
- coordorg, frameorg_c = _getframe(coordorg, 'org')
71
- frameorg = frameorg_c if frameorg is None else _updateframe(frameorg)
72
- if type(coords) is list:
73
- for i in range(len(coords)):
74
- coords[i], frame_c = _getframe(coords[i])
75
- else:
76
- coords, frame_c = _getframe(coords)
77
- frame = frame_c if frame is None else _updateframe(frame)
78
- if frame is None and frameorg is not None:
70
+ coordorg, frameorg_in, _ = _getframe(coordorg)
71
+ frameorg = frameorg_in if frameorg is None else _updateframe(frameorg)
72
+ coords, frame_in, _ = _getframe(coords)
73
+ frame = frame_in if frame is None else _updateframe(frame)
74
+ if frame is None:
79
75
  frame = frameorg
80
- if frame is not None and frameorg is None:
76
+ elif frameorg is None:
81
77
  frameorg = frame
82
- if frame is None and frameorg is None:
83
- frame = frameorg = 'icrs'
84
- clist = SkyCoord(coords, frame=frame)
85
- c0 = SkyCoord(coordorg, frame=frameorg)
86
- c0 = c0.transform_to(frame=frame)
78
+ c0 = SkyCoord(coordorg, frame=frameorg) # frame=None means ICRS.
79
+ if frame is not None:
80
+ c0 = c0.transform_to(frame=frame)
81
+ clist = SkyCoord(coords, frame=frame) # frame=None means ICRS.
87
82
  xy = c0.spherical_offsets_to(clist)
88
83
  return np.array([xy[0].degree, xy[1].degree])
89
84
 
@@ -102,15 +97,18 @@ def xy2coord(xy: list, coordorg: str = '00h00m00s 00d00m00s',
102
97
  Returns:
103
98
  str: something like '01h23m45.6s 01d23m45.6s'. With multiple inputs, the output has the input shape.
104
99
  """
105
- coordorg, frameorg_c = _getframe(coordorg, 'org')
106
- frameorg = frameorg_c if frameorg is None else _updateframe(frameorg)
107
- if frameorg is None:
108
- frameorg = 'icrs'
100
+ coordorg, frameorg_in, framenameorg = _getframe(coordorg)
101
+ frameorg = frameorg_in if frameorg is None else _updateframe(frameorg)
102
+ framename = framenameorg if frame is None else frame
109
103
  frame = frameorg if frame is None else _updateframe(frame)
110
- c0 = SkyCoord(coordorg, frame=frameorg)
104
+ c0 = SkyCoord(coordorg, frame=frameorg) # frame=None means ICRS.
111
105
  coords = c0.spherical_offsets_by(*xy * units.degree)
112
- coords = coords.transform_to(frame=frame)
113
- return coords.to_string('hmsdms')
106
+ if frame is not None:
107
+ coords = coords.transform_to(frame=frame)
108
+ s = coords.to_string('hmsdms')
109
+ if framename is not None:
110
+ s = f'{framename} {s}'
111
+ return s
114
112
 
115
113
 
116
114
  def rel2abs(xrel: float, yrel: float,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plotastrodata
3
- Version: 1.6.2
3
+ Version: 1.6.3.post1
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
@@ -9,6 +9,7 @@ License: GNU General Public License Version 3
9
9
  Keywords: astronomy,FITS,plot
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
12
13
  License-File: LICENSE
13
14
  Requires-Dist: astropy
14
15
  Requires-Dist: corner
@@ -28,6 +29,8 @@ Dynamic: license-file
28
29
 
29
30
  # plotastrodata
30
31
  Python package to make figures from radio astronomical data by astropy and matplotlib.
32
+ The API, examples, and gallery are available in [readthedocs](https://plotastrodata.readthedocs.io/en/latest/).
33
+ The PDF manual is available [here](https://github.com/yusukeaso-astron/plotastrodata/blob/main/plotastrodata_manual.pdf).
31
34
 
32
35
 
33
36
  ## Demo and Usage
@@ -58,7 +61,6 @@ Or directly in your script,
58
61
  import sys
59
62
  sys.path.append( "/YOUR_PATH_TO/plotastrodata" )
60
63
  ```
61
- The Sphinx html document is available from docs/_build/index.html or [readthedocs](https://plotastrodata.readthedocs.io/en/latest/).
62
64
 
63
65
  ## Features
64
66
 
@@ -4,6 +4,7 @@ author = yusukeaso-astron
4
4
  version = attr: plotastrodata.__version__
5
5
  description = plotastrodata is a tool for astronomers to create figures from FITS files and perform fundamental data analyses with ease.
6
6
  long_description = file: README.md
7
+ long_description_content_type = text/markdown
7
8
  keywords = astronomy, FITS, plot
8
9
  license = GNU General Public License Version 3
9
10
  url = https://github.com/yusukeaso-astron/plotastrodata
@@ -11,9 +12,8 @@ download_url = https://github.com/yusukeaso-astron/plotastrodata
11
12
  classifiers = Programming Language :: Python :: 3
12
13
 
13
14
  [options]
14
- packages = plotastrodata
15
+ packages = find:
15
16
  zip_safe = False
16
- include_packge_data = True
17
17
  python_requires = >=3.10
18
18
  install_requires =
19
19
  astropy