Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:GeoscienceAustralia/tcrm into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
wcarthur committed Mar 15, 2024
2 parents df32ae0 + 1e37d97 commit ebc5372
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 360 deletions.
6 changes: 1 addition & 5 deletions DataProcess/DataProcess.py
Expand Up @@ -312,10 +312,6 @@ def processData(self, restrictToWindfieldDomain=False):
if self.ncflag:
self.data['index'] = indicator

# ieast : parameter used in latLon2Azi
# FIXME: should be a config setting describing the input data.
ieast = 1

# Determine the index of initial cyclone observations, excluding
# those cyclones that have only one observation. This is used
# for calculating initial bearing and speed
Expand All @@ -325,7 +321,7 @@ def processData(self, restrictToWindfieldDomain=False):

# Calculate the bearing and distance (km) of every two
# consecutive records using ll2azi
bear_, dist_ = maputils.latLon2Azi(lat, lon, ieast, azimuth=0)
bear_, dist_ = maputils.latLon2Azi(lat, lon)
assert bear_.size == indicator.size - 1
assert dist_.size == indicator.size - 1
bear = np.empty(indicator.size, 'f')
Expand Down
2 changes: 1 addition & 1 deletion Evaluate/interpolateTracks.py
Expand Up @@ -201,7 +201,7 @@ def interpolate(track, delta, interpolation_type=None):
nrMax = interp1d(timestep, track.rMax, kind='linear')(newtime)

if len(nLat) >= 2:
bear_, dist_ = latLon2Azi(nLat, nLon, 1, azimuth=0)
bear_, dist_ = latLon2Azi(nLat, nLon)
nthetaFm = np.zeros(newtime.size, dtype=float)
nthetaFm[:-1] = bear_
nthetaFm[-1] = bear_[-1]
Expand Down
2 changes: 1 addition & 1 deletion Utilities/interpTrack.py
Expand Up @@ -186,7 +186,7 @@ def interpolateTrack(configFile, trackFile, source, delta=0.1,
npEnv = scint.interp1d(timestep, penv, kind='linear')(newtime)
nrMax = scint.interp1d(timestep, rmax, kind='linear')(newtime)

bear_, dist_ = maputils.latLon2Azi(nLat, nLon, 1, azimuth=0)
bear_, dist_ = maputils.latLon2Azi(nLat, nLon)
nthetaFm = numpy.zeros(newtime.size, 'f')
nthetaFm[:-1] = bear_
nthetaFm[-1] = bear_[-1]
Expand Down
18 changes: 9 additions & 9 deletions Utilities/loadData.py
Expand Up @@ -152,7 +152,7 @@ def __getattr__(self, key):
"""

def getSpeedBearing(index, lon, lat, deltatime, ieast=1,
def getSpeedBearing(index, lon, lat, deltatime,
missingValue=sys.maxsize):
"""
Calculate the speed and bearing of a TC.
Expand Down Expand Up @@ -182,7 +182,7 @@ def getSpeedBearing(index, lon, lat, deltatime, ieast=1,
"""

bear_, dist_ = maputils.latLon2Azi(lat, lon, ieast, azimuth=0)
bear_, dist_ = maputils.latLon2Azi(lat, lon)
assert bear_.size == index.size - 1
assert dist_.size == index.size - 1
bearing = np.zeros(index.size, 'f')
Expand Down Expand Up @@ -649,7 +649,7 @@ def ltmPressure(jdays, time, lon, lat, ncfile, ncvar='slp'):
ncobj = nctools.ncLoadFile(ncfile)
if ncvar not in ncobj.variables:
raise KeyError(f"{ncfile} does not contain a variable called '{ncvar}'")

slpunits = getattr(ncobj.variables[ncvar], 'units')

data = nctools.ncGetData(ncobj, ncvar)
Expand Down Expand Up @@ -679,9 +679,9 @@ def getPoci(penv, pcentre, lat, jdays, eps,
:param lat: Latitude of storm (degrees).
:param jdays: Julian day (day of year).
:param eps: random variate. Retained as a constant for a single storm.
:param list coeffs: Coefficients of the model. Defaults based on
Southern Hemisphere data
(IBTrACS v03r06, 1981-2014).
:param list coeffs: Coefficients of the model. Defaults based on
Southern Hemisphere data
(IBTrACS v03r06, 1981-2014).
:returns: Revised estimate for the pressure of outermost closed isobar.
"""
Expand All @@ -700,7 +700,7 @@ def getPoci(penv, pcentre, lat, jdays, eps,
assert len(penv) == len(pcentre)
assert len(penv) == len(lat)
assert len(penv) == len(jdays)

poci_model = coeffs[0] + coeffs[1]*penv + coeffs[2]*pcentre \
+ coeffs[3]*pcentre*pcentre + coeffs[4]*lat*lat + \
coeffs[5]*np.cos(np.pi*2*jdays/365) + eps
Expand All @@ -716,9 +716,9 @@ def getPoci(penv, pcentre, lat, jdays, eps,
poci_model = np.nan
elif pcentre == missingValue:
poci_model = np.nan

return poci_model


def filterPressure(pressure, inputPressureUnits='hPa',
missingValue=sys.maxsize):
Expand Down

0 comments on commit ebc5372

Please sign in to comment.