Skip to content

Commit

Permalink
Merge pull request #49 from WWGolay/dev
Browse files Browse the repository at this point in the history
Documentation and testing for Observatory+
  • Loading branch information
WWGolay authored Oct 3, 2023
2 parents 5e35299 + 90c611c commit 1206b53
Show file tree
Hide file tree
Showing 49 changed files with 10,922 additions and 1,224 deletions.
Binary file removed .coverage
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ dmypy.json
.DS_Store
*ascom.alpaca.simulators*
*OmniSim*
!.coverage
!coverage.xml
docs/source/api/auto_api/
9,140 changes: 9,140 additions & 0 deletions coverage.xml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
graphviz_dot = "/usr/local/bin/dot"

html_theme_options = {

"logo": {
"image_light": "_static/pyscope_logo_small_gray.png",
"image_dark": "_static/pyscope_logo_small.png",
Expand All @@ -46,7 +45,7 @@
"url": "https://macroconsortium.org",
"icon": "fa-solid fa-shuttle-space",
},
]
],
}

intersphinx_mapping["click"] = ("https://click.palletsprojects.com/en/8.1.x/", None)
Expand Down
33 changes: 32 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
[build-system]
requires = ["setuptools>=42.0", "wheel"]
requires = ["setuptools>=42.0", "wheel", "numpy>=1.25"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
"--cov",
"--cov-report=xml"
]

[tool.black]
line-length = 88

[tool.coverage]
[tool.coverage.run]
branch = true

