From a40020c53350a646dff493443e0f85d580623754 Mon Sep 17 00:00:00 2001 From: Bobby Jackson Date: Mon, 14 Oct 2024 09:30:50 -0500 Subject: [PATCH] FIX: Errors with pydda's read_from_pyart_grid with origin_latitude --- pydda/__init__.py | 2 +- pydda/io/read_grid.py | 5 +++++ setup.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pydda/__init__.py b/pydda/__init__.py index 7c343988..72c00ff2 100644 --- a/pydda/__init__.py +++ b/pydda/__init__.py @@ -12,7 +12,7 @@ from . import constraints from . import io -__version__ = "2.0.2" +__version__ = "2.0.3" print("Welcome to PyDDA %s" % __version__) print("If you are using PyDDA in your publications, please cite:") diff --git a/pydda/io/read_grid.py b/pydda/io/read_grid.py index a6fc55b1..bfad6bc7 100644 --- a/pydda/io/read_grid.py +++ b/pydda/io/read_grid.py @@ -90,6 +90,11 @@ def read_from_pyart_grid(Grid): origin_latitude = Grid.origin_latitude origin_longitude = Grid.origin_longitude origin_altitude = Grid.origin_altitude + # Ensure that origin latitude, longitude are 1-D for .to_xarray() + + origin_latitude["data"] = np.atleast_1d(np.squeeze(origin_latitude["data"])) + origin_longitude["data"] = np.atleast_1d(np.squeeze(origin_longitude["data"])) + origin_altitude["data"] = np.atleast_1d(np.squeeze(origin_altitude["data"])) if len(list(Grid.fields.keys())) > 0: first_grid_name = list(Grid.fields.keys())[0] diff --git a/setup.py b/setup.py index 8816943c..d0f7ae6e 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ PLATFORMS = "Linux, Windows, OSX" MAJOR = 2 MINOR = 0 -MICRO = 2 +MICRO = 3 # SCRIPTS = glob.glob('scripts/*') # TEST_SUITE = 'nose.collector'