-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move files around * rename header file * Add linting * fix CI * fix CI * add includes
- Loading branch information
Showing
16 changed files
with
97 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <XYZgeomag.hpp> | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
pinMode(1,INPUT); | ||
Serial.begin(9600); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
int val= digitalRead(1); | ||
float lat = val + 43.0f; // latitude in degrees | ||
float lon = val + 75.0f; // longitude in degrees | ||
float height = val + 305; // height above WGS84 ellipsoid in meters | ||
geomag::Vector position = geomag::geodetic2ecef(lat,lon,height); | ||
geomag::Vector mag_field = geomag::GeoMag(2022.5,position,geomag::WMM2020); | ||
geomag::Elements out = geomag::magField2Elements(mag_field, lat, lon); | ||
Serial.print(out.north); | ||
Serial.println(" nT north"); | ||
Serial.print(out.east); | ||
Serial.println(" nT east"); | ||
Serial.print(out.down); | ||
Serial.println(" nT down"); | ||
Serial.print(out.horizontal); | ||
Serial.println(" nT horizontal"); | ||
Serial.print(out.total); | ||
Serial.println(" nT total"); | ||
Serial.print(out.inclination); | ||
Serial.println(" deg inclination"); | ||
Serial.print(out.declination); | ||
Serial.println(" deg declination"); | ||
Serial.println(); | ||
delay(2000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <XYZgeomag.hpp> | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
pinMode(1,INPUT); | ||
Serial.begin(9600); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
int val= digitalRead(1); | ||
geomag::Vector in; | ||
in.x=val+1128529.6885767058f; | ||
in.y=val+0.0; | ||
in.z=val+6358023.736329913f; | ||
geomag::Vector out; | ||
int starttime=micros(); | ||
int starttimemil=millis(); | ||
out=geomag::GeoMag(2022.5,in,geomag::WMM2020); | ||
int endtime=micros(); | ||
int endtimemil=millis(); | ||
Serial.print(out.x*1E9); | ||
Serial.println(" nT x"); | ||
Serial.print(out.y*1E9); | ||
Serial.println(" nT y"); | ||
Serial.print(out.z*1E9); | ||
Serial.println(" nT z"); | ||
Serial.print("time in micro seconds: "); | ||
Serial.println(endtime-starttime); | ||
Serial.print("time in milli seconds: "); | ||
Serial.println(endtimemil-starttimemil); | ||
delay(2000); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name=XYZgeomag | ||
version=2.0.0 | ||
author=Nathan Zimmerberg <[email protected]> | ||
maintainer=Nathan Zimmerberg <[email protected]> | ||
sentence=Calculate the magnetic field on earth using the World Magnetic Model(WMM). | ||
paragraph=Given geocentric cartesian coordinates, the main function geomag::GeoMag calculates the magnetic field around earth in the International Terrestrial Reference System(ITRS) and uses units of decimal year, meter, and tesla. | ||
category=Data Processing | ||
url=https://github.com/nhz2/XYZgeomag | ||
architectures=* | ||
includes=XYZgeomag.hpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ SOFTWARE. | |
*/ | ||
|
||
|
||
// ../geomag.hpp Generated by python script wmmcodeupdate.py | ||
// ../src/XYZgeomag.hpp Generated by python script wmmcodeupdate.py | ||
/** \file | ||
* \author Nathan Zimmerberg ([email protected]) | ||
* \date 07 AUG 2021 | ||
|