[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_also = [
# Skip any pass lines such as may be used for @abstractmethod
"pass",

# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",

# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",

# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",

# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
3 changes: 2 additions & 1 deletion pyscope/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@

import logging

__version__ = "0.1.2"

from . import utils
from . import observatory
from . import telrun
Expand All @@ -82,4 +84,3 @@
logger.setLevel(logging.INFO)

__all__ = ["analysis", "observatory", "reduction", "telrun", "utils"]
__version__ = "0.1.1"
48 changes: 14 additions & 34 deletions pyscope/config/observatory.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ site_name = Winer Observatory

instrument_name = Robert L. Mutel Telescope

instrument_description =
instrument_description = 20-inch PlaneWave CDK

latitude = # dd:mm:ss.s
latitude = 31:39:56.08 # dd:mm:ss.s

longitude = # dd:mm:ss.s
longitude = -110:36:06.42 # dd:mm:ss.s

elevation = # meters
elevation = 1515.7 # meters

diameter = # meters
diameter = 0.508 # meters

focal_length = # meters
focal_length = 3.454 # meters


[camera]
Expand All @@ -23,8 +23,6 @@ camera_driver = maxim

camera_ascom = False

camera_args =

camera_kwargs =

cooler_setpoint = -20 # Celsius
Expand All @@ -40,9 +38,7 @@ cover_calibrator_driver = ip_cover_calibrator

cover_calibrator_ascom = False

cover_calibrator_args =

cover_calibrator_kwargs =
cover_calibrator_kwargs = tcp_ip:192.168.2.22,tcp_port:2101,buffer_size:1024

cover_calibrator_alt = 30.09397

Expand All @@ -55,8 +51,6 @@ dome_driver =

dome_ascom =

dome_args =

dome_kwargs =


Expand All @@ -66,8 +60,6 @@ filter_wheel_driver = maxim

filter_wheel_ascom = False

filter_wheel_args =

filter_wheel_kwargs =

filters = L, 6, V, B, H, W, O, 1, I, X, G, R
Expand All @@ -81,39 +73,31 @@ focuser_driver = ASCOM.PWI3.Focuser

focuser_ascom = True

focuser_args =

focuser_kwargs =

focuser_max_error = 10 # counts


[observing_conditions]

observing_conditions_driver = weather_winer
observing_conditions_driver = html_observing_conditions

observing_conditions_ascom = False

observing_conditions_args =

observing_conditions_kwargs = url:https://winer.org/Site/Weather.php


[rotator]

rotator_driver =

rotator_ascom = False

rotator_args =
rotator_ascom =

rotator_kwargs =

rotator_reverse = False
rotator_reverse =

rotator_min_angle = 0 # degrees
rotator_min_angle =

rotator_max_angle = 360 # degrees
rotator_max_angle =


[safety_monitor]
Expand All @@ -140,8 +124,6 @@ telescope_driver = SiTech.Telescope

telescope_ascom = True

telescope_args =

telescope_kwargs =

min_altitude = 21 # degrees
Expand All @@ -153,18 +135,16 @@ settle_time = 5

autofocus_driver = pwi_autofocus

autofocus_args =

autofocus_kwargs =


[wcs]

driver_0 = maxim

driver_1 = pinpoint_wcs
driver_1 = astrometry_net_wcs

driver_2 = astrometry_net_wcs
driver_2 =

[scheduling]

Expand Down
16 changes: 10 additions & 6 deletions pyscope/observatory/ascom_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ def AbortExposure(self):
logger.debug(f"ASCOMCamera.AbortExposure() called")
self._device.AbortExposure()

def Choose(self, cameraID):
logger.debug(f"ASCOMCamera.Choose({cameraID}) called")
self._device.Choose(cameraID)

def PulseGuide(self, Direction, Duration):
logger.debug(f"ASCOMCamera.PulseGuide({Direction}, {Duration}) called")
self._device.PulseGuide(Direction, Duration)
Expand All @@ -37,12 +33,20 @@ def StopExposure(self):
self._device.StopExposure()

@property
def BayerOffsetX(self):
def BayerOffsetX(self): # pragma: no cover
"""
.. warning::
This property is not implemented in the ASCOM Alpaca protocol.
"""
logger.debug(f"ASCOMCamera.BayerOffsetX property called")
return self._device.BayerOffsetX

@property
def BayerOffsetY(self):
def BayerOffsetY(self): # pragma: no cover
"""
.. warning::
This property is not implemented in the ASCOM Alpaca protocol.
"""
logger.debug(f"ASCOMCamera.BayerOffsetY property called")
return self._device.BayerOffsetY

Expand Down
4 changes: 0 additions & 4 deletions pyscope/observatory/ascom_cover_calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ def CalibratorOn(self, Brightness):
logger.debug(f"ASCOMCoverCalibrator.CalibratorOn({Brightness}) called")
self._device.CalibratorOn(Brightness)

def Choose(self, CalibratorID):
logger.debug(f"ASCOMCoverCalibrator.Choose({CalibratorID}) called")
self._device.Choose(CalibratorID)

def CloseCover(self):
logger.debug(f"ASCOMCoverCalibrator.CloseCover() called")
self._device.CloseCover()
Expand Down
29 changes: 18 additions & 11 deletions pyscope/observatory/ascom_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,33 @@ def Action(self, ActionName, *ActionParameters):
logger.debug(f"ASCOMDevice.Action({ActionName}, {ActionParameters})")
return self._device.Action(ActionName, *ActionParameters)

def CommandBlind(self, Command, Raw):
def CommandBlind(self, Command, Raw): # pragma: no cover
"""
.. deprecated:: 0.1.1
ASCOM is deprecating this method.
"""

logger.debug(f"ASCOMDevice.CommandBlind({Command}, {Raw})")
self._device.CommandBlind(Command, Raw)

def CommandBool(self, Command, Raw):
def CommandBool(self, Command, Raw): # pragma: no cover
"""
.. deprecated:: 0.1.1
ASCOM is deprecating this method.
"""

logger.debug(f"ASCOMDevice.CommandBool({Command}, {Raw})")
return self._device.CommandBool(Command, Raw)

def CommandString(self, Command, Raw):
def CommandString(self, Command, Raw): # pragma: no cover
"""
.. deprecated:: 0.1.1
ASCOM is deprecating this method.
"""

logger.debug(f"ASCOMDevice.CommandString({Command}, {Raw})")
return self._device.CommandString(Command, Raw)

"""def Dispose(self):
logger.debug(f"ASCOMDevice.Dispose()")
self._device.Dispose()
def SetupDialog(self):
logger.debug(f"ASCOMDevice.SetupDialog()")
self._device.SetupDialog()"""

@property
def Connected(self):
logger.debug(f"ASCOMDevice.Connected property")
Expand Down
4 changes: 0 additions & 4 deletions pyscope/observatory/ascom_dome.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ def AbortSlew(self):
logger.debug(f"ASCOMDome.AbortSlew() called")
self._device.AbortSlew()

def Choose(self, DomeID):
logger.debug(f"ASCOMDome.Choose({DomeID}) called")
self._device.Choose(DomeID)

def CloseShutter(self):
logger.debug(f"ASCOMDome.CloseShutter() called")
self._device.CloseShutter()
Expand Down
4 changes: 0 additions & 4 deletions pyscope/observatory/ascom_filter_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
protocol=protocol,
)

def Choose(self, FilterWheelID):
logger.debug(f"ASCOMFilterWheel.Choose({FilterWheelID}) called")
self._device.Choose(FilterWheelID)

@property
def FocusOffsets(self):
logger.debug(f"ASCOMFilterWheel.FocusOffsets property called")
Expand Down
14 changes: 0 additions & 14 deletions pyscope/observatory/ascom_focuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
protocol=protocol,
)

