Example #1
0
#!/usr/bin/env python

from sns_geometry import Geometry, Component, Maths, Recipe, Vector, \
     extractValueFromFile, generateGeom, getEuler

from math import cos, sin, acos, atan2
from datetime import datetime, date
import numpy as np

geometry = generateGeom("TOPAZ")
entry = geometry.getEntry()
instrument = entry.getInstrument()

# Monitors
monitor1 = Component("monitor1", "NXmonitor")
monitor1.setComment("MONITORS")
monitor1.setHelper("ParameterCopy")
monitor1.addVariable("distance", "mon1dis")
entry.addMonitor(monitor1)
monitor2 = Component("monitor2", "NXmonitor")
monitor2.setHelper("ParameterCopy")
monitor2.addVariable("distance", "mon2dis")
entry.addMonitor(monitor2)

# Sample
sample = Component("sample", "NXsample")
sample.setComment(" SAMPLE ")
sample.setHelper("Goiniometer")
#real_phi, etc. are the real sample orientations (sanitized names, taken from phi,chi,omega MOTOR values)
#phi, chi, etc. are the sample orientations
sample.addVariable("phi", "real_phi")
Example #2
0
#!/usr/bin/env python

from sns_geometry import Geometry, Component, Maths, Recipe, Vector, \
     extractValueFromFile, generateGeom, getEuler

from math import cos, sin, acos, atan2
from datetime import datetime, date
import numpy as np

geometry = generateGeom("TOPAZ")
entry = geometry.getEntry()
instrument = entry.getInstrument()

# Monitors
monitor1 = Component("monitor1", "NXmonitor")
monitor1.setComment("MONITORS")
monitor1.setHelper("ParameterCopy")
monitor1.addVariable("distance", "mon1dis")
entry.addMonitor(monitor1)
monitor2 = Component("monitor2", "NXmonitor")
monitor2.setHelper("ParameterCopy")
monitor2.addVariable("distance", "mon2dis")
entry.addMonitor(monitor2)

# Sample
sample=Component("sample", "NXsample")
sample.setComment(" SAMPLE ")
sample.setHelper("Goiniometer")
#real_phi, etc. are the real sample orientations (sanitized names, taken from phi,chi,omega MOTOR values)
#phi, chi, etc. are the sample orientations
sample.addVariable("phi", "real_phi")
#!/usr/bin/env python

from sns_geometry import Geometry, Component, Maths, Recipe, Vector, \
     extractValueFromFile, generateGeom, getEuler

from math import cos, sin, acos,  atan2, pi, sqrt
from datetime import datetime, date
import numpy as np

geometry = generateGeom("MANDI")
entry = geometry.getEntry()
instrument = entry.getInstrument()

# Monitors
monitor1 = Component("monitor1", "NXmonitor")
monitor1.setComment("MONITORS")
monitor1.setHelper("ParameterCopy")
monitor1.addVariable("distance", "mon1dis")
entry.addMonitor(monitor1)
monitor2 = Component("monitor2", "NXmonitor")
monitor2.setHelper("ParameterCopy")
monitor2.addVariable("distance", "mon2dis")
entry.addMonitor(monitor2)

# Sample
sample=Component("sample", "NXsample")
sample.setComment(" SAMPLE ")
sample.setHelper("Goiniometer")
#real_phi, etc. are the real sample orientations (sanitized names, taken from phi,chi,omega MOTOR values)
#phi, chi, etc. are the sample orientations
sample.addVariable("phi", "real_phi")