Skip to content

Commit

Permalink
Fix issue #24
Browse files Browse the repository at this point in the history
  • Loading branch information
giovaniceotto committed Jan 31, 2019
1 parent 6a6cd97 commit 07a6e1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nbks/rocketpyAlpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,7 @@ def __init__(self,
to retrieve weather data from netCDF and OPeNDAP by using bi-linear
interpolation of the variables available in the file. If the location
given is outside of the grid given in the file, an exception is raised.
Latitude ranges from -90 to 90 and longitude ranges from -180 to 360.
date : array, optional
Array of length 4, stating (year, month, day, hour (UTC)) of
rocket launch. Must be given if wind data source is a netCDF file,
Expand Down Expand Up @@ -2349,7 +2350,13 @@ def processNetCDFFile(self, windData):
warnings.warn('Exact chosen launch time is not available in the provided file, using {:%Y-%m-%d %H:%M} UTC instead.'.format(fileTimeDate))

# Find longitude index
lon = self.lon%360
# Determine if file uses -180 to 180 or 0 to 360
if lons[0] < 0 or lons[-1] < 0:
# Convert input to -180 - 180
lon = self.lon if self.lon < 180 else -180 + self.lon%180
else:
# Convert input to 0 - 360
lon = self.lon%360
# Check if reversed or sorted
if lons[0] < lons[-1]:
# Deal with sorted lons
Expand Down

0 comments on commit 07a6e1a

Please sign in to comment.