Jpp  19.1.0
the software that should make you happy
Functions | Variables
makedeclinationtable Namespace Reference

Functions

def gettimestamp (year, month, day)
 

Variables

 args = docopt(__doc__, version='0.1')
 
 easting = args['<easting>']
 
 northing = args['<northing>']
 
 zone = args['<zone>']
 
 letter = args['<letter>']
 
 latitude
 
 longitude
 
string model = 'IGRF'
 
int day = 1
 
 x
 
 y = json.loads(x.text)
 
 result = y['result'][0]
 
 declination = result['declination']
 

Detailed Description

Create magnetic declination table from UTM coordinates in degrees
Requires `pip install docopt numpy utm`

Usage:
    makedeclinationtable.py <easting> <northing> <zone> <letter>

Arguments:
    easting   UTM Easting of the site
    northing  UTM Northing of the site
    zone      UTM zone
    letter    UTM letter

Function Documentation

◆ gettimestamp()

def makedeclinationtable.gettimestamp (   year,
  month,
  day 
)

Definition at line 24 of file makedeclinationtable.py.

24 def gettimestamp(year, month, day):
25  d = date(year, month, day)
26  ts = calendar.timegm(d.timetuple())
27  dt = datetime.utcfromtimestamp(ts)
28  fts = dt.replace(tzinfo=timezone.utc).timestamp()
29  return int(fts)
30 
def gettimestamp(year, month, day)

Variable Documentation

◆ args

makedeclinationtable.args = docopt(__doc__, version='0.1')

Definition at line 31 of file makedeclinationtable.py.

◆ easting

makedeclinationtable.easting = args['<easting>']

Definition at line 32 of file makedeclinationtable.py.

◆ northing

makedeclinationtable.northing = args['<northing>']

Definition at line 33 of file makedeclinationtable.py.

◆ zone

makedeclinationtable.zone = args['<zone>']

Definition at line 34 of file makedeclinationtable.py.

◆ letter

makedeclinationtable.letter = args['<letter>']

Definition at line 35 of file makedeclinationtable.py.

◆ latitude

makedeclinationtable.latitude

Definition at line 36 of file makedeclinationtable.py.

◆ longitude

makedeclinationtable.longitude

Definition at line 36 of file makedeclinationtable.py.

◆ model

string makedeclinationtable.model = 'IGRF'

Definition at line 39 of file makedeclinationtable.py.

◆ day

int makedeclinationtable.day = 1

Definition at line 40 of file makedeclinationtable.py.

◆ x

makedeclinationtable.x
Initial value:
1 = requests.get('https://www.ngdc.noaa.gov/geomag-web/calculators/calculateDeclination?lat1='+str(latitude) + \
2  '&lon1='+str(longitude) + \
3  '&model='+model + \
4  '&startYear='+str(year) + \
5  '&startMonth='+str(month) + \
6  '&startDay='+str(day) + \
7  '&resultFormat=json')

Definition at line 44 of file makedeclinationtable.py.

◆ y

makedeclinationtable.y = json.loads(x.text)

Definition at line 51 of file makedeclinationtable.py.

◆ result

makedeclinationtable.result = y['result'][0]

Definition at line 52 of file makedeclinationtable.py.

◆ declination

makedeclinationtable.declination = result['declination']

Definition at line 53 of file makedeclinationtable.py.