def Choose(self, FocuserID):
logger.debug(f"ASCOMFocuser.Choose({FocuserID}) called")
self._device.Choose(FocuserID)

def Halt(self):
logger.debug(f"ASCOMFocuser.Halt() called")
self._device.Halt()
Expand All @@ -38,16 +34,6 @@ def IsMoving(self):
logger.debug(f"ASCOMFocuser.IsMoving property called")
return self._device.IsMoving

@property
def Link(self):
logger.debug(f"ASCOMFocuser.Link property called")
return self._device.Link

@Link.setter
def Link(self, value):
logger.debug(f"ASCOMFocuser.Link property set to {value}")
self._device.Link = value

@property
def MaxIncrement(self):
logger.debug(f"ASCOMFocuser.MaxIncrement property called")
Expand Down
4 changes: 0 additions & 4 deletions pyscope/observatory/ascom_observing_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
protocol=protocol,
)

def Choose(self, ObservingConditionsID):
logger.debug(f"ASCOMObservingConditions.Choose({ObservingConditionsID}) called")
self._device.Choose(ObservingConditionsID)

def Refresh(self):
logger.debug("ASCOMObservingConditions.Refresh() called")
self._device.Refresh()
Expand Down
4 changes: 0 additions & 4 deletions pyscope/observatory/ascom_rotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
protocol=protocol,
)

def Choose(self, RotatorID):
logger.debug(f"ASCOMRotator.Choose({RotatorID}) called")
self._device.Choose(RotatorID)

def Halt(self):
logger.debug("ASCOMRotator.Halt() called")
self._device.Halt()
Expand Down
4 changes: 0 additions & 4 deletions pyscope/observatory/ascom_safety_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
protocol=protocol,
)

def Choose(self, SafetyMonitorID):
logger.debug(f"ASCOMSafetyMonitor.Choose({SafetyMonitorID}) called")
self._device.Choose(SafetyMonitorID)

@property
def IsSafe(self):
logger.debug(f"ASCOMSafetyMonitor.IsSafe property called")
Expand Down
4 changes: 0 additions & 4 deletions pyscope/observatory/ascom_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ def CanWrite(self, ID):
logger.debug(f"ASCOMSwitch.CanWrite({ID}) called")
return self._device.CanWrite(ID)

def Choose(self, SwitchID):
logger.debug(f"ASCOMSwitch.Choose({SwitchID}) called")
self._device.Choose(SwitchID)

def GetSwitch(self, ID):
logger.debug(f"ASCOMSwitch.GetSwitch({ID}) called")
return self._device.GetSwitch(ID)
Expand Down
Loading

0 comments on commit 1206b53

Please sign in to comment.