Coverage for pygeodyn/shear/generic.py: 100%

26 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-12-22 13:43 +0000

1import numpy as np 

2from pygeodyn.shear import blackBoxFormula2temp as bbf 

3 

4class Generic(): 

5 """ 

6 Base level class 

7 """ 

8 

9 def __init__(self, cfg, test): 

10 """ 

11 Init instance variables 

12 

13 :param cfg: variable containing configuration dictionary 

14 """ 

15 

16 self.tau1 = cfg.TauG 

17 

18 self.Lu = cfg.Lu 

19 self.Ly = cfg.Ly 

20 self.Lb = cfg.Lb 

21 self.Lsv = cfg.Lsv 

22 self.prior_dir_shear = str(cfg.prior_dir_shear) 

23 self.prior_type_shear = cfg.prior_type_shear 

24 self.glasso_lambda_u = cfg.remove_spurious_shear_u 

25 self.glasso_lambda_err = cfg.remove_spurious_shear_err 

26 

27 self.tmax = 64 

28 self.tpmax = 2 * self.tmax**2 

29 self.pmax = 2 * self.tmax 

30 self.gauss_thetas, self.gauss_weights = bbf.gaussPoints(0, np.pi, self.tmax) 

31 self.phis = np.linspace(0, 2 * np.pi, self.pmax, endpoint=False) 

32 self.Nb = self.Lb * (self.Lb + 2) 

33 self.Nsv = self.Lsv * (self.Lsv + 2) 

34 self.Nu = self.Lu * (self.Lu + 2) 

35 self.Nu2 = 2 * self.Nu 

36 self.Ny = self.Ly * (self.Ly + 2) 

37 self.Ny2 = 2 * self.Ny 

38 self.Lq = self.Lu - 1 

39 self.test = test