scripts: added flashlog magnetic fit code

this runs the same mag offset code APM uses, but on a flashlog