goTheSkyX

package module
v1.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 13 Imported by: 0

README

goTheSkyX

This module is an interface service to interact with Software Bisque's TheSkyX Pro application, for purposes of controlling an attached camera, to take calibration frames. There is also some limited ability to control the telescope mount - only minimal services to assist with calibration frames (for example, slewing the scope to point at a flat frame panel, or dithering flat calibration frames).

  • TheSkyService is the high-level service that an application should use.
  • TheSkyDriver is a low-level set of services used by TheSkyService. Users are not normally expected to interact directly with TheSkyDriver.
  • When creating a TheSkyService instance, you must pass in a MockableDelay service object (see separate module "github.com/RMcDOttawa/goMockableDelay" for that). This allows you to pass in a relay delay service for real use, or a mocked delay service for testing.

TheSkyService functions

Function Arguments Purpose
NewTheSkyService delayService, debug, verbosity Creates a new delay service object, returning a pointer.
SetDebug boolean Sets the "debug" flag for the service
SetVerbosity int Sets the verbosity level, from 0 to 5
Connect server string, port int Connect to the service, giving it the address and port number of TheSkyX running somewhere on your network
Close Close the server connection
ConnectCamera Ask TheSkyX to connect to the camera
StartCooling temperature float Ask the camera to switch on its cooler and begin cooling to the given target temperature
StopCooling Ask the camera to switch off its cooler
GetCameraTemperature Retrieve the current camera temperature
MeasureDownloadTime Measure how long it takes the camera to download an image of the given binning level (return seconds as a float number). The intent is that you would do this once before taking a large number of dark, bias, or flat frames, passing the download time to the capture function.
CaptureDarkFrame binning int, seconds float, downloadtime float Take a dark frame of the given binning and exposure length. Provide the measured download time to assist the service in knowing how long to wait. Note that the frame itself is not returned - the file is stored, by TheSkyX, whereever its AutoSave setting has files going.
CaptureBiasFrame binning int, downloadtime float Take a bias frame of the given binning . Provide the measured download time to assist the service in knowing how long to wait. Note that the frame itself is not returned - the file is stored, by TheSkyX, whereever its AutoSave setting has files going.

Create and use a MockTheSkyService using the normal mocking framework and inject it into your code under test for testing purposes.

e.g.,

mockTheSkyService := goMockableDelay.NewMockTheSkyService(ctrl)
mockTheSkyService.EXPECT().Connect("localhost",3040).Return(nil)
mockTheSkyService.EXPECT().Close().Return(nil)
mockTheSkyService.EXPECT().ConnectCamera().Return(nil)
mockTheSkyService.EXPECT().GetCameraTemperature().Return(-10.0, nil)

Documentation

Overview

Package goTheSkyX is a generated GoMock package.

Package goTheSkyX is a generated GoMock package.

Index

Constants

View Source
const AndALittleExtra = 0.5
View Source
const FilterSlotNoFilter = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTheSkyDriver

type MockTheSkyDriver struct {
	// contains filtered or unexported fields
}

MockTheSkyDriver is a mock of TheSkyDriver interface.

func NewMockTheSkyDriver

func NewMockTheSkyDriver(ctrl *gomock.Controller) *MockTheSkyDriver

NewMockTheSkyDriver creates a new mock instance.

func (*MockTheSkyDriver) Close

func (m *MockTheSkyDriver) Close() error

Close mocks base method.

func (*MockTheSkyDriver) Connect

func (m *MockTheSkyDriver) Connect(arg0 string, arg1 int) error

Connect mocks base method.

func (*MockTheSkyDriver) ConnectCamera

func (m *MockTheSkyDriver) ConnectCamera() error

ConnectCamera mocks base method.

func (*MockTheSkyDriver) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTheSkyDriver) FilterNames added in v1.2.3

func (m *MockTheSkyDriver) FilterNames() ([]string, error)

FilterNames mocks base method.

func (*MockTheSkyDriver) FilterWheelConnect added in v1.2.3

func (m *MockTheSkyDriver) FilterWheelConnect() error

FilterWheelConnect mocks base method.

func (*MockTheSkyDriver) FilterWheelDisconnect added in v1.2.3

func (m *MockTheSkyDriver) FilterWheelDisconnect() error

