def test_get_data_direct(datafiles): from plutokore import io assert len(datafiles.listdir()) == 1 path = str(datafiles.listdir()[0]) data = io.pload(0, w_dir=path) plot.get_pluto_data_direct(data, 'rho', True, path, 0) plot.get_pluto_data_direct(data, 'rho', False, path, 0) plot.get_pluto_data_direct_no_log(data, 'rho', True, path, 0)
def test_get_luminosity_old_nonconvolved(datafiles, makino_env_12p5, jet_12p5): from plutokore import jet from plutokore import io from astropy import units as u assert len(datafiles.listdir()) == 1 path = str(datafiles.listdir()[0]) data = io.pload(0, w_dir=path) z = 0.1 beam_width = 5 * u.arcsec ntracers = 4 uv = jet.get_unit_values(makino_env_12p5, jet_12p5) (l, f) = radio.get_luminosity_old(data, uv.density, uv.length, uv.time, z, beam_width, ntracers)
def test_get_surface_brightness(datafiles, makino_env_12p5, jet_12p5): from plutokore import jet from plutokore import io from astropy import units as u assert len(datafiles.listdir()) == 1 path = str(datafiles.listdir()[0]) data = io.pload(0, w_dir=path) z = 0.1 beam_width = 5 * u.arcsec ntracers = 4 uv = jet.get_unit_values(makino_env_12p5, jet_12p5) l = radio.get_luminosity(data, uv, z, beam_width) f = radio.get_flux_density(l, z) fc = radio.get_convolved_flux_density(f, z, beam_width) sb = radio.get_surface_brightness(f, data, uv, z, beam_width)
def test_load_data_file(datafiles): assert len(datafiles.listdir()) == 1 path = str(datafiles.listdir()[0]) data = io.pload(0, w_dir=path) # assert we have 4 tracer variables assert len([x for x in data.vars if 'tr' in x]) == 4 # assert we have the regular variables assert all(x in data.vars for x in ['rho', 'prs', 'vx1', 'vx2']) # assert axis shapes assert data.x1.shape[0] == 2064 assert data.x2.shape[0] == 448 assert data.geometry == 'SPHERICAL' # check simulation time assert data.SimTime == 0.0