36
The First LTPDA Training Session - Topic 1 M Hewitson +----------------------------------------------------+ | | | | | **** | | ** | | ------------- | | //// / \\\\ | | /// / \\\ | | | / | | | ** | +----+ / +----+ | ** | | ***| | |//-------| | |*** | | ** | +----+ /+----+ | ** | | | / | | | \\\ / /// | | \\\\ // //// | | ------------- | | ** | | **** | | | | Welcome to LTPDA Toolbox | | | | Version: 1.9.3 | | Release: (R2008b) | | Date: 19-10-08 | | | +----------------------------------------------------+

The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Topic 1

M Hewitson+----------------------------------------------------+| || || **** || ** || ------------- || //// / \\\\ || /// / \\\ || | / | || ** | +----+ / +----+ | ** || ***| | |//-------| | |*** || ** | +----+ /+----+ | ** || | / | || \\\ / /// || \\\\ // //// || ------------- || ** || **** || || Welcome to LTPDA Toolbox || || Version: 1.9.3 || Release: (R2008b) || Date: 19-10-08 || |+----------------------------------------------------+

Page 2: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Introducing Analysis Objects (AOs)

•An AO contains more than just data

2

Analysis Object

Numerical

Data

Provenance

Processing

history

Additional

meta-data

- creator

- date

- IP address

- Hostname

- Operating System

- software versions

- Name

- ID number

- Comment

- pipeline file(s)

- Name

- Algorithm version

- Parameter list

- Creation date/time

- Input histories

- Name

- Numerical data

vectors

- Creation date/time

- Additional flags

Page 3: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

History

3

traceable results

Input

AO

Output

AO(s)

Input

AO

Algorithmic step

input

history

input

history

Algorithm

history

Intelligent algorithms

Page 4: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

History tree

4

ao

Page 5: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

History tree

4

ao

name

history

version

data

Page 6: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

History tree

4

ao

name

history

version

data

name

input histories

version

params

Page 7: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

History tree

4

ao

name

history

version

data

name

input histories

version

params

name

input histories

version

params

Page 8: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

History tree

4

ao

name

history

version

data

name

input histories

version

params

name

input histories

version

params

name

input histories

version

params

Page 9: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

History tree

4

ao

name

history

version

data

name

input histories

version

params

name

input histories

version

params

name

input histories

version

params

Page 10: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Viewing history

5

Page 11: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Reliving history

6

obj.type(<file>)output commands needed to rebuild this object

robj = obj.rebuildrebuild this object

Page 12: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

LTPDA User Objects

•Not only AOs behave in this way:

7

pzmodel

parfrac

rational

ssm

miir

mfir

timespan

plist

Page 13: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Page 14: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Page 15: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Properties:

Page 16: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Properties: color

Page 17: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Properties: colorengine size

Page 18: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Properties: colorengine sizecost

Page 19: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Properties: colorengine sizecost

Methods:

Page 20: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Properties: colorengine sizecost

Methods: start

Page 21: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Properties: colorengine sizecost

Methods: startstop

Page 22: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

Car

Properties: colorengine sizecost

Methods: startstopdrive

Page 23: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

object = instance of a classCar

Properties: colorengine sizecost

Methods: startstopdrive

Page 24: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

object = instance of a class

car1 = Car(‘blue’)car2 = Car(‘red’)

Car

Properties: colorengine sizecost

Methods: startstopdrive

Page 25: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

object = instance of a class

car1 = Car(‘blue’)car2 = Car(‘red’)

objects

Car

Properties: colorengine sizecost

Methods: startstopdrive

Page 26: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

object = instance of a class

car1 = Car(‘blue’)car2 = Car(‘red’)

objects constructors

Car

Properties: colorengine sizecost

Methods: startstopdrive

Page 27: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Object-oriented programming for beginners

8

object = instance of a class

car1 = Car(‘blue’)car2 = Car(‘red’)

objects constructors

Car

Properties: colorengine sizecost

Methods: startstopdrive

car1.startcar1.drivestop(car1)

Page 28: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Exercise 1

•Now it’s your turn•Open the MATLAB documentation

•In the MATLAB terminal• >> doc

•“Help -> Product Help>”•Go to section:

•LTPDA Toolbox• LTPDA Training Session 1

