HiPERCAM / hipercam

Python package for handling HiPERCAM data
4 stars 4 forks source link

Unable to access log files created by pipeline for ULTRACAM data #53

Closed SGParsons closed 6 years ago

SGParsons commented 6 years ago

Reducing some ULTRACAM data with the pipeline. While the reduction itself runs fine, when I try to access the log file either using plog or within python using hipercam.hlog.Hlog.from_ascii I get the following error message:

Traceback (most recent call last): File "/usr/local/python3_modules/bin/plog", line 11, in sys.exit(plog()) File "/usr/local/lib/python3.5/dist-packages/hipercam/scripts/plog.py", line 142, in plog hlog = hcam.hlog.Hlog.from_ascii(log) File "/usr/local/lib/python3.5/dist-packages/hipercam/hlog.py", line 141, in from_ascii hlog[cnam] = np.array(hlog[cnam], dtype=dtypes[cnam]) ValueError: invalid literal for int() with base 10: b'\x01\x00\x00\x00\xfc\x9ay\xd1\xa2\xec@\x01L7\xa933s@\x00\x00\x80\xbf\x04\xf6\x13D\x00\x00\x80\xbf\xfe\xd4\xb0B\x00\x00\x80\xbf\x00\x00\x00\x00\x00\x00\x80\xbf\x00\x00\x00\x00\x00\x00\x80\xbf33!Bff

This has happened for multiple log files. I've attached one of these

run011.log

trmrsh commented 6 years ago

I cannot replicate this problem. My code reads in the log file you attach with no problem. The line it fails on is:

hlog[cnam] = np.array(hlog[cnam], dtype=dtypes[cnam])

which is invoking a numpy method. What version of numpy are you using? ('pydoc numpy.version'). I am using 1.13.3. I don't know why this would matter at all, but it is the only thing I can think of.

SGParsons commented 6 years ago

Numpy version 1.14.5

trmrsh commented 6 years ago

just replicated the problem with numpy 1.14.5. So it's either a numpy bug or a feature ... will look into it

trmrsh commented 6 years ago

Phew! With help from someone on stack overflow I have managed to fix this for both versions of numpy. Have pushed the fix to github. Closing this.