FilterWheelDisconnect mocks base method.

func (*MockTheSkyDriver) FilterWheelIsConnected added in v1.2.3

func (m *MockTheSkyDriver) FilterWheelIsConnected() (bool, error)

FilterWheelIsConnected mocks base method.

func (*MockTheSkyDriver) GetADUValue added in v1.2.1

func (m *MockTheSkyDriver) GetADUValue() (int64, error)

GetADUValue mocks base method.

func (*MockTheSkyDriver) GetCameraTemperature

func (m *MockTheSkyDriver) GetCameraTemperature() (float64, error)

GetCameraTemperature mocks base method.

func (*MockTheSkyDriver) IsCaptureDone

func (m *MockTheSkyDriver) IsCaptureDone() (bool, error)

IsCaptureDone mocks base method.

func (*MockTheSkyDriver) MeasureDownloadTime

func (m *MockTheSkyDriver) MeasureDownloadTime(arg0 int) (float64, error)

MeasureDownloadTime mocks base method.

func (*MockTheSkyDriver) SetDebug

func (m *MockTheSkyDriver) SetDebug(arg0 bool)

SetDebug mocks base method.

func (*MockTheSkyDriver) SetVerbosity

func (m *MockTheSkyDriver) SetVerbosity(arg0 int)

SetVerbosity mocks base method.

func (*MockTheSkyDriver) StartBiasFrameCapture

func (m *MockTheSkyDriver) StartBiasFrameCapture(arg0 int, arg1 float64) error

StartBiasFrameCapture mocks base method.

func (*MockTheSkyDriver) StartCooling

func (m *MockTheSkyDriver) StartCooling(arg0 float64) error

StartCooling mocks base method.

func (*MockTheSkyDriver) StartDarkFrameCapture

func (m *MockTheSkyDriver) StartDarkFrameCapture(arg0 int, arg1, arg2 float64) error

StartDarkFrameCapture mocks base method.

func (*MockTheSkyDriver) StartFlatFrameCapture added in v1.2.1

func (m *MockTheSkyDriver) StartFlatFrameCapture(arg0 int, arg1 float64, arg2 int, arg3 float64, arg4 bool) error

StartFlatFrameCapture mocks base method.

func (*MockTheSkyDriver) StopCooling

func (m *MockTheSkyDriver) StopCooling() error

StopCooling mocks base method.

type MockTheSkyDriverMockRecorder

type MockTheSkyDriverMockRecorder struct {
	// contains filtered or unexported fields
}

MockTheSkyDriverMockRecorder is the mock recorder for MockTheSkyDriver.

func (*MockTheSkyDriverMockRecorder) Close

Close indicates an expected call of Close.

func (*MockTheSkyDriverMockRecorder) Connect

func (mr *MockTheSkyDriverMockRecorder) Connect(arg0, arg1 interface{}) *gomock.Call

Connect indicates an expected call of Connect.

func (*MockTheSkyDriverMockRecorder) ConnectCamera

func (mr *MockTheSkyDriverMockRecorder) ConnectCamera() *gomock.Call

ConnectCamera indicates an expected call of ConnectCamera.

func (*MockTheSkyDriverMockRecorder) FilterNames added in v1.2.3

func (mr *MockTheSkyDriverMockRecorder) FilterNames() *gomock.Call

FilterNames indicates an expected call of FilterNames.

func (*MockTheSkyDriverMockRecorder) FilterWheelConnect added in v1.2.3

func (mr *MockTheSkyDriverMockRecorder) FilterWheelConnect() *gomock.Call

FilterWheelConnect indicates an expected call of FilterWheelConnect.

func (*MockTheSkyDriverMockRecorder) FilterWheelDisconnect added in v1.2.3

func (mr *MockTheSkyDriverMockRecorder) FilterWheelDisconnect() *gomock.Call

FilterWheelDisconnect indicates an expected call of FilterWheelDisconnect.

func (*MockTheSkyDriverMockRecorder) FilterWheelIsConnected added in v1.2.3

func (mr *MockTheSkyDriverMockRecorder) FilterWheelIsConnected() *gomock.Call

FilterWheelIsConnected indicates an expected call of FilterWheelIsConnected.

func (*MockTheSkyDriverMockRecorder) GetADUValue added in v1.2.1

func (mr *MockTheSkyDriverMockRecorder) GetADUValue() *gomock.Call

GetADUValue indicates an expected call of GetADUValue.

func (*MockTheSkyDriverMockRecorder) GetCameraTemperature

func (mr *MockTheSkyDriverMockRecorder) GetCameraTemperature() *gomock.Call

GetCameraTemperature indicates an expected call of GetCameraTemperature.

func (*MockTheSkyDriverMockRecorder) IsCaptureDone

func (mr *MockTheSkyDriverMockRecorder) IsCaptureDone() *gomock.Call

IsCaptureDone indicates an expected call of IsCaptureDone.

func (*MockTheSkyDriverMockRecorder) MeasureDownloadTime

func (mr *MockTheSkyDriverMockRecorder) MeasureDownloadTime(arg0 interface{}) *gomock.Call

MeasureDownloadTime indicates an expected call of MeasureDownloadTime.

func (*MockTheSkyDriverMockRecorder) SetDebug

func (mr *MockTheSkyDriverMockRecorder) SetDebug(arg0 interface{}) *gomock.Call

SetDebug indicates an expected call of SetDebug.

func (*MockTheSkyDriverMockRecorder) SetVerbosity

func (mr *MockTheSkyDriverMockRecorder) SetVerbosity(arg0 interface{}) *gomock.Call

SetVerbosity indicates an expected call of SetVerbosity.

func (*MockTheSkyDriverMockRecorder) StartBiasFrameCapture

func (mr *MockTheSkyDriverMockRecorder) StartBiasFrameCapture(arg0, arg1 interface{}) *gomock.Call

StartBiasFrameCapture indicates an expected call of StartBiasFrameCapture.

func (*MockTheSkyDriverMockRecorder) StartCooling

func (mr *MockTheSkyDriverMockRecorder) StartCooling(arg0 interface{}) *gomock.Call

StartCooling indicates an expected call of StartCooling.

func (*MockTheSkyDriverMockRecorder) StartDarkFrameCapture

func (mr *MockTheSkyDriverMockRecorder) StartDarkFrameCapture(arg0, arg1, arg2 interface{}) *gomock.Call

StartDarkFrameCapture indicates an expected call of StartDarkFrameCapture.

func (*MockTheSkyDriverMockRecorder) StartFlatFrameCapture added in v1.2.1

