thuban 0.0.1__tar.gz → 0.0.3__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 (28) hide show
  1. thuban-0.0.3/MANIFEST.in +1 -0
  2. {thuban-0.0.1 → thuban-0.0.3}/PKG-INFO +1 -1
  3. {thuban-0.0.1 → thuban-0.0.3}/pyproject.toml +1 -1
  4. {thuban-0.0.1 → thuban-0.0.3}/thuban/catalog.py +6 -1
  5. thuban-0.0.3/thuban/data/reduced_hip.csv +113760 -0
  6. {thuban-0.0.1 → thuban-0.0.3}/thuban/pointing.py +28 -17
  7. {thuban-0.0.1 → thuban-0.0.3}/thuban.egg-info/PKG-INFO +1 -1
  8. {thuban-0.0.1 → thuban-0.0.3}/thuban.egg-info/SOURCES.txt +3 -1
  9. {thuban-0.0.1 → thuban-0.0.3}/LICENSE +0 -0
  10. {thuban-0.0.1 → thuban-0.0.3}/README.md +0 -0
  11. {thuban-0.0.1 → thuban-0.0.3}/setup.cfg +0 -0
  12. {thuban-0.0.1 → thuban-0.0.3}/tests/test_catalog.py +0 -0
  13. {thuban-0.0.1 → thuban-0.0.3}/tests/test_cli.py +0 -0
  14. {thuban-0.0.1 → thuban-0.0.3}/tests/test_distortion.py +0 -0
  15. {thuban-0.0.1 → thuban-0.0.3}/tests/test_pointing.py +0 -0
  16. {thuban-0.0.1 → thuban-0.0.3}/tests/test_util.py +0 -0
  17. {thuban-0.0.1 → thuban-0.0.3}/tests/test_visualize.py +0 -0
  18. {thuban-0.0.1 → thuban-0.0.3}/thuban/__init__.py +0 -0
  19. {thuban-0.0.1 → thuban-0.0.3}/thuban/cli.py +0 -0
  20. {thuban-0.0.1 → thuban-0.0.3}/thuban/distortion.py +0 -0
  21. {thuban-0.0.1 → thuban-0.0.3}/thuban/error.py +0 -0
  22. {thuban-0.0.1 → thuban-0.0.3}/thuban/simulate.py +0 -0
  23. {thuban-0.0.1 → thuban-0.0.3}/thuban/util.py +0 -0
  24. {thuban-0.0.1 → thuban-0.0.3}/thuban/visualize.py +0 -0
  25. {thuban-0.0.1 → thuban-0.0.3}/thuban.egg-info/dependency_links.txt +0 -0
  26. {thuban-0.0.1 → thuban-0.0.3}/thuban.egg-info/entry_points.txt +0 -0
  27. {thuban-0.0.1 → thuban-0.0.3}/thuban.egg-info/requires.txt +0 -0
  28. {thuban-0.0.1 → thuban-0.0.3}/thuban.egg-info/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ include thuban/data/reduced_hip.csv
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: thuban
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: High precision and accuracy astrometric image solving from a guess
5
5
  Author-email: "J. Marcus Hughes" <hughes.jmb@gmail.com>
6
6
  Maintainer-email: "J. Marcus Hughes" <hughes.jmb@gmail.com>
@@ -5,7 +5,7 @@ requires = ["setuptools",
5
5
 
6
6
  [project]
7
7
  name = "thuban"
8
- version = "0.0.1"
8
+ version = "0.0.3"
9
9
  dependencies = ["numpy",
10
10
  "astropy",
11
11
  "matplotlib",
@@ -1,4 +1,5 @@
1
1
  import os
2
+ from typing import Callable
2
3
 
3
4
  import astropy.units as u
4
5
  import numpy as np
@@ -163,7 +164,7 @@ def filter_for_visible_stars(catalog: pd.DataFrame, dimmest_magnitude: float = 6
163
164
 
164
165
 
165
166
  def find_catalog_in_image(
166
- catalog: pd.DataFrame, wcs: WCS, image_shape: (int, int),
167
+ catalog: pd.DataFrame, wcs: WCS, image_shape: (int, int), mask: Callable = None,
167
168
  mode: str = "all"
168
169
  ) -> np.ndarray:
169
170
  """Using the provided WCS converts the RA/DEC catalog into pixel coordinates
@@ -195,6 +196,10 @@ def find_catalog_in_image(
195
196
  except NoConvergence as e:
196
197
  xs, ys = e.best_solution[:, 0], e.best_solution[:, 1]
197
198
  bounds_mask = (0 <= xs) * (xs < image_shape[0]) * (0 <= ys) * (ys < image_shape[1])
199
+
200
+ if mask is not None:
201
+ bounds_mask *= mask(xs, ys)
202
+
198
203
  reduced_catalog = catalog[bounds_mask].copy()
199
204
  reduced_catalog["x_pix"] = xs[bounds_mask]
200
205
  reduced_catalog['y_pix'] = ys[bounds_mask]