Declare, use COORD_SYSTEM as 4326
This commit is contained in:
parent
68f83b72d2
commit
a93e91c1ee
3 changed files with 17 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
import re
|
||||
COORD_SYSTEM = 4326
|
||||
|
||||
class Coord():
|
||||
__slots__ = 'lat', 'lon',
|
||||
|
|
|
@ -1,7 +1,17 @@
|
|||
import csv
|
||||
import re
|
||||
|
||||
from nexrad.coord import Coord
|
||||
from nexrad.coord import Coord, COORD_SYSTEM
|
||||
|
||||
"""
|
||||
Implements a parser and wrapper class for the WSR-88D station list
|
||||
available at the following location (accessed 10 Feb 2025):
|
||||
|
||||
https://apollo.nvu.vsc.edu/classes/remote/lecture_notes/radar/88d/88D_locations.html
|
||||
|
||||
The input TSV file is created by copying and pasting the tabular data
|
||||
from a web browser into a text file.
|
||||
"""
|
||||
|
||||
RE_PARSE = re.compile(r'^\s*(\d+)([NS]*)\s+/\s+(\d+)([EW]*)\s*$')
|
||||
|
||||
|
@ -66,9 +76,9 @@ class Station():
|
|||
insert into nexrad_station (
|
||||
wban, call, name, site_elevation, tower_height, coord
|
||||
) values (
|
||||
?, ?, ?, ?, ?, MakePoint(?, ?, 4326)
|
||||
?, ?, ?, ?, ?, MakePoint(?, ?, %d)
|
||||
)
|
||||
"""
|
||||
""" % (COORD_SYSTEM)
|
||||
|
||||
db.execute(sql, (
|
||||
self.wban, self.call, self.name,
|
||||
|
|
|
@ -2,7 +2,7 @@ import gzip
|
|||
import csv
|
||||
import datetime
|
||||
|
||||
from nexrad.coord import Coord
|
||||
from nexrad.coord import Coord, COORD_SYSTEM
|
||||
|
||||
def time_from_str(time: str):
|
||||
size = len(time)
|
||||
|
@ -118,14 +118,13 @@ class StormReport():
|
|||
select
|
||||
id,
|
||||
call,
|
||||
ST_Distance(coord, MakePoint(?, ?, 4326), true) as distance,
|
||||
ST_AsText(coord) as coord
|
||||
ST_Distance(coord, MakePoint(?, ?, %d), true) as distance
|
||||
from
|
||||
nexrad_station
|
||||
order by
|
||||
distance asc
|
||||
limit 3
|
||||
"""
|
||||
""" % (COORD_SYSTEM)
|
||||
|
||||
st = db.execute(sql, (self.coord_start.lon,
|
||||
self.coord_start.lat))
|
||||
|
|
Loading…
Add table
Reference in a new issue