Skip to content

Peel doesn't peel #61

@d3v-null

Description

@d3v-null

The peel subcommand currently only does ionospheric subtraction.

It solves for the ionospheric refraction experienced by each source given by the angles l=αλ² and m=βλ², as well as a scalar gain, g applied uniformly across all channels and polarizations.

A full peel would DI calibrate towards the source too.

A skeleton of this functionality exists in an earlier version of peel

if pass == num_passes - 1 && i_source < num_sources_to_peel {
    // We currently can only do DI calibration on the CPU. Copy the visibilities back to the host.
    let vis = d_high_res_vis_tfb.copy_from_device_new()?;

    let mut d_high_res_model_rotated: DevicePointer<Jones<f32>> =
        DevicePointer::malloc(d_high_res_model_tfb.get_size())?;
    d_high_res_model_rotated.clear();
    gpu_kernel_call!(
        gpu::add_model,
        d_high_res_model_rotated.get_mut().cast(),
        d_high_res_model_tfb.get().cast(),
        //iono_consts.0 as GpuFloat,
        //iono_consts.1 as GpuFloat,
        gpu_iono_consts,
        d_lambdas.get(),
        d_uvws_to.get(),
        num_timesteps_i32,
        num_low_res_chans_i32,
        num_cross_baselines_i32,
    )?;
    let model = d_high_res_model_rotated.copy_from_device_new()?;
    dbg!(vis[0], vis[2], vis[32], vis[34]);
    dbg!(model[0], model[2], model[32], model[34]);

    let mut di_jones =
        Array3::from_elem((1, num_tiles, num_high_res_chans), Jones::identity());
    let shape = (num_timesteps, num_high_res_chans, num_cross_baselines);
    let pb = ProgressBar::hidden();
    let di_cal_results = calibrate_timeblock(
        ArrayView3::from_shape(shape, &vis).expect("correct shape"),
        ArrayView3::from_shape(shape, &model).expect("correct shape"),
        di_jones.view_mut(),
        timeblock,
        high_res_chanblocks,
        50,
        1e-8,
        1e-4,
        obs_context.polarisations,
        pb,
        true,
    );
    if di_cal_results.into_iter().all(|r| r.converged) {
        // Apply.
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions