test_fortranapex

Test the apexpy.fortranapex class

Notes

Whenever function outputs are tested against hard-coded numbers, the test results (numbers) were obtained by running the code that is tested. Therefore, these tests below only check that nothing changes when refactoring, etc., and not if the results are actually correct.

These results are expected to change when IGRF is updated.

Module Contents

Classes

TestFortranApex

Test class for the Python-wrapped Fortran functions.

class test_fortranapex.TestFortranApex[source]

Bases: object

Test class for the Python-wrapped Fortran functions.

setup_method()[source]

Initialize each test.

teardown_method()[source]

Clean environment after each test.

run_test_evaluation(rtol=1e-05, atol=1e-05)[source]

Run the evaluation of the test results.

Parameters
  • rtol (float) – Relative tolerance, default value based on old code’s precision (default=1e-5)

  • atol (float) – Absolute tolerance, default value based on old code’s precision (default=1e-5)

test_apxg2q()[source]

Test fortran apex geographic to quasi-dipole.

test_apxg2all()[source]

Test fortran apex geographic to all outputs.

test_apxq2g()[source]

Test fortran quasi-dipole to geographic.

test_g2q2d(lat, lon)[source]

Test fortran geographic to quasi-dipole and back again.

Parameters
  • lat (int or float) – Latitude in degrees N

  • lon (int or float) – Longitude in degrees E

test_apxq2g_lowprecision()[source]

Test low precision error value.