spec2nexus.diffractometers#

source code documentation#

Describe SPEC diffractometer geometry #G control lines.

#G0 … G[] array (geo mode, sector, etc) #G1 … U[] array (lattice constants, orientation reflections) #G2 is unused #G3 … UB[] array (orientation matrix) #G4 … Q[] array (lambda, frozen angles, cut points, etc)

API

Diffractometer(geo_name)

describe the diffractometer for the scan

DiffractometerGeometryCatalog()

catalog of the diffractometer geometries known to SPEC

split_name_variation(geo_name)

split geo_name into geometry name and variation

get_geometry_catalog()

reset_geometry_catalog()

class spec2nexus.diffractometers.Diffractometer(geo_name)[source]#

describe the diffractometer for the scan

parse(scan)

print_all(scan)

Print All (pa) about this diffractometer scan.

print_brief(scan)

Print brief information (wh: where) about this diffractometer scan.

print_all(scan)[source]#

Print All (pa) about this diffractometer scan.

PARAMETERS

scan obj :

SPEC data file scan (a spec2nexus.spec.SpecDataFileScan object).

print_brief(scan)[source]#

Print brief information (wh: where) about this diffractometer scan.

PARAMETERS

scan obj :

SPEC data file scan (a spec2nexus.spec.SpecDataFileScan object).

class spec2nexus.diffractometers.DiffractometerGeometryCatalog[source]#

catalog of the diffractometer geometries known to SPEC

geometries([variations])

list known geometries

get(geo_name[, default])

return dictionary for diffractometer geometry geo_name

get_default_geometry()

has_geometry(geo_name)

Is the geo_name geometry defined? True or False

match(scan)

Find the geo_name geometry that matches the scan.

geometries(variations=False)[source]#

list known geometries

PARAMETERS

variationsbool

If True, also list known variations

get(geo_name, default=None)[source]#

return dictionary for diffractometer geometry geo_name

has_geometry(geo_name)[source]#

Is the geo_name geometry defined? True or False

match(scan)[source]#

Find the geo_name geometry that matches the scan.

Look at the data file header if the name is defined on the first comment line, as written by the SPEC standard macro. If there is more than one matching geometry, pick the first one.

class spec2nexus.diffractometers.KeyDescriptionValue(key, description, value)#
description#

Alias for field number 1

key#

Alias for field number 0

value#

Alias for field number 2

class spec2nexus.diffractometers.LatticeParameters2D(a, b, gamma)#
a#

Alias for field number 0

b#

Alias for field number 1

gamma#

Alias for field number 2

class spec2nexus.diffractometers.LatticeParameters3D(a, b, c, alpha, beta, gamma)#
a#

Alias for field number 0

alpha#

Alias for field number 3

b#

Alias for field number 1

beta#

Alias for field number 4

c#

Alias for field number 2

gamma#

Alias for field number 5

class spec2nexus.diffractometers.Reflections2D(h, k, wavelength, angles)#
angles#

Alias for field number 3

h#

Alias for field number 0

k#

Alias for field number 1

wavelength#

Alias for field number 2

class spec2nexus.diffractometers.Reflections3D(h, k, l, wavelength, angles)#
angles#

Alias for field number 4

h#

Alias for field number 0

k#

Alias for field number 1

l#

Alias for field number 2

wavelength#

Alias for field number 3

spec2nexus.diffractometers.split_name_variation(geo_name)[source]#

split geo_name into geometry name and variation