Magnetic Calculator (Production Mapping)

许可等级:BasicStandardAdvanced

摘要

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. Date values must fall between 1/1/2005 and 12/31/2014. 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.

用法

语法

MagneticCalculator_production (in_features, altitude, date, magnetic_component_fields)
参数说明数据类型
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 between January 1, 2005, and December 31, 2014. 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

代码实例

MagneticCalculator example (stand-alone script)

The following stand-alone script demonstrates how to use the MagneticCalculator tool.

# Name: MagneticCalculator_Example.py
# Description: Computes 4 types of magnetic component fields in a feature class
# Requires: Esri Production Mapping

import arcpy

# checkout a license and set gp environment
arcpy.CheckOutExtension("foundation")
arcpy.env.workspace="c:/data/Austin.gdb"

# data variables
elevations = "TopographicMap/ElevationP"
elevationsLyr = "elevationsLyr"

# make an elevations feature layer
arcpy.MakeFeatureLayer_management(elevations, elevationsLyr)

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

# altitude, magnetic date and component fields list
alt="1 Feet"
magDate="9/1/2010"
fieldsList="ANNUAL_DRIFT annualdrift;DECLINATION declination;HORIZONTAL horizontal;INCLINATION inclination"

# exec the MagneticCalculator function
arcpy.MagneticCalculator_production(elevationsLyr,alt,magDate,fieldsList)
print arcpy.GetMessages()
MagneticCalculator example 2 (Python window)

The following Python window script demonstrates how to use the MagneticCalculator tool.

import arcpy

# set gp environment
arcpy.env.workspace="c:/data/Austin.gdb"

# elevation data
elevations = "TopographicMap/ElevationP"
elevationsLyr = "elevationsLyr"

# make an elevations feature layer
arcpy.MakeFeatureLayer_management(elevations, elevationsLyr)

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

# altitude, magnetic date and component fields list
alt="0 Meters"
magDate="10/7/2010"
fieldsList="DECLINATION declination"

# invoke the tool
arcpy.MagneticCalculator_production(elevationsLyr,alt,magDate,fieldsList)

环境

相关主题

许可信息

ArcGIS for Desktop Basic: 否
ArcGIS for Desktop Standard: 需要 Production Mapping
ArcGIS for Desktop Advanced: 需要 Production Mapping
4/27/2014