Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Codo3
Codo3 / loadobx.py
Created March 25, 2018 23:29
loadobx.py
'''Load an OBX file into a new OB.'''
# Copyright (c) 2018, Michael Pruemm
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@Codo3
Codo3 / copout.py
Created December 26, 2017 22:46
A very basic interface to ESO’s COP API
"""A very basic interface to the COP API.
See https://www.eso.org/copdemo/apidoc/ for API details.
To use:
>>> login('52052', 'tutorial')
>>> runs, __ = request('GET', '/obsRuns')
>>> len(runs)
31
>>> muse_run = [r for r in runs if r['instrument'] == 'MUSE'][0]
>>> ob, obEtag = request('POST',