GithubHelp home page GithubHelp logo

mmtobservatory / indiclient Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 5.64 MB

INDI client utilities implemented in pure Python

Python 77.56% Jupyter Notebook 21.20% Shell 1.24%
astronomy indi python sbig

indiclient's People

Contributors

jdgibson avatar tepickering avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

gnthibault

indiclient's Issues

Parser is failing upon test with SImulator

Thank you very much for your work with this library !

I tried to integrate this in place of the "official" Pyindi module, that breaks every now and then, and is not really maintained as an integral part of indilib.

Unfortunately, I faced an issue while doing test with simulators:

The error is:

File "/usr/lib/python3.8/threading.py", line 1254, in run
self.function(*self.args, **self.kwargs)
File "/home/user/venv/lib/python3.8/site-packages/indiclient-0.1.dev102+gfe5cb72-py3.8.egg/indiclient/indiclient.py", line 2034, in _receiver
self._receive()
File "/home/user/venv/lib/python3.8/site-packages/indiclient-0.1.dev102+gfe5cb72-py3.8.egg/indiclient/indiclient.py", line 2355, in _receive
self._receive() parseval = self.expat.Parse(data, 0)
File "/home/user/venv/lib/python3.8/site-packages/indiclient-0.1.dev102+gfe5cb72-py3.8.egg/indiclient/indiclient.py", line 2355, in _receive
xml.parsers.expat.ExpatError: mismatched tag: line 482, column 2
parseval = self.expat.Parse(data, 0)
xml.parsers.expat.ExpatError: mismatched tag: line 219, column 2
python-BaseException
python-BaseException

Here is the current buffer that was currently being parsed:
data

Out[2]: b'2">\n1024\n </defNumber>\n <defNumber name="SIM_XSIZE" label="CCD X Pixel Size" format="%4.2f" min="1" max="30" step="5">\n5.2000000000000001776\n </defNumber>\n <defNumber name="SIM_YSIZE" label="CCD Y Pixel Size" format="%4.2f" min="1" max="30" step="5">\n5.2000000000000001776\n </defNumber>\n <defNumber name="SIM_MAXVAL" label="CCD Maximum ADU" format="%4.0f" min="255" max="65000" step="1000">\n65000\n </defNumber>\n <defNumber name="SIM_SATURATION" label="Saturation Mag" format="%4.1f" min="0" max="20" step="1">\n1\n </defNumber>\n <defNumber name="SIM_LIMITINGMAG" label="Limiting Mag" format="%4.1f" min="0" max="20" step="1">\n17\n </defNumber>\n <defNumber name="SIM_NOISE" label="CCD Noise" format="%4.0f" min="0" max="6000" step="500">\n10\n </defNumber>\n <defNumber name="SIM_SKYGLOW" label="Sky Glow (magnitudes)" format="%4.1f" min="0" max="6000" step="500">\n19.5\n </defNumber>\n <defNumber name="SIM_OAGOFFSET" label="Oag Offset (arcminutes)" format="%4.1f" min="0" max="6000" step="500">\n0\n </defNumber>\n <defNumber name="SIM_POLAR" label="PAE (arcminutes)" format="%4.1f" min="-600" max="600" step="100">\n0\n </defNumber>\n <defNumber name="SIM_POLARDRIFT" label="PAE Drift (minutes)" format="%4.1f" min="0" max="60" step="5">\n0\n </defNumber>\n <defNumber name="SIM_PEPERIOD" label="PE Period (minutes)" format="%4.1f" min="0" max="60" step="5">\n0\n </defNumber>\n <defNumber name="SIM_PEMAX" label="PE Max (arcsec)" format="%4.1f" min="0" max="6000" step="500">\n0\n </defNumber>\n <defNumber name="SIM_TIME_FACTOR" label="Time Factor (x)" format="%.2f" min="0.010000000000000000208" max="100" step="10">\n1\n </defNumber>\n <defNumber name="SIM_ROTATION" label="CCD Rotation" format="%.2f" min="0" max="360" step="10">\n0\n </defNumber>\n</defNumberVector>\n<defNumberVector device="CCD Simulator" name="EQUATORIAL_PE" label="EQ PE" group="Simulator Config" state="Idle" perm="rw" timeout="60" timestamp="2021-10-01T15:58:30">\n <defNumber name="RA_PE" label="RA (hh:mm:ss)" format="%010.6m" min="0" max="24" step="0">\n0\n </defNumber>\n <defNumber name="DEC_PE" label="DEC (dd:mm:ss)" format="%010.6m" min="-90" max="90" step="0">\n0\n </defNumber>\n</defNumberVector>\n<defNumberVector device="CCD Simulator" name="SIM_FOCUSING" label="Focus Simulation" group="Simulator Config" state="Idle" perm="rw" timeout="60" timestamp="2021-10-01T15:58:30">\n <defNumber name="SIM_FOCUS_POSITION" label="Focus" format="%.f" min="0" max="100000" step="1">\n36700\n </defNumber>\n <defNumber name="SIM_FOCUS_MAX" label="Max. Position" format="%.f" min="0" max="100000" step="1">\n100000\n </defNumber>\n <defNumber name="SIM_SEEING" label="Seeing (arcsec)" format="%4.2f" min="0" max="60" step="0">\n3.5\n </defNumber>\n</defNumberVector>\n<defSwitchVector device="CCD Simulator" name="SIMULATE_BAYER" label="Bayer" group="Simulator Config" state="Idle" perm="rw" rule="OneOfMany" timeout="60" timestamp="2021-10-01T15:58:30">\n <defSwitch name="INDI_ENABLED" label="Enabled">\nOff\n </defSwitch>\n <defSwitch name="INDI_DISABLED" label="Disabled">\nOn\n </defSwitch>\n</defSwitchVector>\n<defSwitchVector device="CCD Simulator" name="CCD_SIMULATE_CRASH" label="Crash" group="Simulator Config" state="Idle" perm="wo" rule="AtMostOne" timeout="0" timestamp="2021-10-01T15:58:30">\n <defSwitch name="CRASH" label="Crash driver">\nOff\n </defSwitch>\n</defSwitchVector>\n<defNumberVector device="Telescope Simulator" name="TELESCOPE_INFO" label="Scope Properties" group="Options" state="Ok" perm="rw" timeout="60" timestamp="2021-10-01T15:58:30">\n <defNumber name="TELESCOPE_APERTURE" label="Aperture (mm)" format="%g" min="10" max="5000" step="0">\n200\n </defNumber>\n <defNumber name="TELESCOPE_FOCAL_LENGTH" label="Focal Length (mm)" format="%g" min="10" max="10000" step="0">\n800\n </defNumber>\n <defNumber name="GUIDER_APERTURE" label="Guider Aperture (mm)" format="%g" min="10" max="5000" step="0">\n200\n </defNumber>\n <defNumber name="GUIDER_FOCAL_LENGTH" label="Guider Focal Length (mm)" format="%g" min="10" max="10000" step="0">\n800\n </defNumber>\n</defNumberVector>\n<defNumberVector device="Telescope Simulator" name="TELESCOPE_INFO" label="Scope Properties" group="Options" state="Ok" perm="rw" timeout="60" timestamp="2021-10-01T15:58:30">\n <defNumber name="TELESCOPE_APERTURE" label="Aperture (mm)" format="%g" min="10" max="5000" step="0">\n200\n </defNumber>\n <defNumber name="TELESCOPE_FOCAL_LENGTH" label="Focal Length (mm)" format="%g" min="10" max="10000" step="0">\n800\n </defNumber>\n <defNumber name="GUIDER_APERTURE" label="Guider Aperture (mm)" format="%g" min="10" max="5000" step="0">\n200\n </defNumber>\n <defNumber name="GUIDER_FOCAL_LENGTH" label="Guider Focal Length (mm)" format="%g" min="10" max="10000" step="0">\n800\n </defNumber>\n</defNumberVector>\n'

