我目前正致力于将指南针安装在我正在研制的嵌入式微芯片PIC32家庭设备上。
指南针是在世界的另一个地方制造的,一旦组装好,我希望能够在世界的其他地方使用它,而不必在我所去的地方重新校准它。
嵌入式设备上也有一个GPS单元,所以我想我应该能够调整真实北极和磁北极之间的定位差异。如果我有一个查表,目前的GPS位置可以用来计算角度,设置和调整罗盘读数。
有人知道我能在哪里找到这些吗?
(不幸的是,谷歌相关的搜索现在充斥着9-11航班被调整的阴谋论)
发布于 2015-03-02 02:55:10
有一个python模块,风水,值得一看。
magnetic_declination_degrees = geomag.declination(latitude, longitude)
>>> import geomag
>>> geomag.declination(-33, 151)
12.156567323514675
>>>不是csv,但很简单。
阅读文档,您可以调整模型的日期。
编辑:如果嵌入式系统运行gpsd,这个gps3客户端可以自动获取lat/lon。
import time
import gps3
import geomag
the_connection = gps3.GPSDSocket()
the_fix = gps3.Fix()
try:
for new_data in the_connection:
if new_data:
the_fix.refresh(new_data)
if not isinstance(the_fix.TPV['lat'], str): # non-string lat is a determinate of when data is 'valid'
latitude = the_fix.TPV['lat']
longitude = the_fix.TPV['lon']
magnetic_declination_degrees = geomag.declination(latitude, longitude)
print(magnetic_declination_degrees)
time.sleep(5)
except Exception as error:
print('Magnetic Declination is sick: ', error)编辑:这里有一个csv;-)根据您想要的粒度更改范围内的数字。
import geomag
for latitude in range(-60, 60, 10):
for longitude in range(-180, 170, 10):
magnetic_declination_degrees = geomag.declination(latitude, longitude)
print(latitude, ',', longitude, ',', magnetic_declination_degrees) 发布于 2015-03-02 16:48:54
NGDC (国家地球物理数据中心)发布了一个世界磁模型(C代码和数据),该模型给出了一个位置和日期,返回场强和方向矢量。http://www.ngdc.noaa.gov/geomag/WMM/soft.shtml
WMM数据每五年重新发布一次。在2020年后使用当前的WMM2015数据将返回有效但不准确的结果。
https://stackoverflow.com/questions/28801498
复制相似问题