1#------------------------------------------------------------------------------
2# Copyright (c) 2005, Enthought, Inc.
3# All rights reserved.
4#
5# This software is provided without warranty under the terms of the BSD
6# license included in enthought/LICENSE.txt and may be redistributed only
7# under the conditions described in the aforementioned license.  The license
8# is also available online at http://www.enthought.com/licenses/BSD.txt
9# Thanks for using Enthought open source!
10#
11# Author: Travis N. Vaught
12# Date: 05/22/2005
13# Description: Define units of volume
14#
15# Derived from: units/volume.py [pyre system]
16#               Michael A.G. Aivazis
17#               California Institute of Technology
18#               (c) 1998-2003
19#
20# Symbols defined: cubic_meter [and variants]
21#                  cubic_centimeter [and variants]
22#                  cubic_foot [and variants]
23#                  cubic_inch [and variants]
24#                  liter [and variants]
25#                  barrel [and variants]
26#                  us_fluid...
27#                          _pint
28#                          _quart
29#                          _gallon [and variants]
30#
31#------------------------------------------------------------------------------
32
33#############################################################################
34# Imports:
35#############################################################################
36
37from __future__ import absolute_import
38from .length import meter, centimeter, foot, inch
39
40#############################################################################
41# Definitions:
42#############################################################################
43#
44# Definitions of common volume units
45# Data taken from Appendix F of Halliday, Resnick, Walker, "Fundamentals of Physics",
46#     fourth edition, John Willey and Sons, 1993
47
48cubic_meter = meter**3
49cubic_meter.label = 'cubic meters'
50cubic_centimeter = centimeter**3
51cubic_centimeter.label = 'cubic centimeters'
52cubic_foot = foot**3
53cubic_foot.label = 'cubic feet'
54cubic_inch = inch**3
55cubic_inch.label = 'cubic_inches'
56
57liter = 1000 * cubic_centimeter
58liter.label = 'liters'
59
60barrel = 5.61458 * cubic_foot
61barrel.label = 'barrel'
62
63us_fluid_ounce = 231. / 128. * cubic_inch
64us_pint = 16 * us_fluid_ounce
65us_fluid_quart = 2 * us_pint
66us_fluid_gallon = 4 * us_fluid_quart
67
68#############################################################################
69# Aliases:
70#############################################################################
71
72c3 = cubic_centimeter
73cm3 = cubic_centimeter
74cc = cm3
75
76m3 = V = cubic_meter
77
78f3 = cubic_foot
79ft3 = f3
80cuft = f3
81
82liters = liter
83
84bbl = barrel
85
86gallon = gallons = us_fluid_gallon
87
88#### EOF ######################################################################
89