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

Update DeepskyLog import of instruments #271

Open
wants to merge 3 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
36 changes: 13 additions & 23 deletions python/PiFinder/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ def equipment_import():
# Skip the naked eye
continue

make = instrument["instrument_make"]["name"]

obstruction_perc = instrument["obstruction_perc"]
if obstruction_perc is None:
obstruction_perc = 0
else:
obstruction_perc = float(obstruction_perc)

# Convert the html special characters (ampersand, quote, ...) in instrument["name"]
# to the corresponding character
instrument["name"] = instrument["name"].replace("&", "&")
Expand All @@ -355,33 +363,15 @@ def equipment_import():
instrument["name"] = instrument["name"].replace("&lt;", "<")
instrument["name"] = instrument["name"].replace("&gt;", ">")

flip = False
flop = False

if (
instrument["type"] == 2
or instrument["type"] == 4
or instrument["type"] == 6
or instrument["type"] == 8
or instrument["type"] == 9
):
# Refractor (2), Finderscope (4), Cassegrain (6), Maksutov (8), Schmidt Cassegrain (9)
flip = True
flop = False
elif instrument["type"] == 3 or instrument["type"] == 7:
# Reflector (3), Kutter (7)
flip = True
flop = True

new_instrument = Telescope(
make="",
make=make,
name=instrument["name"],
aperture_mm=int(instrument["diameter"]),
focal_length_mm=int(instrument["diameter"] * instrument["fd"]),
obstruction_perc=0,
mount_type="alt/az",
flip_image=flip,
flop_image=flop,
obstruction_perc=obstruction_perc,
mount_type=instrument["mount_type"]["name"].lower(),
flip_image=bool(instrument["flip_image"]),
flop_image=bool(instrument["flop_image"]),
reverse_arrow_a=False,
reverse_arrow_b=False,
)
Expand Down
2 changes: 1 addition & 1 deletion python/PiFinder/ui/menu_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def dyn_menu_equipment(cfg):
"class": UITextMenu,
"select": "single",
"label": "select_telescope",
"config_option": "equipment.actice_telescope",
"config_option": "equipment.active_telescope",
"items": telescope_menu_items,
}

Expand Down
2 changes: 1 addition & 1 deletion python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ luma.lcd==2.11.0
pillow==10.4.0
numpy==1.26.2
pandas==1.5.3
pydeepskylog==1.3.1
pydeepskylog==1.3.2
pyjwt==2.8.0
pytz==2022.7.1
requests==2.28.2
Expand Down