Magnetic Calculator (Production Mapping)

License Level:BasicStandardAdvanced

Summary

Computes the magnetic field at point locations for a date and altitude you specify. Magnetic field values are written to one or more fields in the input point data. The magnetic value is calculated using the World Magnetic Model. The magnetic field values depend upon the magnetic component type. There are nine different magnetic component types. You can calculate all nine types into nine or more fields.

Usage

Syntax

MagneticCalculator_production (in_features, altitude, date, magnetic_component_fields)
ParameterExplanationData Type
in_features

The point features for which you want to calculate magnetic field values.

Feature Layer
altitude

The in_features elevation including the linear unit. Linear units include CENTIMETERS | DECIMETERS | FEET | INCHES | KILOMETERS | METERS | MILES | MILLIMETERS | NAUTICAL MILES | POINTS | YARDS.

Linear unit
date

The date for which you want to calculate magnetic field values. The date must be valid for the World Magnetic Model. The format must use two digits for the month, two digits for the day, and four digits for the year. Use "#", "", or None to use the current date.

Date
magnetic_component_fields
[magnetic_component_fields,...]

A list of magnetic component types and the fields the magnetic values will be written to. This list must contain one or more entries. The following component types can be used in the magnetic field calculation:

  • DECLINATIONAngle between magnetic north and true north. Varies by location on the globe.
  • ANNUAL_DRIFTAverage change in a year in magnetic declination due to changes in currents in the earth's core. Varies by location on the globe.
  • INCLINATION Angle between a compass needle and the plane of the horizon. Varies by latitude. Also known as magnetic dip or the dip of the compass needle.
  • HORIZONTALDetermined using north and east components. Also known as Horizontal intensity, or H. Varies by location on the globe.
  • EAST_COMPONENTEasterly intensity of the geomagnetic field. Also known as Y. Varies by location on the globe.
  • NORTH_COMPONENTNortherly intensity of the geomagnetic field. Also known as X. Varies by location on the globe.
  • VERTICAL_INTENSITYVertical intensity of the geomagnetic field. Also known as Z. Varies by location on the globe.
  • TOTAL_INTENSITYCalculated using horizontal and vertical components. Also known as F. Varies by location on the globe.
  • GRID_VARIATIONAngle between magnetic north and grid north. You must use the Lambert Conformal Conic projected coordinate system in the ArcMap data frame, geoprocessing environment, or in the input point data.
Value Table

Code Sample

MagneticCalculator example (stand-alone script)

The following stand-alone script demonstrates how to use the MagneticCalculator tool. It creates a feature layer from the Production Mapping sample data ElevP feature class, adds four fields to it, then executes the MagneticCalculator tool.

# MagCalc.py
# Description: Computes 4 types of magnetic component fields in a feature class

# Import arcpy, the Production Mapping toolbox, and checkout a license
import arcpy
arcpy.CheckOutExtension("foundation")

# data variables
ElevP2 = "C:/data/TutorialsSamples/TutorialsSamples/Tutorials/FeatureManager/Edit_Sample.gdb/Features/ElevP"
ElevP_Layer = "ElevP_Layer"

# Make Feature Layer from the ElevP feature class
arcpy.MakeFeatureLayer_management(ElevP2, ElevP_Layer)

# Add 4 magnetic component fields
arcpy.AddField_management("ElevP_Layer","annualdrift","LONG")
arcpy.AddField_management("ElevP_Layer", "declination","LONG")
arcpy.AddField_management("ElevP_Layer","horizontal","LONG")
arcpy.AddField_management("ElevP_Layer","inclination","LONG")

# Pass a list of fields and their magnetic components to the MagneticCalculator function
arcpy.MagneticCalculator_production("ElevP_Layer","1 Feet","9/1/2010","ANNUAL_DRIFT annualdrift;DECLINATION declination;HORIZONTAL horizontal;INCLINATION inclination")

arcpy.CheckInExtension("foundation")
MagneticCalculator example (Python window)

The following Python window script demonstrates how to use the MagneticCalculator tool with Production Mapping sample data. Execute this code from ArcMap or ArcCatalog. Enable the Production Mapping extension first.

# MagCalcPyWin.py
# Description: Computes a magnetic component field in a feature class

# data and feature layer
ElevP2 = "C:\\data\\TutorialsSamples\\TutorialsSamples\\Tutorials\\FeatureManager\\Edit_Sample.gdb\\Features\\ElevP"
ElevP_Layer = "ElevP_Layer"
arcpy.MakeFeatureLayer_management(ElevP2, ElevP_Layer)

# add a field to store the magnetic component
arcpy.AddField_management(ElevP_Layer, "declination", "LONG")

# invoke the tool
arcpy.MagneticCalculator_production("ElevP_Layer", "0 Meters", "10/7/2010", "DECLINATION declination")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: Requires Production Mapping
ArcGIS for Desktop Advanced: Requires Production Mapping
12/18/2014