• Topic 1• Making AOs

•And work your way through •“Exercise 1 - Your First Analysis Object”

9

Page 29: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Exercise 2 - setting object properties

•AOs have properties, e.g.,•name•description

•Work through: •Exercise 2 - Setting properties of AOs

10

>> a.setName('Bob')

Page 30: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Exercise 3 - Viewing the history

•We saw earlier that AOs store their processing history.•Here we learn how to view that history•Work through the section

•Exercise 3 - Viewing the history

11

Page 31: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Exercise 4 - Making Time-series AOs

•AOs can contain different types of data•Time-series data are stored in a tsdata object•They also have properties:

•Work through section:•Topic 1

• Making a time-series AO

12

tsdata

t0Absolute time-stamp of first sample

xunits X-axis units

yunits Y-axis units

Page 32: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Basic Math

•You can operate on AOs using a large set of methods•In particular, many typical Math operations are available

(overloaded)• Further details at: http://www.lisa.aei-hannover.de/ltpda/

documents/files/operator_rules.pdf•Work through the help section

•Topic 1• Basic Math with AOs

13

Page 33: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Saving and loading AOs

•All LTPDA User Objects can be saved to (and loaded from), file in•XML format•binary MAT format

•Work through help section•Topic 1

• Saving and loading AOs

14

<?xml version="1.0" encoding="utf-8"?><ltpda_object ltpda_version="2.0 (R2008b)"> <object shape="1x1" type="ao"> <property prop_name="data" shape="1x1" type="fsdata"> <object shape="1x1" type="fsdata"> <property prop_name="t0" shape="1x1" type="time"> <object shape="1x1" type="time"> <property prop_name="utc_epoch_milli" shape="1x1" type="double">0</property> <property prop_name="timezone" shape="1x1" type="sun.util.calendar.ZoneInfo">Greenwich</property> <property prop_name="timeformat" shape="1x23" type="char">yyyy-mm-dd HH:MM:SS.FFF</property> <property prop_name="time_str" shape="0x0" type="char"/> <property prop_name="version" shape="1x53" type="char">$Id: time.m,v 1.65 2009/01/25 09:51:55 hewitson Exp $</property> </object> </property> <property prop_name="navs" shape="1x1" type="double">1</property> <property prop_name="fs" shape="1x1" type="double">1000</property> <property prop_name="enbw" shape="1x1" type="double">0.20043999999999998</property> <property prop_name="version" shape="1x55" type="char">$Id: fsdata.m,v 1.43 2008/10/27 15:13:45 hewitson Exp $</property> <property prop_name="xunits" shape="1x1" type="unit"> <object shape="1x1" type="unit"> <property prop_name="strs" shape="1x1" type="cell">

Page 34: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Reading data files

•You can construct AOs from existing ASCII (raw) data files•Work through help section

•Topic 1• Constructing AOs from data files

15

a = ao('topic1/simpleASCII.txt')

Page 35: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

Writing LTPDA scripts

•So far we’ve done everything on the command-line or on the workbench

•Now we look at writing LTPDA scripts•There are some subtle differences to standard MATLAB scripts

and some recommended practices•Read through help section

•Topic 1• Writing LTPDA scripts

•** More details on the tfe method later

16

%% Make two test AOs a1 = ao(plist('tsfcn', 'randn(size(t))'a2 = ao(plist('tsfcn', 'randn(size(t))' %% Make TFE with multiple outputs [t11, t21, t12, t22] = tfe(a1,a2);Axx = t12 ./ t21; %% Make TFE then index with () txx = tfe(a1,a2);Axx = txx(1,2) ./ txx(2,1); % <-- BREAKS THE HISTORY %% Use index method txx = tfe(a1,a2);Axx = txx.index(1,2) ./ txx.index(2,1);

Page 36: The First LTPDA Training Session - Topic 1...2009/01/25  · The First LTPDA Training Session - Introduction Writing LTPDA scripts •So far we’ve done everything on the command-line

The First LTPDA Training Session - Introduction

IFO/Temperature example

•We have a data analysis exercise which will develop fully over the course of the training session

•This is the first part: reading and preparing the data•Work through help section

•Topic 1• IFO/Temperature Example - Introduction

17