From d2345f9966fb6d5f2de8f70179527d8203e8481b Mon Sep 17 00:00:00 2001 From: ealerskans Date: Tue, 23 Jul 2024 09:41:29 +0200 Subject: [PATCH] Add new areas (qaan, sc, db) and modify existing (sgl, nuuk) --- dlotter/arguments.py | 2 +- dlotter/plot.py | 37 +++++++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/dlotter/arguments.py b/dlotter/arguments.py index cc845c6..90b73f3 100644 --- a/dlotter/arguments.py +++ b/dlotter/arguments.py @@ -112,7 +112,7 @@ def get_args(self, sysargs): metavar='AREA', type=str, help='Over which area to plot (Options are: dk, gl, neu, sjalland, disko, \ - europe, faroes, scoresbysund, sgl, tas, nkb)', + europe, faroes, scoresbysund, sgl, tas, nuuk, qaan, sc, db)', default="dk", required=False) diff --git a/dlotter/plot.py b/dlotter/plot.py index 3467a0e..6483445 100644 --- a/dlotter/plot.py +++ b/dlotter/plot.py @@ -193,7 +193,7 @@ def projections(self,args:argparse.Namespace) -> None: false_easting=0.0, false_northing=0.0, standard_parallels=(20.0, 50.0), globe=None) self.data_crs = ccrs.PlateCarree() - self.extent = [-52, -37, 59, 63] + self.extent = [-49.1, -40.7, 59.1, 62.7] if args.area == 'tas': self.projection = ccrs.AlbersEqualArea(central_longitude=-37.7, central_latitude=65.9, @@ -202,12 +202,35 @@ def projections(self,args:argparse.Namespace) -> None: self.data_crs = ccrs.PlateCarree() self.extent = [-41.1, -34.2, 64.6, 67.3] - if args.area == 'nkb': + if args.area == 'nuuk': self.projection = ccrs.AlbersEqualArea(central_longitude=-52.0, central_latitude=63.2, false_easting=0.0, false_northing=0.0, standard_parallels=(20.0, 50.0), globe=None) self.data_crs = ccrs.PlateCarree() - self.extent = [-57.5, -46.5, 61.5, 68.5] + self.extent = [-57.2, -47.1, 62.0, 68.0] + + if args.area == 'sc': + self.projection = ccrs.AlbersEqualArea(central_longitude=-25., central_latitude=71.5, + false_easting=0.0, false_northing=0.0, + standard_parallels=(20.0, 50.0), globe=None) + self.data_crs = ccrs.PlateCarree() + self.extent = [-31.8, -17.3, 68.3, 74.6] + + if args.area == 'db': + self.projection = ccrs.AlbersEqualArea(central_longitude=-52.0, central_latitude=63.2, + false_easting=0.0, false_northing=0.0, + standard_parallels=(20.0, 50.0), globe=None) + self.data_crs = ccrs.PlateCarree() + self.extent = [-57.6, -44.6, 66.0, 71.8] + + if args.area == 'qaan': + #self.projection = ccrs.AlbersEqualArea(central_longitude=-52.0, central_latitude=63.2, + # false_easting=0.0, false_northing=0.0, + # standard_parallels=(20.0, 50.0), globe=None) + self.projection = ccrs.Stereographic(central_latitude=70, central_longitude=-42) + self.data_crs = ccrs.PlateCarree() + #self.extent = [-75.0, -62.6, 75.7, 78.6] + self.extent = [-75.0, -62.6, 75.8, 78.4] return @@ -1090,9 +1113,15 @@ def barbs_thin(self, clons:np.array, area:str) -> int: int Thinning factor to use for barbs """ - if area == 'gl': + if area in ['gl']: dx = abs(clons.flatten()[0] - clons.flatten()[1]) thinner = int(2/dx) + elif area in ['sc']: + dx = abs(clons.flatten()[0] - clons.flatten()[1]) + thinner = int(1/dx) + elif area in ['db', 'qaan']: + dx = abs(clons.flatten()[0] - clons.flatten()[1]) + thinner = int(0.75/dx) else: dx = abs(clons.flatten()[0] - clons.flatten()[1]) thinner = int(0.5/dx)