def pulsar_data(tmpdir_factory): tmpdir = tmpdir_factory.mktemp("accumulate") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) test = runner.KotekanStageTester('visAccumulate', accumulate_params, runner.FakeGPUBuffer(**pulsar_params), dump_buffer, accumulate_params) test.run() yield dump_buffer.load()
def pulsar_data(tmpdir_factory): tmpdir = tmpdir_factory.mktemp("pulsar") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) dump_buffer_gated = runner.VisWriterBuffer(str(tmpdir), "raw") # Insert an extra buffer for gated stream dump_buffer.buffer_block.update(dump_buffer_gated.buffer_block) dump_buffer.stage_block.update(dump_buffer_gated.stage_block) acc_par = pulsar_params.copy() acc_par.update({ "gating": { "psr0": { "mode": "pulsar", "buf": dump_buffer_gated.name } }, "updatable_config": { "psr0": "/updatable_config/psr0_config" }, }) updatable_params = pulsar_params.copy() updatable_params.update({ "updatable_config": { "psr0_config": { "kotekan_update_endpoint": "json", "enabled": True, "pulsar_name": "fakepsr", "segment": 100.0, "coeff": [pulsar_params["coeff"]], "dm": pulsar_params["dm"], "t_ref": [pulsar_params["t_ref"]], "phase_ref": [pulsar_params["phase_ref"]], "rot_freq": pulsar_params["rot_freq"], "pulse_width": 1e-3, } } }) test = runner.KotekanStageTester( "visAccumulate", acc_par, runner.FakeGPUBuffer(**pulsar_params), dump_buffer, updatable_params, ) test.run() yield dump_buffer_gated.load()
def lostsamples_data(tmpdir_factory): tmpdir = tmpdir_factory.mktemp("lostsamples") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) test = runner.KotekanStageTester('visTransform', {'num_ev': 4}, [ runner.FakeGPUBuffer(mode='lostsamples', freq=params['freq'], num_frames=params['total_frames']) for g in range(params['num_gpu_buffers']) ], dump_buffer, params) test.run() yield dump_buffer.load()
def lostsamples_data(tmpdir_factory): tmpdir = tmpdir_factory.mktemp("lostsamples") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) test = runner.KotekanStageTester( 'visAccumulate', {'num_ev': 4}, runner.FakeGPUBuffer(mode='lostsamples', freq=accumulate_params['freq'], num_frames=accumulate_params['total_frames']), dump_buffer, accumulate_params) test.run() yield dump_buffer.load()
def gaussian_data(tmpdir_factory): tmpdir = tmpdir_factory.mktemp("gaussian") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) test = runner.KotekanStageTester( 'visAccumulate', {'num_ev': 4}, runner.FakeGPUBuffer(mode='gaussian', freq=gaussian_params['freq'], num_frames=gaussian_params['total_frames']), dump_buffer, gaussian_params) test.run() yield dump_buffer.load()
def pulsar_data(tmpdir_factory): tmpdir = tmpdir_factory.mktemp("pulsar") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) dump_buffer_gated = runner.VisWriterBuffer(str(tmpdir), "raw") # Insert an extra buffer for gated stream dump_buffer.buffer_block.update(dump_buffer_gated.buffer_block) dump_buffer.stage_block.update(dump_buffer_gated.stage_block) acc_par = pulsar_params.copy() acc_par.update({ 'gating': { 'psr0': { 'mode': 'pulsar', 'buf': dump_buffer_gated.name }, }, 'updatable_config': { 'psr0': "/updatable_config/psr0_config" }, }) updatable_params = pulsar_params.copy() updatable_params.update({ 'updatable_config': { 'psr0_config': { 'kotekan_update_endpoint': 'json', 'enabled': True, 'pulsar_name': 'fakepsr', 'segment': 100., 'coeff': [pulsar_params['coeff']], 'dm': pulsar_params['dm'], 't_ref': [pulsar_params['t_ref']], 'phase_ref': [pulsar_params['phase_ref']], 'rot_freq': pulsar_params['rot_freq'], 'pulse_width': 1e-3, } } }) test = runner.KotekanStageTester('visAccumulate', acc_par, runner.FakeGPUBuffer(**pulsar_params), dump_buffer, updatable_params) test.run() yield dump_buffer_gated.load()
def gaussian_data(tmpdir_factory): tmpdir = tmpdir_factory.mktemp("gaussian") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) test = runner.KotekanStageTester( "visAccumulate", {}, runner.FakeGPUBuffer( pattern="gaussian", freq=gaussian_params["freq"], num_frames=gaussian_params["total_frames"], ), dump_buffer, gaussian_params, ) test.run() yield dump_buffer.load()
def lostweights_data(tmpdir_factory, request): tmpdir = tmpdir_factory.mktemp("lostweights") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) test = runner.KotekanStageTester( "visAccumulate", {}, runner.FakeGPUBuffer( pattern="lostweights", freq=accumulate_params["freq"], num_frames=accumulate_params["total_frames"], b=request.param, ), dump_buffer, accumulate_params, ) test.run() yield (request.param, dump_buffer.load())
def lostsamples_data(tmpdir_factory): tmpdir = tmpdir_factory.mktemp("lostsamples") dump_buffer = runner.DumpVisBuffer(str(tmpdir)) test = runner.KotekanStageTester( "visTransform", {"num_ev": 4}, [ runner.FakeGPUBuffer( pattern="lostsamples", freq=params["freq"], num_frames=params["total_frames"], ) for g in range(params["num_gpu_buffers"]) ], dump_buffer, params, ) test.run() yield dump_buffer.load()