def compute_vel_swd(name, path, z=0., is_info=False): if is_info: print(f'Run model: {name} in dir: {path} z= {z}') model = Stella(name, path=path) # check data if not model.is_swd: raise ValueError("There are no swd-file for %s in the directory: %s " % (name, path)) swd = model.get_swd().load() data = swd.params_ph(cols=['V']) res = np.array(np.zeros(len(data['V'])), dtype=np.dtype({ 'names': ['time', 'vel'], 'formats': [np.float] * 2 })) res['time'] = data['time'] * (1. + z) # redshifted time res['vel'] = data['V'] return res
def setUp(self): name = 'rednova_R3.2_M6_Ni0_E0.25' path = join(dirname(abspath(__file__)), 'data', 'stella') stella = Stella(name, path=path) self.swd = stella.get_swd() self.swd.load()
def setUp(self): name = 'rednova_R3.2_M6_Ni0_E0.25' path = join(dirname(abspath(__file__)), 'data', 'stella') stella = Stella(name, path=path) self.swd = stella.get_swd()