func (mr *MockTheSkyDriverMockRecorder) StartFlatFrameCapture(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

StartFlatFrameCapture indicates an expected call of StartFlatFrameCapture.

func (*MockTheSkyDriverMockRecorder) StopCooling

func (mr *MockTheSkyDriverMockRecorder) StopCooling() *gomock.Call

StopCooling indicates an expected call of StopCooling.

type MockTheSkyService

type MockTheSkyService struct {
	// contains filtered or unexported fields
}

MockTheSkyService is a mock of TheSkyService interface.

func NewMockTheSkyService

func NewMockTheSkyService(ctrl *gomock.Controller) *MockTheSkyService

NewMockTheSkyService creates a new mock instance.

func (*MockTheSkyService) CaptureAndMeasureFlatFrame added in v1.2.1

func (m *MockTheSkyService) CaptureAndMeasureFlatFrame(arg0 float64, arg1, arg2 int, arg3 float64, arg4 bool) (int64, error)

CaptureAndMeasureFlatFrame mocks base method.

func (*MockTheSkyService) CaptureBiasFrame

func (m *MockTheSkyService) CaptureBiasFrame(arg0 int, arg1 float64) error

CaptureBiasFrame mocks base method.

func (*MockTheSkyService) CaptureDarkFrame

func (m *MockTheSkyService) CaptureDarkFrame(arg0 int, arg1, arg2 float64) error

CaptureDarkFrame mocks base method.

func (*MockTheSkyService) Close

func (m *MockTheSkyService) Close() error

Close mocks base method.

func (*MockTheSkyService) Connect

func (m *MockTheSkyService) Connect(arg0 string, arg1 int) error

Connect mocks base method.

func (*MockTheSkyService) ConnectCamera

func (m *MockTheSkyService) ConnectCamera() error

ConnectCamera mocks base method.

func (*MockTheSkyService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTheSkyService) FilterNames added in v1.2.3

func (m *MockTheSkyService) FilterNames() ([]string, error)

FilterNames mocks base method.

func (*MockTheSkyService) GetCameraTemperature

func (m *MockTheSkyService) GetCameraTemperature() (float64, error)

GetCameraTemperature mocks base method.

func (*MockTheSkyService) HasFilterWheel added in v1.2.3

func (m *MockTheSkyService) HasFilterWheel() (bool, error)

HasFilterWheel mocks base method.

func (*MockTheSkyService) MeasureDownloadTime

func (m *MockTheSkyService) MeasureDownloadTime(arg0 int) (float64, error)

MeasureDownloadTime mocks base method.

func (*MockTheSkyService) NumberOfFilters added in v1.2.3

func (m *MockTheSkyService) NumberOfFilters() (int, error)

NumberOfFilters mocks base method.

func (*MockTheSkyService) SetDebug

func (m *MockTheSkyService) SetDebug(arg0 bool)

SetDebug mocks base method.

func (*MockTheSkyService) SetDriver

func (m *MockTheSkyService) SetDriver(arg0 TheSkyDriver)

SetDriver mocks base method.

func (*MockTheSkyService) SetSimulateFlatCapture added in v1.2.1

func (m *MockTheSkyService) SetSimulateFlatCapture(arg0 bool)

SetSimulateFlatCapture mocks base method.

func (*MockTheSkyService) SetSimulationNoiseFraction added in v1.2.7

func (m *MockTheSkyService) SetSimulationNoiseFraction(arg0 float64)

SetSimulationNoiseFraction mocks base method.

func (*MockTheSkyService) SetVerbosity

func (m *MockTheSkyService) SetVerbosity(arg0 int)

SetVerbosity mocks base method.

func (*MockTheSkyService) StartCooling

func (m *MockTheSkyService) StartCooling(arg0 float64) error

StartCooling mocks base method.

func (*MockTheSkyService) StopCooling

func (m *MockTheSkyService) StopCooling() error

StopCooling mocks base method.

func (*MockTheSkyService) WaitForCameraInactive added in v1.2.2

func (m *MockTheSkyService) WaitForCameraInactive(arg0, arg1 int) error

WaitForCameraInactive mocks base method.

type MockTheSkyServiceMockRecorder

type MockTheSkyServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockTheSkyServiceMockRecorder is the mock recorder for MockTheSkyService.

func (*MockTheSkyServiceMockRecorder) CaptureAndMeasureFlatFrame added in v1.2.1

func (mr *MockTheSkyServiceMockRecorder) CaptureAndMeasureFlatFrame(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

CaptureAndMeasureFlatFrame indicates an expected call of CaptureAndMeasureFlatFrame.

func (*MockTheSkyServiceMockRecorder) CaptureBiasFrame

func (mr *MockTheSkyServiceMockRecorder) CaptureBiasFrame(arg0, arg1 interface{}) *gomock.Call

CaptureBiasFrame indicates an expected call of CaptureBiasFrame.

func (*MockTheSkyServiceMockRecorder) CaptureDarkFrame

func (mr *MockTheSkyServiceMockRecorder) CaptureDarkFrame(arg0, arg1, arg2 interface{}) *gomock.Call

CaptureDarkFrame indicates an expected call of CaptureDarkFrame.

func (*MockTheSkyServiceMockRecorder) Close

Close indicates an expected call of Close.

func (*MockTheSkyServiceMockRecorder) Connect

func (mr *MockTheSkyServiceMockRecorder) Connect(arg0, arg1 interface{}) *gomock.Call

Connect indicates an expected call of Connect.

func (*MockTheSkyServiceMockRecorder) ConnectCamera

func (mr *MockTheSkyServiceMockRecorder) ConnectCamera() *gomock.Call

ConnectCamera indicates an expected call of ConnectCamera.

func (*MockTheSkyServiceMockRecorder) FilterNames added in v1.2.3

func (mr *MockTheSkyServiceMockRecorder) FilterNames() *gomock.Call

FilterNames indicates an expected call of FilterNames.

func (*MockTheSkyServiceMockRecorder) GetCameraTemperature

func (mr *MockTheSkyServiceMockRecorder) GetCameraTemperature() *gomock.Call

GetCameraTemperature indicates an expected call of GetCameraTemperature.

func (*MockTheSkyServiceMockRecorder) HasFilterWheel added in v1.2.3

func (mr *MockTheSkyServiceMockRecorder) HasFilterWheel() *gomock.Call

HasFilterWheel indicates an expected call of HasFilterWheel.

func (*MockTheSkyServiceMockRecorder) MeasureDownloadTime

func (mr *MockTheSkyServiceMockRecorder) MeasureDownloadTime(arg0 interface{}) *gomock.Call

MeasureDownloadTime indicates an expected call of MeasureDownloadTime.

func (*MockTheSkyServiceMockRecorder) NumberOfFilters added in v1.2.3

func (mr *MockTheSkyServiceMockRecorder) NumberOfFilters() *gomock.Call

NumberOfFilters indicates an expected call of NumberOfFilters.

func (*MockTheSkyServiceMockRecorder) SetDebug

func (mr *MockTheSkyServiceMockRecorder) SetDebug(arg0 interface{}) *gomock.Call

SetDebug indicates an expected call of SetDebug.

func (*MockTheSkyServiceMockRecorder) SetDriver

func (mr *MockTheSkyServiceMockRecorder) SetDriver(arg0 interface{}) *gomock.Call

SetDriver indicates an expected call of SetDriver.

func (*MockTheSkyServiceMockRecorder) SetSimulateFlatCapture added in v1.2.1

func (mr *MockTheSkyServiceMockRecorder) SetSimulateFlatCapture(arg0 interface{}) *gomock.Call

SetSimulateFlatCapture indicates an expected call of SetSimulateFlatCapture.

func (*MockTheSkyServiceMockRecorder) SetSimulationNoiseFraction added in v1.2.7

func (mr *MockTheSkyServiceMockRecorder) SetSimulationNoiseFraction(arg0 interface{}) *gomock.Call

SetSimulationNoiseFraction indicates an expected call of SetSimulationNoiseFraction.

func (*MockTheSkyServiceMockRecorder) SetVerbosity

func (mr *MockTheSkyServiceMockRecorder) SetVerbosity(arg0 interface{}) *gomock.Call

SetVerbosity indicates an expected call of SetVerbosity.

func (*MockTheSkyServiceMockRecorder) StartCooling

func (mr *MockTheSkyServiceMockRecorder) StartCooling(arg0 interface{}) *gomock.Call

StartCooling indicates an expected call of StartCooling.

func (*MockTheSkyServiceMockRecorder) StopCooling

func (mr *MockTheSkyServiceMockRecorder) StopCooling() *gomock.Call

StopCooling indicates an expected call of StopCooling.

func (*MockTheSkyServiceMockRecorder) WaitForCameraInactive added in v1.2.2

func (mr *MockTheSkyServiceMockRecorder) WaitForCameraInactive(arg0, arg1 interface{}) *gomock.Call

WaitForCameraInactive indicates an expected call of WaitForCameraInactive.

type TheSkyDriver

type TheSkyDriver interface {
	// Basics
	Connect(server string, port int) error
	Close() error
	SetDebug(debug bool)
	SetVerbosity(verbosity int)
	// Camera
	ConnectCamera() error
	StartCooling(temp float64) error
	GetCameraTemperature() (float64, error)
	StopCooling() error
	// Frame Capture
	MeasureDownloadTime(binning int) (float64, error)
	StartDarkFrameCapture(binning int, seconds float64, downloadTime float64) error
	StartFlatFrameCapture(binning int, seconds float64, filterSlot int, downloadTime float64, saveImage bool) error
	IsCaptureDone() (bool, error)
	StartBiasFrameCapture(binning int, downloadTime float64) error
	GetADUValue() (int64, error)
	// Filters
	FilterWheelIsConnected() (bool, error)
	FilterWheelConnect() error
	FilterWheelDisconnect() error
	FilterNames() ([]string, error)
}

func NewTheSkyDriver

func NewTheSkyDriver(
	debug bool, verbosity int) TheSkyDriver

NewTheSkyDriver is the constructor for a working instance of the interface

type TheSkyDriverInstance

type TheSkyDriverInstance struct {
	// contains filtered or unexported fields
}

func (*TheSkyDriverInstance) Close

func (driver *TheSkyDriverInstance) Close() error

Close severs the connection to the TCP socket for the TheSkyX server

func (*TheSkyDriverInstance) Connect

func (driver *TheSkyDriverInstance) Connect(server string, port int) error

Connect opens connection to the server and camera.

In fact, all we do is remember the server coordinates. The actual open of the
socket is deferred until we have a command to send

func (*TheSkyDriverInstance) ConnectCamera

func (driver *TheSkyDriverInstance) ConnectCamera() error

func (*TheSkyDriverInstance) FilterNames added in v1.2.3

func (driver *TheSkyDriverInstance) FilterNames() ([]string, error)

func (*TheSkyDriverInstance) FilterWheelConnect added in v1.2.3

func (driver *TheSkyDriverInstance) FilterWheelConnect() error

func (*TheSkyDriverInstance) FilterWheelDisconnect added in v1.2.3

func (driver *TheSkyDriverInstance) FilterWheelDisconnect() error

func (*TheSkyDriverInstance) FilterWheelIsConnected added in v1.2.3

func (driver *TheSkyDriverInstance) FilterWheelIsConnected() (bool, error)

func (*TheSkyDriverInstance) GetADUValue added in v1.2.1

func (driver *TheSkyDriverInstance) GetADUValue() (int64, error)

func (*TheSkyDriverInstance) GetCameraTemperature

func (driver *TheSkyDriverInstance) GetCameraTemperature() (float64, error)

GetCameraTemperature polls TheSkyX for the current camera temperature and returns it

func (*TheSkyDriverInstance) IsCaptureDone

func (driver *TheSkyDriverInstance) IsCaptureDone() (bool, error)

IsCaptureDone polls the server to see if the camera is done with its current activity

func (*TheSkyDriverInstance) MeasureDownloadTime

func (driver *TheSkyDriverInstance) MeasureDownloadTime(binning int) (float64, error)

func (*TheSkyDriverInstance) SetDebug

func (driver *TheSkyDriverInstance) SetDebug(debug bool)

func (*TheSkyDriverInstance) SetVerbosity

func (driver *TheSkyDriverInstance) SetVerbosity(verbosity int)

func (*TheSkyDriverInstance) StartBiasFrameCapture

func (driver *TheSkyDriverInstance) StartBiasFrameCapture(binning int, downloadTime float64) error

func (*TheSkyDriverInstance) StartCooling

func (driver *TheSkyDriverInstance) StartCooling(temperature float64) error

StartCooling sends server commands to turn on the TEC and set the target temperature No response is expected from these commands

func (*TheSkyDriverInstance) StartDarkFrameCapture

func (driver *TheSkyDriverInstance) StartDarkFrameCapture(binning int, seconds float64, downloadTime float64) error

func (*TheSkyDriverInstance) StartFlatFrameCapture added in v1.2.1

func (driver *TheSkyDriverInstance) StartFlatFrameCapture(binning int, seconds float64, filterSlot int, downloadTime float64, saveImage bool) error

func (*TheSkyDriverInstance) StopCooling

func (driver *TheSkyDriverInstance) StopCooling() error

type TheSkyService

type TheSkyService interface {
	//	BAsic Controls
	Connect(server string, port int) error
	Close() error
	SetDriver(driver TheSkyDriver)
	SetDebug(debug bool)
	SetVerbosity(verbosity int)
	//	Camera
	ConnectCamera() error
	StartCooling(targetTemp float64) error
	GetCameraTemperature() (float64, error)
	StopCooling() error
	WaitForCameraInactive(pollingIntervalSeconds int, timeoutMinutes int) error
	//	Filter Wheel
	HasFilterWheel() (bool, error)
	NumberOfFilters() (int, error)  // Number of up to first blank name
	FilterNames() ([]string, error) // Names up to first blank name
	//	Frame Capture
	MeasureDownloadTime(binning int) (float64, error)
	CaptureDarkFrame(binning int, seconds float64, downloadTime float64) error
	CaptureBiasFrame(binning int, downloadTime float64) error // for mocking
	CaptureAndMeasureFlatFrame(exposure float64, binning int, filterSlot int, downloadTime float64, saveImage bool) (int64, error)
	SetSimulateFlatCapture(flag bool)
	SetSimulationNoiseFraction(fraction float64)
}

func NewTheSkyService

func NewTheSkyService(delayService goMockableDelay.DelayService,
	debug bool,
	verbosity int,
	simulateFlatFrameADUs bool) TheSkyService

NewTheSkyService is the constructor for the instance of this service

type TheSkyServiceInstance

type TheSkyServiceInstance struct {
	// contains filtered or unexported fields
}

func (*TheSkyServiceInstance) CaptureAndMeasureFlatFrame added in v1.2.1

func (service *TheSkyServiceInstance) CaptureAndMeasureFlatFrame(exposure float64, binning int, filterSlot int, downloadTime float64, saveImage bool) (int64, error)

func (*TheSkyServiceInstance) CaptureBiasFrame

func (service *TheSkyServiceInstance) CaptureBiasFrame(binning int, downloadTime float64) error

func (*TheSkyServiceInstance) CaptureDarkFrame

func (service *TheSkyServiceInstance) CaptureDarkFrame(binning int, seconds float64, downloadTime float64) error

func (*TheSkyServiceInstance) Close

func (service *TheSkyServiceInstance) Close() error

Close closes the connection to the TheSkyX server

func (*TheSkyServiceInstance) Connect

func (service *TheSkyServiceInstance) Connect(server string, port int) error

Connect opens a connection to the TheSkyX application, via the low-level driver. The connection is kept open, ready to use.

func (*TheSkyServiceInstance) ConnectCamera

func (service *TheSkyServiceInstance) ConnectCamera() error

ConnectCamera asks TheSky to connect to the camera.

func (*TheSkyServiceInstance) FilterNames added in v1.2.3

func (service *TheSkyServiceInstance) FilterNames() ([]string, error)

func (*TheSkyServiceInstance) GetCameraTemperature

func (service *TheSkyServiceInstance) GetCameraTemperature() (float64, error)

func (*TheSkyServiceInstance) HasFilterWheel added in v1.2.3

func (service *TheSkyServiceInstance) HasFilterWheel() (bool, error)

HasFilterWheel determines whether the camera has a filter wheel.

 There is no API call to determine this, so we will infer it this way:
Determine if the filter wheel is connected
	If yes, then there is a filter wheel (duh)
	If no, then try to connect.
		If that fails, there is no filter wheel.
		If the connect succeeds, then there is a filter wheel; and disconnect again

func (*TheSkyServiceInstance) MeasureDownloadTime

func (service *TheSkyServiceInstance) MeasureDownloadTime(binning int) (float64, error)

func (*TheSkyServiceInstance) NumberOfFilters added in v1.2.3

func (service *TheSkyServiceInstance) NumberOfFilters() (int, error)

NumberOfFilters returns the number of filters defined for the filter wheel.

Although the server provides a function for this, we are not using it because the filter wheel simulator
returns an absurd number of filters with names that get filled in automatically.
Instead, we are going to retrieve the actual filter names, and count up to, not including, the first blank one

func (*TheSkyServiceInstance) SetDebug

func (service *TheSkyServiceInstance) SetDebug(debug bool)

func (*TheSkyServiceInstance) SetDriver

func (service *TheSkyServiceInstance) SetDriver(driver TheSkyDriver)

func (*TheSkyServiceInstance) SetSimulateFlatCapture added in v1.2.1

func (service *TheSkyServiceInstance) SetSimulateFlatCapture(flag bool)

func (*TheSkyServiceInstance) SetSimulationNoiseFraction added in v1.2.6

func (service *TheSkyServiceInstance) SetSimulationNoiseFraction(fraction float64)

func (*TheSkyServiceInstance) SetVerbosity

func (service *TheSkyServiceInstance) SetVerbosity(verbosity int)

func (*TheSkyServiceInstance) StartCooling

func (service *TheSkyServiceInstance) StartCooling(targetTemp float64) error

StartCooling turns on the camera's thermoelectric cooler (TEC) and sets target temp

func (*TheSkyServiceInstance) StopCooling

func (service *TheSkyServiceInstance) StopCooling() error

func (*TheSkyServiceInstance) WaitForCameraInactive added in v1.2.1

func (service *TheSkyServiceInstance) WaitForCameraInactive(pollingIntervalSeconds int, timeoutMinutes int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL