modified gui
[pde-python.git] / const.py
blob5e00e9e21205ed82c5f6ad047209053bd066fe69
1 #-*- coding: utf-8 -*-
3 from numpy import sqrt, double, power
5 C = double('3e8')
6 LY = double('2e-5')
7 LZ = double('2e-5')
8 LAMBDA = double('2e-6')
10 HY = double(1e-7)
11 HZ = double(1e-7)
13 def get_characteristic(x):
14 if not isinstance(x, double):
15 raise TypeError('argument must be numpy.float64')
16 else:
17 s = "%g" % x
18 l = s.split('e')
19 return int(l[1])
21 def timestep(val):
22 # val = step / (C * sqrt(2))
23 c = get_characteristic(val)
24 return power(10, double(c))
26 HT = timestep(HY)