Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Adding WDS import, and a new way of handling object images #248

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,7 @@ astro_data/hip_main.dat
*.3mf
*.gcode
case/my_printer

# sqlite write-ahead log file and the shared memory file used by WAL mode.
*.db-shm
*.db-wal
comets.txt
3 changes: 3 additions & 0 deletions astro_data/WDS/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Source:
http://www.astro.gsu.edu/wds/Webtextfiles/wds_precise.txt

15 changes: 15 additions & 0 deletions astro_data/WDS/wds.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
WDS double star catalog

For systems with more than 2 stars:

Top-level info:
- all distinct discovery numbers are listed.
- Magnitudes are used of the first pair (assumed to be AB) to indicate the
achievability of at least the first pair.
- Positions are taken from the first pair, arcsecond positions are used when available.
- First/last year of discovery is consolidated as the lowest first and the highest last.

Per pair info:
- Components
- Position Angle, Separation, Magnitudes and primary proper motion
- Notes are copied verbatim
157,008 changes: 157,008 additions & 0 deletions astro_data/WDS/wds_precise.txt

Large diffs are not rendered by default.

Binary file modified astro_data/pifinder_objects.db
Binary file not shown.
22 changes: 17 additions & 5 deletions python/PiFinder/cat_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,24 @@ def get_display_image(catalog_object, source, fov, roll, display_class, burn_in=

def resolve_image_name(catalog_object, source):
"""
returns the image path for this objects
returns the image path for this object
"""
if catalog_object.image_name == "":
return ""

return f"{BASE_IMAGE_PATH}/{str(catalog_object.image_name)[-1]}/{catalog_object.image_name}_{source}.jpg"
def create_image_path(image_name):
image = f"{BASE_IMAGE_PATH}/{str(image_name)[-1]}/{image_name}_{source}.jpg"
return os.path.exists(image), image

if not catalog_object.image_name:
image_name = f"{catalog_object.catalog_code}{catalog_object.sequence}"
ok, image = create_image_path(image_name)
catalog_object.image_name = image
if not ok:
for name in catalog_object.names:
image_name = f"{''.join(name.split())}"
ok, image = create_image_path(image_name)
if ok:
catalog_object.image_name = image
break
return catalog_object.image_name


def create_catalog_image_dirs():
Expand Down
Loading
Loading