Esempio n. 1
0
 def load_from_htc(htc_file):
     """Load shear file from HTC file including shear function
     Parameters 
     ----------
     htc_file : str or HTCFile
         Filename or HTCFile
         
     Returns
     -------
     shear file : ShearFile-object
     """
     if isinstance(htc_file, str):
         htc_file = HTCFile(htc_file)
     user_defined_shear_filename = os.path.join(
         htc_file.modelpath, htc_file.wind.user_defined_shear[0])
     shear_file = ShearFile.load(user_defined_shear_filename)
     shear_file.shear = htc_file.get_shear()
     shear_file.u0 = htc_file.wind.wsp[0]
     return shear_file
 def test_get_shear(self):
     htc = HTCFile(tfp + 'test.htc')
     self.assertEqual(htc.get_shear()(100), 10 * (100 / 119)**.2)