The variation (rate of change) of the IGRF is defined in 5-year increments and should vary as a series of stepwise constants, not be continuous in time.
Lines 37-40 are incorrect at the 5-year time increments when the IGRF coefficient changes.
Something along the lines of this would be more accurate (I've not error checked this, might break when given 2025 as the year for example):
x, y, z, f = calculate.igrf12syn(year, 1, alt, lat, lon) # need main field at `year`
x1, y1, z1, f1 = calculate.igrf12syn(5*floor(year/5), 1, alt, lat, lon) # main field at start of 5 year interval
x2, y2, z2, f2 = calculate.igrf12syn((5*floor(year/5))+5, 1, alt, lat, lon) # main field at start of next 5 year interval
dx, dy, dz, df = (x2-x1)/5, (y2-y1)/5, (z2-z1)/5, (f2-f1)/5 # constant variation from e.g. 2010.0<=x<2015.0
The variation (rate of change) of the IGRF is defined in 5-year increments and should vary as a series of stepwise constants, not be continuous in time.
Lines 37-40 are incorrect at the 5-year time increments when the IGRF coefficient changes.
pyIGRF/pyIGRF/value.py
Lines 37 to 40 in 9b48889
Something along the lines of this would be more accurate (I've not error checked this, might break when given 2025 as the year for example):