Skip to content

Commit

Permalink
updated utilFcns and affected files
Browse files Browse the repository at this point in the history
  • Loading branch information
royagrace committed Oct 2, 2024
1 parent c79109a commit ca7aeb8
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 78 deletions.
10 changes: 5 additions & 5 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
writeArrayToRaster, rio_profile,
rio_extents, getTimeFromFile, enu2ecef, ecef2enu,
transform_bbox, clip_bbox, get_nearest_wmtimes,
robmax,robmin,padLower,convertLons,
padLower,convertLons,
projectDelays,floorish,round_date,
)

Expand Down Expand Up @@ -551,10 +551,10 @@ def test_rio_4():


def test_robs():
assert robmin([1, 2, 3, np.nan])==1
assert robmin([1,2,3])==1
assert robmax([1, 2, 3, np.nan])==3
assert robmax([1,2,3])==3
assert np.nanmin([1, 2, 3, np.nan])==1
assert np.nanmin([1,2,3])==1
assert np.nanmax([1, 2, 3, np.nan])==3
assert np.nanmax([1,2,3])==3


def test_floorish1():
Expand Down
8 changes: 4 additions & 4 deletions tools/RAiDER/models/weatherModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from RAiDER.logger import logger
from RAiDER.models import plotWeather as plots
from RAiDER.models.customExceptions import DatetimeOutsideRange
from RAiDER.utilFcns import calcgeoh, clip_bbox, robmax, robmin, transform_coords
from RAiDER.utilFcns import calcgeoh, clip_bbox, transform_coords


TIME_RES = {
Expand Down Expand Up @@ -121,9 +121,9 @@ def __str__(self) -> str:
string += 'Number of points in Lon/Lat = {}/{}\n'.format(*self._p.shape[:2])
string += f'Total number of grid points (3D): {np.prod(self._p.shape)}\n'
if self._xs.size == 0:
string += f'Minimum/Maximum y: {robmin(self._ys): 4.2f}/{robmax(self._ys): 4.2f}\n'
string += f'Minimum/Maximum x: {robmin(self._xs): 4.2f}/{robmax(self._xs): 4.2f}\n'
string += f'Minimum/Maximum zs/heights: {robmin(self._zs): 10.2f}/{robmax(self._zs): 10.2f}\n'
string += f'Minimum/Maximum y: {np.nanmin(self._ys): 4.2f}/{np.nanmax(self._ys): 4.2f}\n'
string += f'Minimum/Maximum x: {np.nanmin(self._xs): 4.2f}/{np.nanmax(self._xs): 4.2f}\n'
string += f'Minimum/Maximum zs/heights: {np.nanmin(self._zs): 10.2f}/{np.nanmax(self._zs): 10.2f}\n'

string += '=====================================\n'
return string
Expand Down
Loading

0 comments on commit ca7aeb8

Please sign in to comment.