I did this for python code and tried to check using this website http://wdc.kugi.kyoto-u.ac.jp/igrf/gggm/index.html . I found that
- The magnetic pole is the year 1995.
- Even if I set the above calculation to use the value for 1995, I did not quite understand correctly.
I used the value for Kyoto, Japan (35 N, 135.45 W). Web page calculation (25.18, -155.80). I got (25.33580652, -155.82724011). Therefore, I am not entirely sure that this can be really used ...
import numpy as np from numpy import pi, cos, sin, arctan2, sqrt, dot def geo2mag(incoord): """geographic coordinate to magnetic coordinate: incoord is numpy array of shape (2,*) array([[glat0,glat1,glat2,...], [glon0,glon1,glon2,...]) where glat, glon are geographic latitude and longitude (or if you have only one point it is [[glat,glon]]) returns array([mlat0,mlat1,...], [mlon0,mlon1,...]]) """
source share