Skip to content

Commit f016e4e

Browse files
authored
Merge pull request #17 from fact-project/fixes
Fixes
2 parents f1399ac + 283f96a commit f016e4e

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

la_palma_overview/__init__.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -97,28 +97,28 @@ def clock2img(rows, cols):
9797

9898

9999
def smart_fact2img(rows, cols):
100-
currents = sfc.sipm_currents()
101-
drive_pointing = sfc.drive_pointing()
102-
weather = sfc.weather()
103-
rel_temp = sfc.camera_climate().relative_temperature_mean.value
100+
currents = sfc.sipm_currents(fallback=True)
101+
drive_pointing = sfc.drive_pointing(fallback=True)
102+
weather = sfc.weather(fallback=True)
103+
rel_temp = sfc.camera_climate(fallback=True).relative_temperature_mean.value
104104
cam_temp = rel_temp + weather.temperature.value
105+
humidity = weather.humidity.value
105106

106107
status_text = (
107-
'SQM\n'
108-
' Magnitude..{Magnitude: > 6.1f}\n'
109108
'SIPM\n'
110-
' min........{min_cur: > 6.1f} {cur_unit}\n'
111-
' med........{med_cur: > 6.1f} {cur_unit}\n'
112-
' max........{max_cur: > 6.1f} {cur_unit}\n'
109+
' min........{min_cur:6.1f} {cur_unit}\n'
110+
' med........{med_cur:6.1f} {cur_unit}\n'
111+
' max........{max_cur:6.1f} {cur_unit}\n'
113112
'Temp\n'
114-
' outside....{out_temp: > 6.1f} C\n'
115-
' container..{cont_temp: > 6.1f} C\n'
116-
' camera.....{cam_temp: > 6.1f} C\n'
113+
' outside....{out_temp:6.1f} °C\n'
114+
' container..{cont_temp:6.1f} °C\n'
115+
' camera.....{cam_temp:6.1f} °C\n'
116+
'Weather\n'
117+
' humidity...{humidity:6.0f} %\n'
117118
'Pointing: {source_name}\n'
118-
' Azimuth....{source_az: > 6.1f} {source_az_unit}\n'
119-
' Zenith.....{source_zd: > 6.1f} {source_zd_unit}\n'
119+
' Azimuth....{source_az:6.1f} {source_az_unit}\n'
120+
' Zenith.....{source_zd:6.1f} {source_zd_unit}\n'
120121
).format(
121-
Magnitude=sfc.sqm().magnitude.value,
122122
power=currents.power_camera.value,
123123
power_unit=currents.power_camera.unit,
124124
min_cur=currents.min_per_sipm.value,
@@ -128,6 +128,7 @@ def smart_fact2img(rows, cols):
128128
out_temp=weather.temperature.value,
129129
cont_temp=float(sfc.container_temperature().current.value),
130130
cam_temp=cam_temp,
131+
humidity=humidity,
131132
source_name=sfc.current_source().name,
132133
source_az=drive_pointing.azimuth.value,
133134
source_zd=drive_pointing.zenith_distance.value,
@@ -169,7 +170,7 @@ def stack_image_list_into_rows_and_cols(imgs, big_rows, big_cols):
169170
return col_stack
170171

171172

172-
def download_and_resize_image(url, rows, cols, fmt='jpg', fallback=True):
173+
def download_and_resize_image(url, rows, cols, fmt=None, fallback=True):
173174
'''
174175
Download image at url.
175176
Resize to size cols x rows
@@ -178,7 +179,6 @@ def download_and_resize_image(url, rows, cols, fmt='jpg', fallback=True):
178179
'''
179180
try:
180181
req = requests.get(url, verify=False, timeout=15)
181-
182182
img = skimage.io.imread(io.BytesIO(req.content), format=fmt)
183183

184184
if img.ndim == 2:
@@ -223,12 +223,12 @@ def save_image(output_path, overview_config=None):
223223
'stacked_image': {'rows': 3, 'cols': 4},
224224
'image_urls': [
225225
'http://fact-project.org/cam/skycam.php',
226-
'http://www.gtc.iac.es/multimedia/netcam/camaraAllSky.jpg',
226+
'http://www.gtc.iac.es/multimedia/netcam/camaraAllSky',
227227
'http://www.magic.iac.es/site/weather/AllSkyCurrentImage.JPG',
228228
'http://www.magic.iac.es/site/weather/can.jpg',
229229
'http://www.fact-project.org/cam/cam.php',
230230
'http://www.fact-project.org/cam/lidcam.php',
231-
'http://iris.not.iac.es/axis-cgi/jpg/image.cgi',
231+
'http://www.not.iac.es/weather/img/domebig.jpg',
232232
'http://www.gtc.iac.es/multimedia/netcam/camaraExt.jpg',
233233
'http://www.magic.iac.es/site/weather/lastHUM6t.jpg',
234234
'http://www.magic.iac.es/site/weather/lastWPK6t.jpg'
@@ -246,12 +246,12 @@ def save_image(output_path, overview_config=None):
246246
'stacked_image': {'rows': 3, 'cols': 4},
247247
'image_urls': [
248248
'http://fact-project.org/cam/skycam.php',
249-
'http://www.gtc.iac.es/multimedia/netcam/camaraAllSky.jpg',
249+
'http://www.gtc.iac.es/multimedia/netcam/camaraAllSky',
250250
'http://www.magic.iac.es/site/weather/AllSkyCurrentImage.JPG',
251251
'http://www.magic.iac.es/site/weather/can.jpg',
252252
'http://www.fact-project.org/cam/cam.php',
253253
'http://www.fact-project.org/cam/lidcam.php',
254-
'http://iris.not.iac.es/axis-cgi/jpg/image.cgi',
254+
'http://www.not.iac.es/weather/img/domebig.jpg',
255255
'http://www.tng.iac.es/webcam/get.html?resolution=640x480&compression=30&clock=1&date=1&dummy=1456393525188',
256256
# 'http://www.gtc.iac.es/multimedia/netcam/camaraExt.jpg',
257257
'http://www.magic.iac.es/site/weather/lastHUM6t.jpg',

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name='la_palma_overview',
9-
version='0.1.2',
9+
version='0.1.3',
1010
description=description,
1111
url='https://github.com/fact-project/la_palma_overview.git',
1212
author='Sebastian Mueller,Maximilian Noethe',
@@ -19,7 +19,7 @@
1919
'docopt',
2020
'scikit-image',
2121
'requests',
22-
'smart_fact_crawler==0.6.0',
22+
'smart_fact_crawler~=0.6.4',
2323
'send2trash',
2424
'pillow',
2525
],

0 commit comments

Comments
 (0)