The symbol that seems to cause the parsing error is:

data.decode()[219]
Out[4]: '"'

Which was somewhere in the middle of a message:

data.decode()[200:240]
Out[6]: 'l="CCD Y Pixel Size" format="%4.2f" min='

Am I doing something wrong ?

Thank you in advance for your help

get_vector returns None due to timeouts for unknown reason

Hello, thank you so much for your work on this package!
We have indiclient installed on one of our test machine, and it works beautifully with our SBIG STF-8300 camera. However, we are trying to set up a newer machine, and we are unfortunately running into some issues. We would be very grateful for your help, or if you can point us in the right direction.
We are trying to set up control for the same SBIG camera on an Ubuntu 20.04 machine. The SBIG is connected to the machine via USB, and we have the most recent stable releases of indilib, the indi-sbig driver, and indiclient installed. We added a very simple SBIGCam wrapper for the CCDCam class that sets the driver to "SBIG CCD", which works on the other machine.
We try to run the very simple script below:

from indiclient.indicam import SBIGCam
cam = SBIGCam()
cam.ccd_info

This returns the following exception:

Timeout: SBIG CCD CCD_INFO
AttributeError                            Traceback (most recent call last)
Input In [9], in <cell line: 1>()
----> 1 cam.ccd_info

File ~/pymodules/indiclient-backup/indiclient/indicam.py:49, in CCDCam.ccd_info(self)
     47 info_vec = self.get_vector(self.driver, "CCD_INFO")
     48 info = {}
---> 49 for e in info_vec.elements:
     50     info[e.getName()] = e.get_float()
     51 return info

AttributeError: 'NoneType' object has no attribute 'elements'

Other functions such as expose result in similar timeout errors and NoneType returns. I have also included the verbose output of indiserver -vvv indi_sbig_ccd during this script as a text file: sbig_indi_debug_output.txt
I'll note line 316: 2022-06-10T22:48:37: Driver indi_sbig_ccd: read message SBIG CCD '[INFO] CCD is connected at port USB 1'
and line 318: 2022-06-10T22:48:37: Driver indi_sbig_ccd: read message SBIG CCD '[ERROR] GetCcdInfo: CC_GET_CCD_INFO -> (Bad Parameter)' where things start to go poorly it seems.

Any insight into whether this is an issue on the indiclient, indiserver, or camera connection side would be greatly appreciated. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.