Skip to content

Commit

Permalink
Bring issue_25 branch up to date with v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wcarthur committed Aug 29, 2017
2 parents f85d3b7 + 33234a8 commit d8690c8
Show file tree
Hide file tree
Showing 16 changed files with 834 additions and 122 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Expand Up @@ -16,7 +16,6 @@ addons:
- libgcc1
- libgfortran3
- liblapack3gf
- libumfpack5.4.0
- libstdc++6
install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
Expand All @@ -33,6 +32,10 @@ install:
- pip install pycurl
- pip -v install -r requirements.txt
- pip install coveralls
branches:
except:
- config
- notebooks
script:
- python installer/setup.py build_ext -i
- nosetests -v --with-coverage
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = ../tcrmdocs
BUILDDIR = ../tcrm-docs

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand Down
13 changes: 11 additions & 2 deletions TrackGenerator/TrackGenerator.py
Expand Up @@ -518,11 +518,20 @@ def validSize(track):
"""
:return: True if all rmax values are > 5.0 km, False otherwise.
"""
return all(track.rMax > 5.)

if any(track.rMax > 500.):
log.warn("Found a track with rMax > 500 km")
log.warn("Track id: {0}-{1}".format(*track.trackId))
return (all(track.rMax > 5.) and all(track.rMax < 500.))

def validInitSize(track):
return track.rMax[0] < 100.

def validInitPressure(track):
if track.EnvPressure[0] - track.CentralPressure[0] < 1.0:
log.critical("Initial pressure difference too small")
return (track.EnvPressure[0] - track.CentralPressure[0] > 1.0)

log.debug('Generating %d tropical cyclone tracks', nTracks)
genesisYear = int(uniform(1900, 9998))
results = []
Expand Down Expand Up @@ -669,7 +678,7 @@ def validInitSize(track):
track = Track(data)
track.trackId = (j, simId)

if not (empty(track) or diedEarly(track)) \
if not (empty(track) or diedEarly(track)) and validInitPressure(track) \
and validPressures(track) and validSize(track) and validInitSize(track):
if self.innerGridLimit and not insideDomain(track):
log.debug("Track exits inner grid limit - rejecting")
Expand Down
2 changes: 1 addition & 1 deletion Utilities/track.py
Expand Up @@ -120,7 +120,7 @@ def inRegion(self, gridLimit):
yMax = gridLimit['yMax']

return ((xMin <= np.min(self.Longitude)) and
(np.max(self.Latitude) <= xMax) and
(np.max(self.Longitude) <= xMax) and
(yMin <= np.min(self.Latitude)) and
(np.max(self.Latitude) <= yMax))

Expand Down

0 comments on commit d8690c8

Please sign in to comment.