Skip to content

Instantly share code, notes, and snippets.

@gadamc
Created April 18, 2012 15:02
Show Gist options
  • Save gadamc/2414159 to your computer and use it in GitHub Desktop.
Save gadamc/2414159 to your computer and use it in GitHub Desktop.
get Run12 calibration and voltage constants for ERA / KData analysis
#!/usr/bin/env python
from couchdbkit import Server, Database
s = Server('http://edwdbik.fzk.de:5984')
db = s['analysis']
vr = db.view('constants/run12', include_docs=True)
constantDoc = {}
for row in vr:
constantDoc[row['key']] = row['doc']
#now you can get the voltage / calibration / correlation values used in Run12 ERA analysis
#by calling, for example,
#voltageFlag = kboloRecord.GetVoltageFlag()
voltageFlag = 1
volts = constantDoc['ID3']['gVolts'][voltageFlag]
#To see all of the available information, browse a document for a particular detector
#ex: https://edwdbik.fzk.de:6984/_utils/document.html?analysis/run12analysisconstants_ID3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment