Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
brivas
mdf_reader
Commits
461b8cc9
Commit
461b8cc9
authored
5 years ago
by
Irene Perez Gonzalez
Browse files
Options
Download
Email Patches
Plain Diff
Updated
parent
d01a68b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
53 deletions
+8
-53
README.md
README.md
+8
-53
No files found.
README.md
View file @
461b8cc9
A. Get code from GitHub
Download zip from https://github.com/perezgonzalez-irene/mdf_reader.git
Clone repo: git clone https://github.com/perezgonzalez-irene/mdf_reader.git
B. Create
\_
___init__
__
.py in code parent directory so python treats it as containing a package
touch
\_
___init__
__
.py
C. Create python3 virtual environment in code directory
(1) cd mdf_reader
(2) Create environment
local:
python3 -m virtualenv --system-site-packages myenv
jasmin: (python3 still not default/operative, but following works)
1. Set path and activate conda environment
export PATH=/apps/contrib/jaspy/miniconda_envs/jaspy3.7/m3-4.5.11/bin:$PATH
source activate jaspy3.7-m3-4.5.11-r20181219
2. Create your own virtualenv - you only do this once!
virtualenv --system-site-packages myenv
(3) Activate environment:
source ./myenv/bin/activate
(4) Install specific package versions:
pip install -r requirements.txt
To deactivate environment:
deactivate
D. Add module parent directory to python path (PYTHONPATH env variable)
-
from terminal:
export PYTHONPATH=$toolParentDirectory:${PYTHONPATH}
-
In python:
import sys
sys.path.append(toolParentDirectory)
E. Run a test:
1.
Run a test:
import mdf_reader
import matplotlib.pyplot as plt
data = mdf_reader.tests.imma1_buoys_nosupp()
data = mdf_reader.tests.
read_
imma1_buoys_nosupp()
data = mdf_reader.tests.imma1_buoys_supp()
data = td11_deck187_nosupp()
data = mdf_reader.tests.read_imma1_buoys_supp()
ax = data
[
section_name
][
field_name
]
.plot(label='x')
data
[
section_name
][
field_name
]
.plot(ax = ax ,label='y')
....
plt.show()
2.
Read imma data
imma_data = mdf_reader.read(filepath, data_model = 'imma1',sections = ['core','c1','c98'])
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment