Class WMMLoader

java.lang.Object
com.irurueta.navigation.inertial.wmm.WMMLoader

public class WMMLoader extends Object
Loads a WWM from a file of coefficients. The file of coefficients is updated every 5 years and can be obtained at: https://www.ngdc.noaa.gov/geomag/WMM/
See Also:
  • Field Details

    • MAX_VAL

      private static final double MAX_VAL
      Maximum allowed value within file of coefficients.
      See Also:
    • N

      private static final int N
      Number of coefficients.
      See Also:
  • Constructor Details

    • WMMLoader

      private WMMLoader()
      Constructor. Prevents instantiation of helper class.
  • Method Details

    • loadFromResource

      public static WorldMagneticModel loadFromResource(String resource) throws IOException
      Loads World Magnetic Model from provided resource name. Resource will be resolved an loaded using current class loader.
      Parameters:
      resource - a resource name.
      Returns:
      a World Magnetic Model containing all required coefficients.
      Throws:
      IOException - if an I/O error occurs.
    • loadFromUrl

      public static WorldMagneticModel loadFromUrl(String url) throws IOException
      Loads World Magnetic Model from provided URL. Data will be requested with a "GET" method without additional headers.
      Parameters:
      url - URL to request data from.
      Returns:
      a World Magnetic Model containing all required coefficients.
      Throws:
      IOException - if an I/O error occurs.
    • loadFromFile

      public static WorldMagneticModel loadFromFile(String filePath) throws IOException
      Loads World Magnetic Model from provided file path.
      Parameters:
      filePath - a file path.
      Returns:
      a World Magnetic Model containing all required coefficients.
      Throws:
      IOException - if an I/O error occurs.
    • load

      public static WorldMagneticModel load(URL url) throws IOException
      Loads World Magnetic Model from provided URL. Data will be requested with a "GET" method without additional headers.
      Parameters:
      url - URL to request data from.
      Returns:
      a World Magnetic Model containing all required coefficients.
      Throws:
      IOException - if an I/O error occurs.
    • load

      public static WorldMagneticModel load(File file) throws IOException
      Loads World Magnetic Model from provided file.
      Parameters:
      file - a file.
      Returns:
      a World Magnetic Model containing all required coefficients.
      Throws:
      IOException - if an I/O error occurs.
    • load

      public static WorldMagneticModel load(InputStream stream) throws IOException
      Loads World Magnetic Model from provided stream of data.
      Parameters:
      stream - a stream of data.
      Returns:
      a World Magnetic Model containing all required coefficients.
      Throws:
      IOException - if an I/O error occurs.