From 838da34a71f8245c3cdf061e413464f51b3ff264 Mon Sep 17 00:00:00 2001 From: Craig Arthur Date: Tue, 2 Feb 2021 12:03:59 +1100 Subject: [PATCH] Confirm units of speed --- DataProcess/DataProcess.py | 10 +-- TrackGenerator/TrackGenerator.py | 12 ++-- Utilities/track.py | 2 +- docs/install.rst | 113 ++++++------------------------- 4 files changed, 33 insertions(+), 104 deletions(-) diff --git a/DataProcess/DataProcess.py b/DataProcess/DataProcess.py index 8c949139..91ea5ec4 100644 --- a/DataProcess/DataProcess.py +++ b/DataProcess/DataProcess.py @@ -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) @@ -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): diff --git a/TrackGenerator/TrackGenerator.py b/TrackGenerator/TrackGenerator.py index 4fd552f3..87af2e82 100644 --- a/TrackGenerator/TrackGenerator.py +++ b/TrackGenerator/TrackGenerator.py @@ -1293,7 +1293,7 @@ def dumpAllCellCoefficients(self): 'dtype': 'f', 'atts': { 'long_name': 'Mean forward speed', - 'units': 'm/s' + 'units': 'km/h' } }, 1: { @@ -1314,7 +1314,7 @@ def dumpAllCellCoefficients(self): 'dtype': 'f', 'atts': { 'long_name': 'Standard deviation forward speed', - 'units': 'm/s' + 'units': 'km/h' } }, 3: { @@ -1324,7 +1324,7 @@ def dumpAllCellCoefficients(self): 'dtype': 'f', 'atts': { 'long_name': 'Minimum forward speed', - 'units': 'm/s' + 'units': 'km/h' } }, 4: { @@ -1334,7 +1334,7 @@ def dumpAllCellCoefficients(self): 'dtype': 'f', 'atts': { 'long_name': 'Mean forward speed (over land)', - 'units': 'm/s' + 'units': 'km/h' } }, 5: { @@ -1356,7 +1356,7 @@ def dumpAllCellCoefficients(self): 'atts': { 'long_name': 'Standard deviation of forward' + ' speed (over land)', - 'units': 'm/s' + 'units': 'km/h' } }, 7: { @@ -1366,7 +1366,7 @@ def dumpAllCellCoefficients(self): 'dtype': 'f', 'atts': { 'long_name': 'Minimum forward speed (over land)', - 'units': 'm/s' + 'units': 'km/h' } }, 8: { diff --git a/Utilities/track.py b/Utilities/track.py index 2faa35ea..bdca9e97 100644 --- a/Utilities/track.py +++ b/Utilities/track.py @@ -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) diff --git a/docs/install.rst b/docs/install.rst index 1ff10d1d..880902e5 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -19,10 +19,13 @@ 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 `_. +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 `_ the repository. Submit a pull request to have your changes integrated into -TCRM. +TCRM. Read more about contribting_ to the TCRM code. .. _dependencies: @@ -30,7 +33,7 @@ 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 `_, installing a distribution such as `Python(x,y) package `_ @@ -59,23 +62,6 @@ please see the documentation for each individual library. * Parallel execution in multi-processor environments (with MPI installed) requires `mpi4py `_ -Using pip -~~~~~~~~~ - -If you have `pip `_ 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 ~~~~~~~~~~~~~~ @@ -98,6 +84,22 @@ The bash promt will look like (tcrm) user@server:~/tcrm$ +Using pip +~~~~~~~~~ + +If you have `pip `_ 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: @@ -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 -`_, installing a distribution -such as `Python(x,y) package `_ -(for Windows environments) or `Anaconda -`_ (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 -`_). - -For detailed instructions on installation of these dependencies, -please see the documentation for each individual library. - -* `Python `_ - v3.5 or later -* `Numpy `_ - v1.6 or later -* `Scipy `_ - v0.12 or later -* `Matplotlib `_ v1.2 or later. -* `Basemap `_ -* `netcdf4-python `_ - - version 1.0.8 or later -* `Shapely `_ - v1.2.15 or later -* `statsmodels `_ -* `seaborn `_ -* `pandas `_ -* `gitpython `_ -* Parallel execution in multi-processor environments (with MPI - installed) requires `mpi4py `_ - -Using pip -~~~~~~~~~ - -If you have `pip `_ 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