Commit f23401b0 authored by Pim Schellart's avatar Pim Schellart
Browse files

Update README to give basic background and example.

parent 5eb2a95a
Pipeline #969 skipped
......@@ -144,32 +144,30 @@ Example
A basic example in Python using the provided `vlbi` module looks like:
```
import time
import datetime
import vlbi
url = "http://vlbi.astro.ru.nl:8000/rpc"
username = "foo"
password = "bar"
facility = "SMTO"
client = vlbi.Client(url, facility, username, password, backup=False)
now = datetime.datetime.utcnow()
s_now = now.isoformat('T') + 'Z'
later = now + datetime.timedelta(seconds=10)
s_later = later.isoformat('T') + 'Z'
metadata = {}
metadata["systemTemperature"] = {"time": s_now, "value": 352.234}
metadata["observingMode"] = {"time": s_now, "expires": s_later, "value": "VLBI"}
metadata["maser"] = {"time": s_now, "value": True}
metadata["maser.chamberTemperature"] = {"time": s_now, "value": 13.325}
record = {"observatory" : "SMTO", "time" : s_now, "metadata" : metadata}
client.updateRecord(record)
```
import time
import datetime
import vlbi
url = "http://vlbi.astro.ru.nl:8000/rpc"
username = "foo"
password = "bar"
facility = "SMTO"
client = vlbi.Client(url, facility, username, password, backup=False)
now = datetime.datetime.utcnow()
s_now = now.isoformat('T') + 'Z'
later = now + datetime.timedelta(seconds=10)
s_later = later.isoformat('T') + 'Z'
metadata = {}
metadata["systemTemperature"] = {"time": s_now, "value": 352.234}
metadata["observingMode"] = {"time": s_now, "expires": s_later, "value": "VLBI"}
metadata["maser"] = {"time": s_now, "value": True}
metadata["maser.chamberTemperature"] = {"time": s_now, "value": 13.325}
record = {"observatory" : "SMTO", "time" : s_now, "metadata" : metadata}
client.updateRecord(record)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment