yfournier created page: get started authored by Yori Fournier's avatar Yori Fournier
# Install the template module
* (Install the module mypltemplate)[https://gitlab.aip.de/yfournier/mypltemplate/wikis/get-started#install-the-module-mypltemplate]
* (Plotting some Examples)[https://gitlab.aip.de/yfournier/mypltemplate/wikis/get-started#plotting-some-examples]
# Install the module mypltemplate
> **NOTES:** STEP 3 has two version with and without an account at gitlab.aip.de
......@@ -47,61 +51,64 @@ This will execute a series of tests, they should all be successful.
Now you can start to enjoy the power of `myplotlib`
# Plotting the interactively some Exemples
---- STEP 1: launch python2.7
# Plotting some Examples
>$ python2.7
## STEP 1: launch python2.7
---- STEP 2: Import the module.
```
python2.7
```
>>> # IMPORT the MODULE
>>> from mymodule import *
## STEP 2: Import the module.
This imports all variables, functions and classes from "mymodule/__init__.py"
```python
# IMPORT the MODULE
from mymodule import *
```
This imports all variables, functions and classes from `mymodule/__init__.py`
---- STEP 3: Open and Access some data
## STEP 3: Open and Access some data
The template modules has some dummy data for demonstration in "mymodule/data"
The template modules has some dummy data for demonstration in `mymodule/data`
This data are of two type:
- some structured data set (run1.txt, run2.txt, ...)
- some database (serie1.txt, serie2.txt)
- some **structured datasets** (run1.txt, run2.txt, ...)
- some **database-like datasets** (serie1.txt, serie2.txt)
In python (this is a general remark) it exists two powerful objects for
storing and accessing these types of data.
- for structured data sets the python dictionaries are suitable (https://docs.python.org/2/tutorial/datastructures.html#dictionaries)
- for database data sets the numpy.recarray are the perfect tool (https://docs.scipy.org/doc/numpy/reference/generated/numpy.recarray.html)
- for **structured datasets** the python **dictionaries** are suitable [doc](https://docs.python.org/2/tutorial/datastructures.html#dictionaries)
- for **database-like datasets** the **numpy.recarray** are the perfect tool [doc](https://docs.scipy.org/doc/numpy/reference/generated/numpy.recarray.html)
In "mymodule/myIOs" are two files containing the functions readRun, and readSeries
- the function readRun reads a run-text-file (structured data set) and stores the information into a python dictionary.
- the function readSeries reads a series-text-file (database data set) and stores the data into a numpy recarray.
In `mymodule/myIOs` are two files containing the functions `readRun`, and `readSeries`
- the function `readRun` reads a run-text-file (structured data set) and stores the information into a python dictionary.
- the function `readSeries` reads a series-text-file (database data set) and stores the data into a numpy recarray.
Both function returns the data container of myplotlib, MyData
Both function returns the data container of myplotlib, `MyData`
>>> # READ Some data
>>> run1 = readRun('./mymodule/data/serie1/run1.txt')
you can now type
>>> run1
it will return:
```python
# READ Some data
run1 = readRun('./mymodule/data/serie1/run1.txt')
```
now you can now type
```python
run1
>>> <mymodule.myplotlib.myData.MyData instance at ...>
```
as you can see the object run1 is an object of type MyData. The ... shows the address of these object in the memory
this identifier is unique for any instance (again this is a general remark for python)
Now you can call
As you can see the object `run1` is an instance of type `MyData`. The `...` shows the address of the instance in the memory.
This identifier is unique (again this is a general remark for python).
>>> run1.data['name']
>>> run1.data['input1']
>>> run1.data['results']
Now you can access the name of the run, the vaue of input1 or the matrix of the results by simply typing:
```python
run1.data['name']
run1.data['input1']
run1.data['results']
...
```
---- STEP 4: Visualising some RUN data
......
......