Changeset 1120 for trunk/bindings/python/nxsunit.py
- Timestamp:
- 25/10/08 00:17:16 (4 years ago)
- File:
-
- 1 edited
-
trunk/bindings/python/nxsunit.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bindings/python/nxsunit.py
r1117 r1120 19 19 Usage example: 20 20 21 u = nxsunit.Converter('mili*metre') # Units stored in mm 21 import nxs.unit 22 u = nxs.unit.Converter('mili*metre') # Units stored in mm 22 23 v = u(3000,'m') # Convert the value 3000 mm into meters 23 24 … … 30 31 units = [for attr,value in file.attrs() if attr == 'units'] 31 32 # 3. set up the converter (assumes that units actually exists) 32 u = nxs unit.Converter(units[0])33 u = nxs.unit.Converter(units[0]) 33 34 # 4. read the data and convert to the correct units 34 35 v = u(file.read(),'radians') … … 43 44 getting the dimension from the units as we are currently doing. 44 45 """ 46 47 __all__ = ['Converter'] 45 48 46 49 # TODO: Add udunits to NAPI rather than reimplementing it in python
Note: See TracChangeset
for help on using the changeset viewer.
