Skip to content
Pete Bachant edited this page Apr 21, 2016 · 36 revisions

Welcome to the wiki for the 1:6 scale model RM2 experiments performed with the UNH-CORE turbine test bed. This page describes how to use the RM2 dataset using its Python package.

Getting started

See the experimental repository's README.md for necessary software dependencies and how to install these.

Downloading (cloning) to local machine

The experiment repository ("repo") may be cloned via Git with

git clone https://github.com/UNH-CORE/RM2-tow-tank.git

or downloaded as a ZIP file from https://github.com/UNH-CORE/RM2-tow-tank/archive/master.zip. The benefit of using Git is that all changes to the processed data or code can be pulled in automatically with git pull origin master, without having to re-download and unzip the entire repository.

Generating figures

  1. Open a terminal or command prompt in the experiment root directory.
  2. Execute python plot.py -h to see plotting script options.

To generate and save all figures without opening them in new windows, execute

python plot.py --all --save --no-show

Generating figures for a different project

The plotting module inside the experiment's pyrm2tt Python package can be used to generate plots elsewhere, e.g., if running in a Jupyter Notebook, IPython shell, or Jupyter Qt Console. In the example below, the performance coefficient curve is plotted at a tow speed of 1.0 m/s, with the assumption that the user is working in a different directory (notebook_dir).

import os

# Define some paths
notebook_dir = "C:/Users/Frank/Notebooks/RM2-numerical-modeling"
rm2_dir = "C:/Users/Frank/Experiments/RM2-tow-tank"

# Move into the experiment directory
os.chdir(rm2_dir)

# Import the experiment's plotting module
import pyrm2tt.plotting

# Create an instance of a performance curve object and plot C_P
pc = pyrm2tt.plotting.PerfCurve(tow_speed=1.0)
pc.plotcp(marker="o")

# Move back into the notebook directory
os.chdir(notebook_dir)

# View the performance curve C_P data as a table
print(pc.df.mean_cp)

Working with the data

The experiment repo includes all the code used to process and visualize the data inside of a Python package called pyrm2tt, which contains processing and plotting modules. The best way to figure out how these work is to look at the functions called in the top level plot.py and process.py scripts. Inside the pyrm2tt.processing module there is a Run class, which encapsulates the data from an individual tow, and includes all the methods used to load the raw data, extract the quasi-steady duration, compute statistics, etc. Note that to import and use the Python package, you must be running inside the experiment root directory.

Examples

Access the instantaneous power coefficient time series of run 12 from the Perf-1.0 test matrix section:

from pyrm2tt.processing import Run

run = Run("Perf-1.0", 12)
cp = run.cp

Contributing

Upgrades and bug fixes can be submitted via pull request on GitHub. The steps to submitting a pull request are:

  1. Fork the experiment repo using the button on the GitHub website: fork
  2. Clone the forked repo locally.
  3. Checkout a new branch with a name representing the proposed change, e.g., git checkout -b analyze-new-thing.
  4. Commit some changes and push them up to the new branch on GitHub.
  5. Visit the forked repo on GitHub, and click the "pull request" button. In the form, describe the proposed changes.
  6. The repository maintainers will review the pull request, and suggest modifications if necessary. The pull request can be automatically updated by pushing up to the appropriate branch.

Issues, feature requests, and questions

To report issues, suggest enhancements, or even to simply ask questions, use the project's issue tracker on GitHub: https://github.com/UNH-CORE/RM2-tow-tank/issues. This issue tracker also serves as a public forum for discussing the results and ideas for new analyses.

Clone this wiki locally