Skip to content

Commit

Permalink
Confirm units of speed
Browse files Browse the repository at this point in the history
  • Loading branch information
wcarthur committed Feb 2, 2021
1 parent 68b65a3 commit 838da34
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 104 deletions.
10 changes: 5 additions & 5 deletions DataProcess/DataProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ def _speed(self, dist, dt, indicator, initIndex):
"""
Extract speeds for all obs, initial obs and TC origins
Input: dist - array of distances between consecutive TC
observations
dt - array of times between consecutive TC observations
observations (km)
dt - array of times between consecutive TC observations (hours)
indicator - array of ones/zeros representing initial TC
observations (including TCs with a single
observation)
Expand Down Expand Up @@ -499,17 +499,17 @@ def _speed(self, dist, dt, indicator, initIndex):
speed_no_init = pjoin(self.processPath, 'speed_no_init')
# Extract all speeds
self.logger.debug('Outputting data into {0}'.format(all_speed))
header = 'all cyclone speed in m/s'
header = 'all cyclone speed in km/h'
flSaveFile(all_speed, speed, header, fmt='%6.2f')

# Extract initial speeds
self.logger.debug('Outputting data into {0}'.format(init_speed))
header = 'initial cyclone speed in m/s'
header = 'initial cyclone speed in km/h'
flSaveFile(init_speed, initSpeed, header, fmt='%f')

# Extract speeds, excluding initial speeds
self.logger.debug('Outputting data into {0}'.format(speed_no_init))
header = 'cyclone speed without initial ones in m/s'
header = 'cyclone speed without initial ones in km/h'
flSaveFile(speed_no_init, speedNoInit, header, fmt='%6.2f')

def _pressure(self, pressure, indicator):
Expand Down
12 changes: 6 additions & 6 deletions TrackGenerator/TrackGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ def dumpAllCellCoefficients(self):
'dtype': 'f',
'atts': {
'long_name': 'Mean forward speed',
'units': 'm/s'
'units': 'km/h'
}
},
1: {
Expand All @@ -1314,7 +1314,7 @@ def dumpAllCellCoefficients(self):
'dtype': 'f',
'atts': {
'long_name': 'Standard deviation forward speed',
'units': 'm/s'
'units': 'km/h'
}
},
3: {
Expand All @@ -1324,7 +1324,7 @@ def dumpAllCellCoefficients(self):
'dtype': 'f',
'atts': {
'long_name': 'Minimum forward speed',
'units': 'm/s'
'units': 'km/h'
}
},
4: {
Expand All @@ -1334,7 +1334,7 @@ def dumpAllCellCoefficients(self):
'dtype': 'f',
'atts': {
'long_name': 'Mean forward speed (over land)',
'units': 'm/s'
'units': 'km/h'
}
},
5: {
Expand All @@ -1356,7 +1356,7 @@ def dumpAllCellCoefficients(self):
'atts': {
'long_name': 'Standard deviation of forward' +
' speed (over land)',
'units': 'm/s'
'units': 'km/h'
}
},
7: {
Expand All @@ -1366,7 +1366,7 @@ def dumpAllCellCoefficients(self):
'dtype': 'f',
'atts': {
'long_name': 'Minimum forward speed (over land)',
'units': 'm/s'
'units': 'km/h'
}
},
8: {
Expand Down
2 changes: 1 addition & 1 deletion Utilities/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def ncSaveTracks(trackfile, tracks,
tvar.lon_units = 'degrees east'
tvar.lat_units = 'degrees north'
tvar.pressure_units = 'hPa'
tvar.speed_units = 'm/s'
tvar.speed_units = 'km/h'
tvar.length_units = 'km'
tvar.trackId = repr(t.trackId)

Expand Down
113 changes: 21 additions & 92 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ For users wanting to only run the code, a zip file or gzipped tar file
of the latest releases can be downloaded from the `Releases page
<https://github.com/GeoscienceAustralia/tcrm/releases>`_.

To have access to the latest updates, users should clone the repository, and
then regularly pull from the repository as updates are made.

Those wanting to contribute to development can `fork
<https://github.com/GeoscienceAustralia/tcrm/fork>`_ the
repository. Submit a pull request to have your changes integrated into
TCRM.
TCRM. Read more about contribting_ to the TCRM code.

.. _dependencies:

Dependencies
------------

TCRM relies on a number of additional libraries that are not part of
the standard library. There are several ways to obtain the required
the standard Pyhton library. There are several ways to obtain the required
libraries -- using Python's recommended tool `pip
<https://pip.readthedocs.org/en/latest/>`_, installing a distribution
such as `Python(x,y) package <http://code.google.com/p/pythonxy/>`_
Expand Down Expand Up @@ -59,23 +62,6 @@ please see the documentation for each individual library.
* Parallel execution in multi-processor environments (with MPI
installed) requires `mpi4py <https://mpi4py.readthedocs.io/>`_

Using pip
~~~~~~~~~

If you have `pip <https://pip.readthedocs.org/en/latest/>`_ installed,
the required modules can be installed using the following command,
executed in the main TCRM directory

.. code-block:: bash
pip -v install -r requirements.txt
This will automatically build the required libraries (listed in the
``requirements.txt`` file) and any dependencies. ``pip`` must be on
the ``$PATH`` for this to work.

.. _compilation:


Using Anaconda
~~~~~~~~~~~~~~
Expand All @@ -98,6 +84,22 @@ The bash promt will look like
(tcrm) user@server:~/tcrm$
Using pip
~~~~~~~~~

If you have `pip <https://pip.readthedocs.org/en/latest/>`_ installed,
the required modules can be installed using the following command,
executed in the main TCRM directory

.. code-block:: bash
pip -v install -r requirements.txt
This will automatically build the required libraries (listed in the
``requirements.txt`` file) and any dependencies. ``pip`` must be on
the ``$PATH`` for this to work.



.. _environment:

Expand Down Expand Up @@ -140,79 +142,6 @@ CSH/TCSH shell
setenv PYTHONPATH $PYTHONPATH:/path/to/tcrm:/path/to/tcrm/Utilities
.. _dependencies:

Dependencies
------------

TCRM relies on a number of additional libraries that are not part of
the standard library. There are several ways to obtain the required
libraries -- using Python's recommended tool `pip
<https://pip.readthedocs.org/en/latest/>`_, installing a distribution
such as `Python(x,y) package <http://code.google.com/p/pythonxy/>`_
(for Windows environments) or `Anaconda
<https://www.anaconda.com/distribution/#download-section>`_ (cross-platform), or
installing the libraries from source or binary installers
(pre-compiled binary Windows installer versions for all the libraries
(both 32-bit and 64-bit) can be obtained `here
<http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_).

For detailed instructions on installation of these dependencies,
please see the documentation for each individual library.

* `Python <https://www.python.org/>`_ - v3.5 or later
* `Numpy <http://www.numpy.org/>`_ - v1.6 or later
* `Scipy <http://www.scipy.org/>`_ - v0.12 or later
* `Matplotlib <http://matplotlib.org/>`_ v1.2 or later.
* `Basemap <http://matplotlib.org/basemap/index.html>`_
* `netcdf4-python <https://code.google.com/p/netcdf4-python/>`_ -
version 1.0.8 or later
* `Shapely <http://toblerity.org/shapely/index.html>`_ - v1.2.15 or later
* `statsmodels <http://statsmodels.sourceforge.net>`_
* `seaborn <http://seaborn.pydata.org>`_
* `pandas <http://pandas.pydata.org>`_
* `gitpython <http://gitpython.readthedocs.org>`_
* Parallel execution in multi-processor environments (with MPI
installed) requires `mpi4py <https://mpi4py.readthedocs.io/>`_

Using pip
~~~~~~~~~

If you have `pip <https://pip.readthedocs.org/en/latest/>`_ installed,
the required modules can be installed using the following command,
executed in the main TCRM directory

.. code-block:: bash
pip -v install -r requirements.txt
This will automatically build the required libraries (listed in the
``requirements.txt`` file) and any dependencies. ``pip`` must be on
the ``$PATH`` for this to work.


Using Anaconda
~~~~~~~~~~~~~~

To install ``tcrm``, make a new environment:

.. code-block:: bash
conda env create -f tcrmenv.yml
After creating the environment the user needs to move to that environment using the command

.. code-block:: bash
conda activate tcrm
The bash promt will look like

.. code-block::
(tcrm) user@server:~/tcrm$
.. _compilation:

Windows
Expand Down

0 comments on commit 838da34

Please sign in to comment.