Difference between revisions of "Operations on tables"

From Dynamo
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Extraction of subtables==
 
== Extraction of subtables==
  
The basic command to choose elements inside a table is {{docfunction|dynamo_table_grep|dtgrep}}
+
The basic command to choose elements inside a table is {{docfunction|dynamo_table_grep|dtgrep}}. Commands are {{t|<}}, {{t|top}} and {{t|bottom}.
 +
 
 +
Other commands: {{docfunction|dynamo_table_split|dtsplit}}  
  
 
=== Selecting sets of tags===
 
=== Selecting sets of tags===
Line 13: Line 15:
 
===Excluding sets of tags===
 
===Excluding sets of tags===
  
In order to exclude a set of tags, use the flag{{t|exclude}}:
+
In order to exclude a set of tags, use the flag {{t|exclude}}:
  
 
<tt> tr = dtgrep(t,'exclude',[5,9,11:15]); </tt>
 
<tt> tr = dtgrep(t,'exclude',[5,9,11:15]); </tt>
Line 23: Line 25:
 
The flag {{t|tr}} (for ''table restriction'') allows operating restrictions on a table.  
 
The flag {{t|tr}} (for ''table restriction'') allows operating restrictions on a table.  
  
==== By property name===
+
==== By property name====
  
 
If you know the shortname of the property, you can use directly:
 
If you know the shortname of the property, you can use directly:
  
>> tRestricted = dtgrep(t,'tr','0.3<cc<0.5');
+
<<tt>> >> tRestricted = dtgrep(t,'tr','0.3<cc<0.5'); </tt>
  operator 0.3<cc<0.5 (#1) 100 before, 16 after
+
  <<tt>> operator 0.3<cc<0.5 (#1) 100 before, 16 after
  
==== By column number===
+
==== By column number====
>> tRestricted= dtgrep(t,'tr','0.3<&10<0.5');
+
<<tt>> >> tRestricted= dtgrep(t,'tr','0.3<&10<0.5'); </tt>
  operator 0.3<cc<0.5 (#1) 100 before, 16 after
+
  <<tt>> operator 0.3<cc<0.5 (#1) 100 before, 16 after
  
 +
==== Top and bottom hits ====
 +
The flag {{t|tr}} allows selection of the tags that score best or worst for a given property, with syntax
 +
 +
  <tt> <property>[top]<number>  or  <property>[bottom]<number> </tt>
 +
 +
where <tt><property><tt> can be given as column number preceded by {{t|&}}, or by column name:
 +
 +
  <tt>  dtgrep example.tbl -tr &10[top]25 -o output.tbl </tt>
 +
  <tt>  dtgrep example.tbl -tr cc[top]25 -o output.tbl </tt>
 +
 +
both selects the 25 best particles (according to the cc coded in column 10) in table {{t| example.tbl}} and writes the subtable in file {{t|output.tbl}}.
  
 
==Geometrical operations on tables==
 
==Geometrical operations on tables==
 
+
Rigid body operations can be applied onto tables with {{t|dynamo_rigid_apply}} or {{dynamo_table_rotate}}
Rigid body operations can be applied onto tables with {{t|dynamo_rigid_apply}}.
 

Latest revision as of 10:35, 23 May 2016

Extraction of subtables

The basic command to choose elements inside a table is dtgrep. Commands are <, top and {{t|bottom}.

Other commands: dtsplit

Selecting sets of tags

In order to create a subtable with a predefined set of tags, use the flagtags:

tr = dtgrep(t,'tags',[5,9,11:15]);

would explore the table t and create the output table tr, including only the tags 5,9, 11:15.

Excluding sets of tags

In order to exclude a set of tags, use the flag exclude:

tr = dtgrep(t,'exclude',[5,9,11:15]);

would explore the table t and create the output table tr, excluding any rows with tags 5,9, 11:15.

Selecting subtables by property

The flag tr (for table restriction) allows operating restrictions on a table.

By property name

If you know the shortname of the property, you can use directly:

<> >> tRestricted = dtgrep(t,'tr','0.3<cc<0.5'); 
<> operator 0.3<cc<0.5 (#1) 100 before, 16 after

By column number

<> >> tRestricted= dtgrep(t,'tr','0.3<&10<0.5'); 
<> operator 0.3<cc<0.5 (#1) 100 before, 16 after

Top and bottom hits

The flag tr allows selection of the tags that score best or worst for a given property, with syntax

  <property>[top]<number>   or  <property>[bottom]<number> 

where <property> can be given as column number preceded by &, or by column name:

   dtgrep example.tbl -tr &10[top]25 -o output.tbl 
   dtgrep example.tbl -tr cc[top]25 -o output.tbl 

both selects the 25 best particles (according to the cc coded in column 10) in table example.tbl and writes the subtable in file output.tbl.

Geometrical operations on tables

Rigid body operations can be applied onto tables with dynamo_rigid_apply or Template:Dynamo table rotate