polar profile extraction code