Project

General

Profile

« Previous | Next » 

Revision 5139

Added by daigle about 15 years ago

Fix errors in workflow scheduler unit test

View differences:

test/clienttestfiles/tpc02-water-flow-base.xml
1
<?xml version="1.0"?>
2
<entity name="tpc02-water-flow-base" class="org.kepler.moml.CompositeClassEntity">
3
<property name="entityId"  value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:888:40:1" class="org.kepler.moml.NamedObjId"/>
4
<property name="class" value="ptolemy.actor.TypedCompositeActor" class="ptolemy.kernel.util.StringAttribute">
5
  <property name="id" value="null" class="ptolemy.kernel.util.StringAttribute"/>
6
</property>
7

  
8

  
9

  
10
<property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
11
</property>
12

  
13
<property name="SDF Director" class="ptolemy.domains.sdf.kernel.SDFDirector">
14
    <property name="iterations" class="ptolemy.data.expr.Parameter" value="1">
15
    </property>
16
    <property name="vectorizationFactor" class="ptolemy.data.expr.Parameter" value="1">
17
    </property>
18
    <property name="allowDisconnectedGraphs" class="ptolemy.data.expr.Parameter" value="true">
19
    </property>
20
    <property name="allowRateChanges" class="ptolemy.data.expr.Parameter" value="false">
21
    </property>
22
    <property name="constrainBufferSizes" class="ptolemy.data.expr.Parameter" value="true">
23
    </property>
24
    <property name="period" class="ptolemy.data.expr.Parameter" value="0.0">
25
    </property>
26
    <property name="synchronizeToRealTime" class="ptolemy.data.expr.Parameter" value="false">
27
    </property>
28
    <property name="timeResolution" class="ptolemy.actor.parameters.SharedParameter" value="1E-10">
29
    </property>
30
    <property name="Scheduler" class="ptolemy.domains.sdf.kernel.SDFScheduler">
31
        <property name="constrainBufferSizes" class="ptolemy.data.expr.Parameter" value="constrainBufferSizes">
32
        </property>
33
    </property>
34
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
35
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
36
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Steve Neuendorffer</configure></property>
37
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
38
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&#10;&lt;p&gt;The SDF Director is often used to oversee fairly simple, sequential workflows in which the director can determine the order of actor invocation from the workflow. Types of workflows that would run well under an SDF Director include processing and reformatting tabular data, converting one data type to another, and reading and plotting a series of data points. A workflow in which an image is read, processed (rotated, scaled, clipped, filtered, etc.), and then displayed, is also an example of a sequential workflow that requires a director simply to ensure that each actor fires in the proper order (i.e., that each actor executes only after it receives its required inputs).&lt;/p&gt;&#10;&#10;&lt;p&gt;The SDF Director is very efficient and will not tax system resources with overhead. However, this efficiency requires that certain conditions be met, namely that the data consumption and production rate of each actor in an SDF workflow be constant and declared. If an actor reads one piece of data and calculates and outputs a single result, it must always read and output a single token of data. This data rate cannot change during workflow execution and, in general, workflows that require dynamic scheduling and/or flow control cannot use this director. Additionally, the SDF Director has no understanding of passing time (at least by default), and actors that depend on a notion of time may not work as expected. For example, a TimedPlotter actor will plot all values at time zero when used in SDF. &lt;/p&gt;&#10;&#10;&lt;p&gt;By default, the SDF Director requires that all actors in its workflow be connected. Otherwise, the director cannot account for concurrency between disconnected workflow parts. Usually, a PN Director should be used for workflows that contain disconnected actors; however, the SDF Director's allowDisconnectedGraphs parameter may also be set to true. The SDF Director will then schedule each disconnected &quot;island&quot; independently. The director cannot infer the sequential relationship between disconnected actors (i.e., nothing forces the director to finish executing all actors on one island before firing actors on another). However, the order of execution within each island should be correct. Usually, disconnected graphs in an SDF model indicate an error.&lt;/p&gt;&#10; &#10;&lt;p&gt;Because SDF Directors schedule actors to fire only after they receive their inputs, workflows that require loops (feeding an actor's output back into its input port for further processing) can cause &quot;deadlock&quot; errors. The deadlock errors occur because the actor depends on its own output value as an initial input. To fix this problem, use a SampleDelay actor to generate and inject an initial input value into the workflow.&lt;/p&gt;&#10;&#10;&lt;p&gt;The SDF Director determines the order in which actors execute and how many times each actor needs to be fired to complete a single iteration of the workflow. This schedule is calculated BEFORE the director begins to iterate the workflow. Because the SDF Director calculates a schedule in advance, it is quite efficient. However, SDF workflows must be static. In other words, the same number of tokens must be consumed/produced at every iteration of the workflow. Workflows that require dynamic control structures, such as a BooleanSwitch actor that sends output on one of two ports depending on the value of a 'control', cannot be used with an SDF Director because the number of tokens on each output can change for each execution.&lt;/p&gt;&#10;&#10;&lt;p&gt;Unless otherwise specified, the SDF Director assumes that each actor consumes and produces exactly one token per channel on each firing. Actors that do not follow the one-token-per-channel firing convention (e.g., Repeat or Ramp) must declare the number of tokens they produce or consume via the appropriate parameters. &lt;/p&gt;&#10;&#10;&lt;p&gt;The number of times a workflow is iterated is controlled by the director's iterations parameter. By default, this parameter is set to &quot;0&quot;. Note that &quot;0&quot; does not mean &quot;no iterations.&quot; Rather, &quot;0&quot; means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. A value of 1, meaning that the director will run the workflow once, is often the best setting when building an SDF workflow. &lt;/p&gt;&#10;&#10;&lt;p&gt;The amount of data processed by an SDF workflow is a function of both the number of times the workflow iterates and the value of the director's vectorizationFactor parameter. The vectorizationFactor is used to increase the efficiency of a workflow by increasing the number of times actors fire each time the workflow iterates. If the parameter is set to a positive integer (other than 1), the director will fire each actor the specified number of times more than normal. The default is 1, indicating that no vectorization should be performed. Keep in mind that changing the vectorizationFactor parameter changes the meaning of a nested SDF workflow and may cause deadlock in a workflow that uses it. &lt;/p&gt;&#10;&#10;&lt;p&gt;The SDF Director has several advanced parameters that are generally only relevant when an SDF workflow contains composite components. In most cases the period, timeResolution, synchronizeToRealTime, allowRateChanges, timeResolution, and constrainBufferSizes parameters can be left at their default values.&lt;/p&gt;&#10;&#10;&lt;p&gt;For more information about the SDF Director, see the Ptolemy documentation (http://ptolemy.eecs.berkeley.edu/papers/05/ptIIdesign3-domains/ptIIdesign3-domains.pdf).&lt;/p&gt;&#10;&#10;</configure></property>
39
<property name="prop:allowDisconnectedGraphs" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether to allow disconnected actors in the workflow (by default, all actors are required to be connected). If disconnected actors are permitted, the SDF Director will schedule each disconnected 'island' independently. Nothing &quot;forces&quot; the director to finish executing all actors on one island before firing actors on another. However, the order of execution within each island should be correct. Usually, disconnected graphs in an SDF workflow indicate an error.</configure></property>
40
<property name="prop:allowRateChanges" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether dynamic rate changes are permitted or not. By default, rate changes are not permitted, and the director will perform a check to disallow such workflows. If the parameter is selected, then workflows that require rate parameters to be modified during execution are valid, and the SDF Director will dynamically compute a new schedule at runtime. This is an advanced parameter that can usually be left at its default value.</configure></property>
41
<property name="prop:constrainBufferSizes" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether buffer sizes are fixed. By default, buffers are fixed, and attempts to write to the buffer that cause the buffer to exceed its scheduled size result in an error. This is an advanced parameter that can usually be left at its default value.</configure></property>
42
<property name="prop:timeResolution" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The time precision used by this director. All time values are rounded to the nearest multiple of this number. The value is a double that defaults to &quot;1E-10&quot; (which is 10-10). This is an advanced parameter that can usually be left at its default value.</configure></property>
43
<property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to &quot;0&quot;. Note that &quot;0&quot; does not mean &quot;no iterations.&quot; Rather, &quot;0&quot; means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. A value of 1, meaning that the director will run the workflow once, is often the best setting when building an SDF workflow. </configure></property>
44
<property name="prop:vectorizationFactor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vectorizationFactor is used to increase the efficiency of a workflow by increasing the number of times actors fire each time the workflow iterates. If the parameter is set to a positive integer (other than 1), the director will fire each actor the specified number of times more than normal. The default is 1, indicating that no vectorization should be performed. Keep in mind that changing the vectorizationFactor parameter changes the meaning of a nested SDF workflow and may cause deadlock in a workflow that uses it. </configure></property>
45
<property name="prop:synchronizeToRealTime" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether the execution should synchronize to real time or not. By default, the director does not synchronize to real time. If synchronize is selected, the director will only process the workflow when elapsed real time matches the product of the period parameter and the iteration count. Note: if the period parameter has a value of 0.0 (the default), then selecting this parameter has no effect. This is an advanced parameter that can usually be left at its default value.</configure></property>
46
<property name="prop:period" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The time period of each iteration. The value is a double that defaults to 0.0, which means that the director does not increment workflow time. If the value greater than 0.0, the actor will increment workflow time each time it fires. This is an advanced parameter that can usually be left at its default value. </configure></property>
47
</property>    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:director:1:1">
48
    </property>
49
    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.domains.sdf.kernel.SDFDirector">
50
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:directorclass:1:1">
51
        </property>
52
    </property>
53
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Director">
54
    </property>
55
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Director">
56
    </property>
57
    <property name="_location" class="ptolemy.kernel.util.Location" value="[-200.0, -215.0]">
58
    </property>
59
</property>
60

  
61
<property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={16, 25, 1264, 974}, maximized=false}">
62
</property>
63

  
64
<property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[955, 682]">
65
</property>
66

  
67
<property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
68
</property>
69

  
70
<property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{215.4999999999999, 59.0}">
71
</property>
72

  
73
<property name="Annotation3" class="ptolemy.vergil.kernel.attributes.TextAttribute">
74
    <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
75
    </property>
76
    <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
77
    </property>
78
    <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
79
    </property>
80
    <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
81
    </property>
82
    <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
83
    </property>
84
    <property name="bold" class="ptolemy.data.expr.Parameter" value="false">
85
    </property>
86
    <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
87
    </property>
88
    <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Workflow design:&#10;Jim Regetz, &#10;Kevin Drury, &#10;Mark Schildhauer, &#10;Judith Kruger, &#10;Ben Leinfelder,&#10;Matt Jones">
89
        <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
90
            <property name="height" class="ptolemy.data.expr.Parameter" value="20">
91
            </property>
92
            <property name="width" class="ptolemy.data.expr.Parameter" value="80">
93
            </property>
94
        </property>
95
    </property>
96
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
97
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
98
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
99
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
100
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
101
<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is &quot;SansSerif&quot;.</configure></property>
102
<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
103
<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
104
<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
105
<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
106
<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
107
</property>    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:22:1">
108
    </property>
109
    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
110
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
111
        </property>
112
    </property>
113
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
114
    </property>
115
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
116
    </property>
117
    <property name="_location" class="ptolemy.kernel.util.Location" value="[-205.0, -10.0]">
118
    </property>
119
    <property name="" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
120
    </property>
121
    <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
122
    </property>
123
</property>
124

  
125
<property name="reportTitle" class="ptolemy.data.expr.StringParameter" value="River Flow TPCs">
126
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
127
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
128
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
129
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
130
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;StringParameter specifies a persistent string. &lt;/p&gt;&#10;&#10;&lt;p&gt;Change the name of the StringParameter to better identify the specified value (right-click the parameter and select &quot;Customize Name&quot; from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).&#10;&lt;/p&gt;</configure></property>
131
</property>    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:421:1">
132
    </property>
133
    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
134
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
135
        </property>
136
    </property>
137
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
138
    </property>
139
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
140
    </property>
141
    <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
142
    </property>
143
    <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
144
        <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
145
        </property>
146
    </property>
147
    <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
148
        <configure>
149
        <svg>
150
          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
151
        </svg>
152
      </configure>
153
    </property>
154
    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
155
    </property>
156
    <property name="_location" class="ptolemy.kernel.util.Location" value="[-65.0, -155.0]">
157
    </property>
158
</property>
159

  
160
<property name="year" class="ptolemy.data.expr.Parameter" value="2007">
161
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
162
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
163
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
164
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
165
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
166
</property>    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:420:1">
167
    </property>
168
    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.Parameter">
169
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1184:1">
170
        </property>
171
    </property>
172
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
173
    </property>
174
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
175
    </property>
176
    <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
177
    </property>
178
    <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
179
        <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
180
        </property>
181
    </property>
182
    <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
183
        <configure>
184
      <svg>
185
        <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y="20">-P-</text>
186
      </svg>
187
    </configure>
188
    </property>
189
    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
190
    </property>
191
    <property name="_location" class="ptolemy.kernel.util.Location" value="[-65.0, -175.0]">
192
    </property>
193
</property>
194

  
195
<property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:328:27:13:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:287:972:28:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:5:27:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:287:2083:53:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:328:119:5:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:423:379:26:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:357:1030:4">
196
</property>
197

  
198
<property name="Annotation" class="ptolemy.vergil.kernel.attributes.TextAttribute">
199
    <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
200
    </property>
201
    <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
202
    </property>
203
    <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
204
    </property>
205
    <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
206
    </property>
207
    <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
208
    </property>
209
    <property name="bold" class="ptolemy.data.expr.Parameter" value="false">
210
    </property>
211
    <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
212
    </property>
213
    <property name="center" class="ptolemy.data.expr.Parameter" value="false">
214
    </property>
215
    <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Year parameter can either be a single year (e.g., 2007) or null,&#10;in which case the year will be based on current calendar year.">
216
        <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
217
            <property name="height" class="ptolemy.data.expr.Parameter" value="20">
218
            </property>
219
            <property name="width" class="ptolemy.data.expr.Parameter" value="80">
220
            </property>
221
        </property>
222
    </property>
223
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
224
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
225
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
226
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
227
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
228
<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is &quot;SansSerif&quot;.</configure></property>
229
<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
230
<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
231
<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
232
<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
233
<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
234
</property>    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:17:1">
235
    </property>
236
    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
237
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
238
        </property>
239
    </property>
240
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
241
    </property>
242
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
243
    </property>
244
    <property name="_location" class="ptolemy.kernel.util.Location" value="[-80.0, -225.0]">
245
    </property>
246
    <property name="" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
247
    </property>
248
    <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
249
    </property>
250
</property>
251

  
252
<property name="TOP Provenance Recorder" class="org.kepler.provenance.ProvenanceRecorder">
253
    <property name="Recording Type" class="ptolemy.data.expr.StringParameter" value="SQL-SPA-v8">
254
    </property>
255
    <property name="Record Token Values" class="ptolemy.data.expr.Parameter" value="true">
256
    </property>
257
</property>
258

  
259
<property name="Annotation2" class="ptolemy.vergil.kernel.attributes.TextAttribute">
260
    <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
261
    </property>
262
    <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
263
    </property>
264
    <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
265
    </property>
266
    <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
267
    </property>
268
    <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
269
    </property>
270
    <property name="bold" class="ptolemy.data.expr.Parameter" value="false">
271
    </property>
272
    <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
273
    </property>
274
    <property name="center" class="ptolemy.data.expr.Parameter" value="false">
275
    </property>
276
    <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Expose TPC status for reporting">
277
        <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
278
            <property name="height" class="ptolemy.data.expr.Parameter" value="20">
279
            </property>
280
            <property name="width" class="ptolemy.data.expr.Parameter" value="80">
281
            </property>
282
        </property>
283
    </property>
284
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
285
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
286
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
287
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
288
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
289
<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is &quot;SansSerif&quot;.</configure></property>
290
<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
291
<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
292
<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
293
<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
294
<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
295
</property>    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
296
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
297
        </property>
298
    </property>
299
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
300
    </property>
301
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
302
    </property>
303
    <property name="_location" class="ptolemy.kernel.util.Location" value="[205.0, 150.0]">
304
    </property>
305
</property>
306

  
307
<property name="Reporting Listener" class="org.kepler.module.reporting.ReportingListener">
308
</property>
309

  
310

  
311

  
312

  
313

  
314
<relation name="relation" class="ptolemy.actor.TypedIORelation">
315
    <property name="width" class="ptolemy.data.expr.Parameter" value="1">
316
    </property>
317
</relation>
318

  
319
<relation name="relation2" class="ptolemy.actor.TypedIORelation">
320
</relation>
321

  
322
<relation name="relation3" class="ptolemy.actor.TypedIORelation">
323
</relation>
324

  
325
<relation name="relation6" class="ptolemy.actor.TypedIORelation">
326
</relation>
327

  
328
<relation name="relation5" class="ptolemy.actor.TypedIORelation">
329
</relation>
330

  
331
<relation name="relation4" class="ptolemy.actor.TypedIORelation">
332
</relation>
333

  
334
<relation name="relation7" class="ptolemy.actor.TypedIORelation">
335
</relation>
336

  
337
<entity name="Base IFR table" class="org.ecoinformatics.seek.datasource.eml.eml2.Eml200DataSource">
338
    <display name="Base IFR&#10;   table"/>
339
    <property name="emlFilePath" class="ptolemy.data.expr.FileParameter" value="">
340
        <display name="EML File"/>
341
    </property>
342
    <property name="dataFilePath" class="ptolemy.data.expr.FileParameter" value="">
343
        <display name="Data File"/>
344
    </property>
345
    <property name="schemaDef" class="ptolemy.kernel.util.StringAttribute" value="&lt;schema&gt;&#10;  &lt;table name=&quot;ifrHiTable.txt&quot;&gt;&#10;    &lt;field name=&quot;river&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Jan&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Feb&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Mar&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Apr&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;May&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Jun&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Jul&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Aug&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Sep&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Oct&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Nov&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Dec&quot; dataType=&quot;STRING&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;ifrLowTable.txt&quot;&gt;&#10;    &lt;field name=&quot;river&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Jan&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Feb&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Mar&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Apr&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;May&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Jun&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Jul&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Aug&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Sep&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Oct&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Nov&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Dec&quot; dataType=&quot;STRING&quot;/&gt;&#10;  &lt;/table&gt;&#10;&lt;/schema&gt;&#10;">
346
        <display name="Schema Definition"/>
347
        <property name="schemaDef" class="ptolemy.actor.gui.style.TextStyle">
348
            <property name="height" class="ptolemy.data.expr.Parameter" value="10">
349
            </property>
350
            <property name="width" class="ptolemy.data.expr.Parameter" value="30">
351
            </property>
352
        </property>
353
    </property>
354
    <property name="sqlDef" class="ptolemy.kernel.util.StringAttribute">
355
        <display name="SQL Command"/>
356
        <property name="sqlDef" class="ptolemy.actor.gui.style.TextStyle">
357
            <property name="height" class="ptolemy.data.expr.Parameter" value="10">
358
            </property>
359
            <property name="width" class="ptolemy.data.expr.Parameter" value="30">
360
            </property>
361
        </property>
362
    </property>
363
    <property name="selectedEntity" class="ptolemy.data.expr.StringParameter" value="ifrLowTable.txt">
364
        <display name="Selected Entity"/>
365
    </property>
366
    <property name="dataOutputFormat" class="ptolemy.data.expr.StringParameter" value="As Cache File Name">
367
        <display name="Data Output Format"/>
368
    </property>
369
    <property name="fileExtensionFilter" class="ptolemy.data.expr.StringParameter" value="">
370
        <display name="File Extension Filter"/>
371
    </property>
372
    <property name="isLenient" class="ptolemy.data.expr.Parameter" value="false">
373
        <display name="Allow lenient data parsing"/>
374
    </property>
375
    <property name="checkVersion" class="ptolemy.data.expr.Parameter" value="false">
376
        <display name="Check for latest version"/>
377
    </property>
378
    <property name="_tableauFactory" class="org.kepler.objectmanager.data.db.QBTableauFactory">
379
        <property name="sqlName" class="ptolemy.kernel.util.StringAttribute" value="sqlDef">
380
        </property>
381
        <property name="schemaName" class="ptolemy.kernel.util.StringAttribute" value="schemaDef">
382
        </property>
383
    </property>
384
    <property name="recordid" class="ptolemy.kernel.util.StringAttribute" value="knb.218.2">
385
    </property>
386
    <property name="endpoint" class="ptolemy.kernel.util.StringAttribute" value="http://ecogrid.ecoinformatics.org/knb/services/QueryService">
387
    </property>
388
    <property name="namespace" class="ptolemy.kernel.util.StringAttribute" value="eml://ecoinformatics.org/eml-2.0.1">
389
    </property>
390
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
391
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
392
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>matt jones, jing tao, chad</configure></property>
393
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
394
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The EML2Dataset actor provides access to a wide variety of data packages that have been described using EML (Ecological Metadata Language). The actor accesses an EML dataset and handles the mechanical issues involved in parsing metadata, downloading the dataset (if applicable), and emitting data to downstream actors.&lt;/p&gt;&#10;&#10;&lt;p&gt;Each data package contains an EML metadata description and one or more data entities (e.g., data tables, spatial raster images, spatial vector images). The EML metadata allows the described data to be easily ingested into Kepler and exposed for use in downstream components. The data packages can be accessed from the local file system or through any EcoGrid server that provides access to its collection of data objects. The supported data transfer protocols include http, ftp, file, ecogrid, and srb. &lt;/p&gt;&#10;&#10;&lt;p&gt;After parsing the EML metadata, the actor automatically reconfigures its exposed ports to provide one port for each attribute described by the first entity of the EML description. For example, if the first entity is a data table with four columns, the ports might be &quot;Site&quot;, &quot;Date&quot;, &quot;Plot&quot;, and &quot;Rainfall.&quot; These details are obtained from the EML document. To preview the data, right-click the actor icon and select Preview from the drop-down menu.&lt;/p&gt;&#10;&#10;&lt;p&gt;By default, the ports created by the EML2Dataset actor represent data fields, and one tuple of data (e.g., one database row) is emitted on these ports each time the actor fires. Alternatively, the actor can be configured so that the ports represent an array of field values (&quot;AsColumnVector&quot;), or so that the ports represent an entire table of data (&quot;AsTable&quot;). Data tables are formatted in comma-separated-value (CSV) format.&lt;/p&gt;&#10;&#10;&lt;p&gt;If more than one data entity is described in the EML metadata, then the output of the actor defaults to the first entity listed in the EML. To select the other entities, specify an entity with the Selected parameter, or use the Query Builder to describe the filter and join that should be used to produce the data output. To use the Query Builder, right-click the actor and select &quot;Open Actor.&quot; Specify the fields to be output and any filtering constraints to be applied.&lt;/p&gt;</configure></property>
395
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Output ports are automatically configured to provide one port for each attribute in the first entity described in the EML description. For example, if the first entity is a data table with four columns, the ports might be &quot;Site&quot;, &quot;Date&quot;, &quot;Plot&quot;, and &quot;Rainfall.&quot; These details are obtained from the EML document.</configure></property>
396
<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time.</configure></property>
397
<property name="prop:isLenient" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If this parameter is selected, &quot;extra&quot; columns of data (e.g., comments that people have entered on a line or something of that nature) that are not described in the metadata are ignored, allowing the workflow to execute. If the option is unchecked (the default), the workflow execution will halt until the discrepancy between the data and metadata is corrected.</configure></property>
398
<property name="prop:checkVersion" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select this parameter to check the EarthGrid for updates to the data. If the actor finds a version of the data that is more recent than the cached data on your local system, the actor will prompt the user to either download the latest data and metadata or ignore the newer version. Note that different versions of the data can have vastly different structures (new columns, or even new tables of data might be included or removed). If this parameter is selected, users should be prepared to handle changes that might arise from differences in the data structure.</configure></property>
399
<property name="prop:selectedEntity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If this EML data package has multiple entities, the selectedEntity parameter specifies which entity should be output. When this parameter is unset (the default), data from the first entity described in an EML package is output. This parameter is only used if no query statement is specified, or if a query statement is used and the output format is one of &quot;As Table&quot;, &quot;As Byte Array&quot;, &quot;As Uncompressed File Name&quot;, and &quot;As Cache File Name&quot;. To specify a query statement, right-click the actor and select Open Actor.</configure></property>
400
<property name="prop:dataOutputFormat" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify which ports are created for the actor and what data is emitted on those ports during each fire cycle. For example, this field can be configured to produce one port for each column in a data table, or one port that emits the entire data table at once in CSV format. Specifically, the output format choices are:&#10;&lt;table&gt;&#10;&lt;tr&gt;&lt;td&gt;As Field (the default)&lt;/td&gt;&lt;td&gt; The actor creates one output port for each field (i.e., column/attribute/variable) that is described in the EML metadata for the data package. The type of each port (e.g., string, int, double, etc.) matches the base type of the field. If a query statement has been used to subset the data, then only those fields selected in the query statement will be configured as ports. &lt;/td&gt;&lt;/tr&gt;&#10;&#10;&lt;tr&gt;&lt;td&gt;As Table&lt;/td&gt;&lt;td&gt; The selected data will be output as a string that contains the entire entity data. The actor creates three output ports: DataTable - the data itself, Delimiter - delimiter to separate fields, and NumColumns - the number of fields in the table. &lt;/td&gt;&lt;/tr&gt;&#10;&#10;&lt;tr&gt;&lt;td&gt;As Row&lt;/td&gt;&lt;td&gt;  One tuple of selected data is formatted as an array and output. The actor creates one output port (DataRow), and the data type is a record containing each of the individual data fields. &lt;/td&gt;&lt;/tr&gt;&#10;&#10;&lt;tr&gt;&lt;td&gt;As Byte Array&lt;/td&gt;&lt;td&gt; Selected data will be output as an array of bytes. The actor creates two output ports: BinaryData - contains the raw data itself, and EndOfStream - indicates whether the end of data stream has been reached.&lt;/td&gt;&lt;/tr&gt; &#10;&#10;&lt;tr&gt;&lt;td&gt;As UnCompressed File Name&lt;/td&gt;&lt;td&gt; This format is only used when the data package is a compressed file (zip, tar, et al). The compressed archive file is uncompressed after it is downloaded. The actor creates one output port, which contains an array of the filenames of all of the uncompressed archive files. If a FileExtensionFilter is specified, then the array will only contain files that match the specified extension.&lt;/td&gt;&lt;/tr&gt; &#10;&#10;&lt;tr&gt;&lt;td&gt;As Cache File Name&lt;/td&gt;&lt;td&gt;   Kepler stores data files downloaded from remote sites into its cache system. This output format will send the local cache file path for the data package so that workflow designers can directly access the cache files. The actor creates two output ports: CacheLocalFileName (the local file path) and CacheResourceName (the EML data link. e.g., ecogrid://knb/tao.2.1).&lt;/td&gt;&lt;/tr&gt; &#10;&#10;&lt;tr&gt;&lt;td&gt;As Column Vector&lt;/td&gt;&lt;td&gt; This output format is similar to &quot;As Field&quot;, except instead of sending out a single value on each port, the actor sends out an array of all of the data for each field. The type of each port is an array of the base type for the field.&lt;/td&gt;&lt;/tr&gt;&#10;&#10;&lt;tr&gt;&lt;td&gt;As ColumnBased Record&lt;/td&gt;&lt;td&gt;  This output format sends all data on one port using a record structure that encapsulates the entire data entity. The record will contain one array for each data field, and the type of each array will be determined by the type of the field it represents.&lt;/td&gt;&lt;/tr&gt;&#10;&lt;/table&gt;&#10;&#10;</configure></property>
401
<property name="prop:emlFilePath" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The file path of a local EML metadata file used to describe and access an EML data set.</configure></property>
402
<property name="prop:fileExtensionFilter" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A file extension used to limit the array of file names returned by the actor when the selected output type is &quot;As UnCompressed File Name&quot;. This parameter is ignored for other output types.</configure></property>
403
<property name="prop:dataFilePath" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The path to a local data file described by EML (must be used in conjunction with a local EML file). The actor will retrieve the data and automatically configure its ports to output it.</configure></property>
404
</property>    <property name="_location" class="ptolemy.kernel.util.Location" value="[-25.0, 30.0]">
405
    </property>
406
    <port name="CacheLocalFileName" class="ptolemy.actor.TypedIOPort">
407
        <property name="output"/>
408
    </port>
409
    <port name="CacheResourceName" class="ptolemy.actor.TypedIOPort">
410
        <property name="output"/>
411
    </port>
412
</entity>
413
<entity name="BaseFlow" class="org.ecoinformatics.seek.R.RExpression">
414
    <display name="Assess base flow"/>
415
    <property name="expression" class="ptolemy.kernel.util.StringAttribute" value="# The Base flow analysis RExpression actor R code&#10;baseFlowAnalysis &lt;- function(flowThisYear, stations, ifrBase,&#10;  USING_KEPLER=FALSE) {&#10;&#10;  KEEPING_RECORDS &lt;- FALSE&#10;&#10;  # river flow data&#10;  df &lt;- flowThisYear&#10;&#10;  # read the Base flow IFR table and exclude rivers lacking IFR data&#10;  if (USING_KEPLER) {&#10;    # read base ifr from file&#10;    ifrBase &lt;- read.table(ifrBase, sep=&quot;,&quot;, header=TRUE, row.names=1)&#10;  } else {&#10;    baseURL &lt;- &quot;http://knb.ecoinformatics.org/knb/metacat?action=read&amp;docid=&quot;&#10;    ifrBase &lt;- read.csv(paste(baseURL, &quot;nceasadmin.909&quot;, sep=&quot;&quot;),&#10;      row.names=1, na.strings=&quot;&quot;, stringsAsFactors=FALSE)&#10;  }&#10;  stations &lt;- stations[stations$River %in% row.names(ifrBase), ]&#10;&#10;  # Because we have data from many more stations than we have IFRs for,&#10;  # here we restrict the data set to relevant sites (i.e., data sites&#10;  # that are elements of the set of IFR sites).&#10;  df &lt;- subset(df, site %in% stations$Station.code)&#10;  # merge in river names&#10;  df &lt;- merge(df, stations[c(&quot;Station.code&quot;, &quot;River&quot;)], by.x=&quot;site&quot;,&#10;    by.y=&quot;Station.code&quot;, all.x=TRUE, sort=FALSE)&#10;  names(df) &lt;- tolower(names(df))&#10;  # clean up factor levels&#10;  df$site &lt;- factor(df$site)&#10;&#10;  # Average across multiple flow readings on a river*day&#10;  aggdf &lt;- aggregate(df[&quot;flow&quot;], df[c(&quot;date&quot;, &quot;river&quot;)], mean)&#10;  # add an explicit month column&#10;  aggdf$month &lt;- months(aggdf$date, abb=TRUE)&#10;  # look up base ifr for each river/month combo&#10;  aggdf$ifr &lt;- ifrBase[cbind(match(aggdf$river, rownames(ifrBase)),&#10;    match(aggdf$month, colnames(ifrBase)))]&#10;&#10;  # Detecting TPC exceedances requires comparing the observed flow to&#10;  # the base flow requirements (ifrBase). We store the difference&#10;  # between these two, then count up the negative and positive vals&#10;&#10;  # subset days with observed flow less than base flow&#10;  negdf &lt;- subset(within(aggdf, diff &lt;- flow-ifr), diff&lt;=0,&#10;    select=c(month, river, diff))&#10;&#10;  # report number and mean of negative flow days, by month*river&#10;  # [regetz] I'm not restricting signif digits like Kevin did&#10;  idf &lt;- aggregate(list(days=negdf$diff), negdf[c(&quot;month&quot;, &quot;river&quot;)],&#10;    length)&#10;  idf$avg &lt;- aggregate(negdf$diff, negdf[c(&quot;month&quot;, &quot;river&quot;)], mean)$x&#10;  idf$month &lt;- factor(as.character(idf$month), levels = month.abb)&#10;  # sort by river, then month&#10;  idf &lt;- idf[order(idf$river, idf$month),]&#10;&#10;  # construct the TPC exceedance data frame, which will have the month,&#10;  # river, number of days below IFR, and mean flow below IFR, ordered by&#10;  # month (chronologically) and river&#10;  baseTPC &lt;- subset(idf, river %in% unique(aggdf$river) &amp; days!=0)&#10;  baseTPC &lt;- idf[idf$days &gt; 0, ]&#10;  baseTPC$baseIFR &lt;- ifrBase[cbind(match(baseTPC$river,&#10;    rownames(ifrBase)), match(baseTPC$month, colnames(ifrBase)))]&#10;  baseTPC$percentIFR &lt;- round(100*(baseTPC$avg/baseTPC$baseIFR),&#10;    digits=2)&#10;&#10;  # functions to set custom 'caption' and 'title' attributes&#10;  'caption&lt;-' &lt;- function(x, value) {&#10;    attr(x, &quot;caption&quot;) &lt;- value&#10;    return(x)&#10;  }&#10;  'title&lt;-' &lt;- function(x, value) {&#10;    attr(x, &quot;title&quot;) &lt;- value&#10;    return(x)&#10;  }&#10;  caption(ifrBase) &lt;- paste(&quot;Base inflow requirements (IFR) by river and&quot;,&#10;    &quot;month, in m^3/s. Any day for which observed flow does not at&quot;,&#10;    &quot;least meet the base IFR is a TPC exceedance.&quot;, sep=&quot; &quot;)&#10;  title(baseTPC) &lt;- &quot;Base Flow TPC summary&quot;&#10;  caption(baseTPC) &lt;- paste(&quot;Rivers, months, and number of days that&quot;,&#10;    &quot;observed flow fell below the base IFR, during the date range of&quot;,&#10;    &quot;this analysis. The &lt;b&gt;avg&lt;/b&gt; column shows the mean shortfall of&quot;,&#10;    &quot;flow across these days. &lt;b&gt;baseIFR&lt;/b&gt; is the instream flow&quot;,&#10;    &quot;requirement for this river and month, and &lt;b&gt;percentIFR&lt;/b&gt; shows&quot;,&#10;    &quot;the percent of the IFR represented by the mean shortfall.&quot;, sep=&quot; &quot;)&#10;&#10; if (KEEPING_RECORDS) {&#10;  filedf &lt;- filetable_in&#10;  inputdf &lt;- inputdf_in&#10;  # function for registering data files used&#10;  addToRegistry &lt;- function(registry, obj, name, type = c(&quot;table&quot;,&#10;    &quot;figure&quot;), write=FALSE, ...) {&#10;    type &lt;- match.arg(type)&#10;    fname &lt;- paste(format(Sys.Date(), &quot;%Y%b%d&quot;), name, &quot;.csv&quot;, sep=&quot;&quot;)&#10;    description &lt;- paste(name, type)&#10;    if (write) {&#10;      if (!is.matrix(obj) &amp; !is.data.frame(obj)) {&#10;        stop(&quot;can only write tabular data to CSV&quot;)&#10;      }&#10;      write.csv(obj, fname, ...)&#10;    }&#10;    rbind(registry, data.frame(description, fname))&#10;  }&#10;  filedf &lt;- rbind(filedf, data.frame(description=&quot;BaseFlowTPC Graphs&quot;,&#10;    fname=fname))&#10;  # write tables to CSV files and add file # names to our list&#10;  filedf &lt;- addToRegistry(filedf, baseTPC, &quot;BaseExceedances&quot;, write=TRUE)&#10;  filedf &lt;- addToRegistry(filedf, ifrBase, &quot;BaseIFR&quot;, write=TRUE)&#10;  return(list(flowData=df, aggFlowData=aggdf, inputdf_out=inputdf,&#10;    filetable_out=filedf))&#10; }&#10;&#10;  return(list(aggFlowData=aggdf, baseTPC=baseTPC))&#10;&#10;}&#10;&#10;ans &lt;- baseFlowAnalysis(flowThisYear, stations, ifrBase, USING_KEPLER=TRUE)&#10;invisible(lapply(names(ans), function(nm) assign(nm, ans[[nm]], envir=.GlobalEnv)))&#10;">
416
        <display name="R function or script"/>
417
        <property name="R Expression" class="ptolemy.actor.gui.style.TextStyle">
418
            <property name="height" class="ptolemy.data.expr.Parameter" value="30">
419
            </property>
420
            <property name="width" class="ptolemy.data.expr.Parameter" value="60">
421
            </property>
422
        </property>
423
    </property>
424
    <property name="Rcwd" class="ptolemy.data.expr.StringParameter" value="/home/regetz/.kepler/">
425
        <display name="R working directory"/>
426
    </property>
427
    <property name="save_nosave" class="ptolemy.data.expr.StringParameter" value="--no-save">
428
        <display name="Save or not"/>
429
    </property>
430
    <property name="graphicsFormat" class="ptolemy.data.expr.StringParameter" value="png">
431
        <display name="Graphics Format"/>
432
    </property>
433
    <property name="graphicsOutput" class="ptolemy.data.expr.Parameter" value="false">
434
        <display name="Graphics Output"/>
435
    </property>
436
    <property name="displayGraphicsOutput" class="ptolemy.data.expr.Parameter" value="false">
437
        <display name="Automatically display graphics"/>
438
    </property>
439
    <property name="numXPixels" class="ptolemy.data.expr.StringParameter" value="800">
440
        <display name="Number of X pixels in image"/>
441
    </property>
442
    <property name="numYPixels" class="ptolemy.data.expr.StringParameter" value="600">
443
        <display name="Number of Y pixels in image"/>
444
    </property>
445
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
446
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
447
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Dan Higgins</configure></property>
448
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
449
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The RExpression actor runs an R script or function. Input and output port are created by the user and correspond to R variables used in the specified R script. The actor outputs the result of the evaluated script.&lt;/p&gt;&#10;&#10;&lt;p&gt;The R application must be installed on the local system to use this actor. R is a language and environment for statistical computing and graphics. For more information about R, see http://www.r-project.org/.&lt;/p&gt;&#10;&#10;&lt;p&gt;Kepler contains a number of preconfigured R-actors: Barplot, Boxplot, Scatterplot, Summary, RandomNormal, RandomUniform, Correlation, LinearModel, Regression, RMean, RMedian, RQuantile, and  SummaryStatistics.&lt;/p&gt;</configure></property>
450
<property name="port:graphicsFileName" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the file name of the generated graph of the results.</configure></property>
451
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a copy of the text output that R generates. As the actor communicates with R to run the R function or script, the output port sends back the response (i.e., the values and statistical outputs).</configure></property>
452
<property name="prop:Rcwd" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The 'R' working directory (the home directory by default). </configure></property>
453
<property name="prop:displayGraphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to display the plot once the actor has generated it.</configure></property>
454
<property name="prop:graphicsFormat" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The graphics output format. Currently the actor supports either  *.pdf or  *.png.</configure></property>
455
<property name="prop:numXPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The width of the output graphic in pixels.</configure></property>
456
<property name="prop:numYPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The height of the output graphic in pixels.</configure></property>
457
<property name="prop:expression" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The expression that is evaluated to produce the output.</configure></property>
458
<property name="prop:graphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to create a graphics output port. By default, the actor will create a graphics output port.</configure></property>
459
<property name="prop:save_nosave" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to save the R workspace when R is closed; set to '--save' to retrieve the workspace later in a workflow in another R-actor.</configure></property>
460
</property>    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:423:605:3">
461
    </property>
462
    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.ecoinformatics.seek.R.RExpression">
463
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1126:1">
464
        </property>
465
    </property>
466
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#MathOperationActor">
467
    </property>
468
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
469
    </property>
470
    <property name="_location" class="ptolemy.kernel.util.Location" value="[25.0, -75.0]">
471
    </property>
472
    <property name="" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1">
473
    </property>
474
    <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1">
475
    </property>
476
    <port name="graphicsFileName" class="ptolemy.actor.TypedIOPort">
477
        <property name="output"/>
478
        <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
479
        </property>
480
        <property name="_hide" class="ptolemy.data.expr.SingletonParameter" value="true">
481
        </property>
482
    </port>
483
    <port name="output" class="ptolemy.actor.TypedIOPort">
484
        <property name="output"/>
485
        <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
486
        </property>
487
    </port>
488
    <port name="ifrBase" class="ptolemy.actor.TypedIOPort">
489
        <property name="input"/>
490
        <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
491
        </property>
492
        <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
493
        </property>
494
    </port>
495
    <port name="baseTPC" class="ptolemy.actor.TypedIOPort">
496
        <property name="output"/>
497
    </port>
498
    <port name="flowThisYear" class="ptolemy.actor.TypedIOPort">
499
        <property name="input"/>
500
        <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
501
        </property>
502
    </port>
503
    <port name="stations" class="ptolemy.actor.TypedIOPort">
504
        <property name="input"/>
505
    </port>
506
    <port name="aggFlowData" class="ptolemy.actor.TypedIOPort">
507
        <property name="output"/>
508
    </port>
509
</entity>
510
<entity name="Get water flow data" class="ptolemy.actor.TypedCompositeActor">
511
    <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.0.beta">
512
    </property>
513
    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:20:12">
514
    </property>
515
    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
516
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
517
        </property>
518
    </property>
519
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
520
    </property>
521
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
522
    </property>
523
    <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
524
    </property>
525
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
526
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
527
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
528
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
529
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director &quot;inherit&quot; the director from the containing workflow and are called non-opaque.&lt;/p&gt;&#10;&#10;&lt;p&gt;To create a composite actor, drag and drop the Composite actor onto the Workflow canvas. Right-click the actor and select Open Actor from the drop-down menu. A new Kepler application window will open for designing the composite.&lt;/p&gt;</configure></property>
530
</property>    <property name="_location" class="ptolemy.kernel.util.Location" value="[-145.0, -95.0]">
531
    </property>
532
    <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1">
533
    </property>
534
    <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={2261, 250, 905, 637}, maximized=false}">
535
    </property>
536
    <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 478]">
537
    </property>
538
    <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
539
    </property>
540
    <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{-24.0, -31.2151816273463}">
541
    </property>
542
    <port name="port" class="ptolemy.actor.TypedIOPort">
543
        <property name="output"/>
544
        <property name="_location" class="ptolemy.kernel.util.Location" value="{175.0, -50.0}">
545
        </property>
546
    </port>
547
    <port name="port2" class="ptolemy.actor.TypedIOPort">
548
        <property name="output"/>
549
        <property name="_location" class="ptolemy.kernel.util.Location" value="{210.0, -20.0}">
550
        </property>
551
    </port>
552
    <entity name="Get year" class="ptolemy.actor.TypedCompositeActor">
553
        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.0.beta">
554
        </property>
555
        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:16:11">
556
        </property>
557
        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
558
            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
559
            </property>
560
        </property>
561
        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
562
        </property>
563
        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
564
        </property>
565
        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
566
        </property>
567
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
568
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
569
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
570
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
571
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director &quot;inherit&quot; the director from the containing workflow and are called non-opaque.&lt;/p&gt;&#10;&#10;&lt;p&gt;To create a composite actor, drag and drop the Composite actor onto the Workflow canvas. Right-click the actor and select Open Actor from the drop-down menu. A new Kepler application window will open for designing the composite.&lt;/p&gt;</configure></property>
572
</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="{-105.0, 50.0}">
573
        </property>
574
        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1">
575
        </property>
576
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={695, 219, 905, 637}, maximized=false}">
577
        </property>
578
        <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 478]">
579
        </property>
580
        <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
581
        </property>
582
        <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{-141.5648854961832, 309.0}">
583
        </property>
584
        <port name="port" class="ptolemy.actor.TypedIOPort">
585
            <property name="output"/>
586
            <property name="_location" class="ptolemy.kernel.util.Location" value="{25.0, 285.0}">
587
            </property>
588
        </port>
589
        <entity name="Current year" class="org.ecoinformatics.seek.R.RExpression">
590
            <property name="expression" class="ptolemy.kernel.util.StringAttribute" value="if(exists(&quot;yearParam&quot;) &amp;&amp; is.numeric(yearParam)) {&#10;  year &lt;- yearParam&#10;} else {&#10;  year &lt;- substr(currentTime, 1, 4)&#10;}">
591
                <display name="R function or script"/>
592
                <property name="R Expression" class="ptolemy.actor.gui.style.TextStyle">
593
                    <property name="height" class="ptolemy.data.expr.Parameter" value="10">
594
                    </property>
595
                    <property name="width" class="ptolemy.data.expr.Parameter" value="30">
596
                    </property>
597
                </property>
598
            </property>
599
            <property name="_editorFactory" class="ptolemy.vergil.toolbox.TextEditorTableauFactory">
600
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="expression">
601
                </property>
602
                <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="80">
603
                </property>
604
                <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="40">
605
                </property>
606
            </property>
607
            <property name="Rcwd" class="ptolemy.data.expr.StringParameter" value="/home/regetz/.kepler/">
608
                <display name="R working directory"/>
609
            </property>
610
            <property name="save_nosave" class="ptolemy.data.expr.StringParameter" value="--no-save">
611
                <display name="Save or not"/>
612
            </property>
613
            <property name="graphicsFormat" class="ptolemy.data.expr.StringParameter" value="png">
614
                <display name="Graphics Format"/>
615
            </property>
616
            <property name="graphicsOutput" class="ptolemy.data.expr.Parameter" value="true">
617
                <display name="Graphics Output"/>
618
            </property>
619
            <property name="displayGraphicsOutput" class="ptolemy.data.expr.Parameter" value="false">
620
                <display name="Automatically display graphics"/>
621
            </property>
622
            <property name="numXPixels" class="ptolemy.data.expr.StringParameter" value="480">
623
                <display name="Number of X pixels in image"/>
624
            </property>
625
            <property name="numYPixels" class="ptolemy.data.expr.StringParameter" value="480">
626
                <display name="Number of Y pixels in image"/>
627
            </property>
628
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
629
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
630
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Dan Higgins</configure></property>
631
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
632
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The RExpression actor runs an R script or function. Input and output port are created by the user and correspond to R variables used in the specified R script. The actor outputs the result of the evaluated script.&lt;/p&gt;&#10;&#10;&lt;p&gt;The R application must be installed on the local system to use this actor. R is a language and environment for statistical computing and graphics. For more information about R, see http://www.r-project.org/.&lt;/p&gt;&#10;&#10;&lt;p&gt;Kepler contains a number of preconfigured R-actors: Barplot, Boxplot, Scatterplot, Summary, RandomNormal, RandomUniform, Correlation, LinearModel, Regression, RMean, RMedian, RQuantile, and  SummaryStatistics.&lt;/p&gt;</configure></property>
633
<property name="port:graphicsFileName" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the file name of the generated graph of the results.</configure></property>
634
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a copy of the text output that R generates. As the actor communicates with R to run the R function or script, the output port sends back the response (i.e., the values and statistical outputs).</configure></property>
635
<property name="prop:Rcwd" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The 'R' working directory (the home directory by default). </configure></property>
636
<property name="prop:displayGraphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to display the plot once the actor has generated it.</configure></property>
637
<property name="prop:graphicsFormat" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The graphics output format. Currently the actor supports either  *.pdf or  *.png.</configure></property>
638
<property name="prop:numXPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The width of the output graphic in pixels.</configure></property>
639
<property name="prop:numYPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The height of the output graphic in pixels.</configure></property>
640
<property name="prop:expression" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The expression that is evaluated to produce the output.</configure></property>
641
<property name="prop:graphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to create a graphics output port. By default, the actor will create a graphics output port.</configure></property>
642
<property name="prop:save_nosave" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to save the R workspace when R is closed; set to '--save' to retrieve the workspace later in a workflow in another R-actor.</configure></property>
643
</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:15:8">
644
            </property>
645
            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.ecoinformatics.seek.R.RExpression">
646
                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1126:1">
647
                </property>
648
            </property>
649
            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#MathOperationActor">
650
            </property>
651
            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
652
            </property>
653
            <property name="_location" class="ptolemy.kernel.util.Location" value="{-135.0, 285.0}">
654
            </property>
655
            <property name="" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1">
656
            </property>
657
            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1">
658
            </property>
659
            <port name="graphicsFileName" class="ptolemy.actor.TypedIOPort">
660
                <property name="output"/>
661
                <property name="_hide" class="ptolemy.data.expr.SingletonParameter" value="true">
662
                </property>
663
            </port>
664
            <port name="output" class="ptolemy.actor.TypedIOPort">
665
                <property name="output"/>
666
                <property name="_hide" class="ptolemy.data.expr.SingletonParameter" value="false">
667
                </property>
668
            </port>
669
            <port name="currentTime" class="ptolemy.actor.TypedIOPort">
670
                <property name="input"/>
671
            </port>
672
            <port name="year" class="ptolemy.actor.TypedIOPort">
673
                <property name="output"/>
674
            </port>
675
            <port name="yearParam" class="ptolemy.actor.TypedIOPort">
676
                <property name="input"/>
677
            </port>
678
        </entity>
679
        <entity name="Time Stamp" class="org.sdm.spa.Timestamp">
680
            <property name="format" class="ptolemy.data.expr.StringParameter" value="yyyy-MM-dd z HH:mm:ss">
681
            </property>
682
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
683
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
684
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Ilkay Altintas</configure></property>
685
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
686
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The TimeStamp actor outputs the current date and time.&lt;/p&gt;&#10;&#10;&lt;p&gt;Dates and times can be formatted in a variety of ways. Select a format from the drop-down menu beside the format parameter, or enter a pattern directly into the format field. For more information about date format patterns, see http://java.sun.com/docs/books/tutorial/i18n/format/datepattern.html.&lt;/p&gt;</configure></property>
687
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the current time stamp as a string.</configure></property>
688
<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time.</configure></property>
689
<property name="prop:format" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The date format. Select a format string from the drop-down menu or type in a custom format string directly into the field. For more information about date formatting patterns, see http://java.sun.com/docs/books/tutorial/i18n/format/datepattern.html</configure></property>
690
</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:370:1">
691
            </property>
692
            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.sdm.spa.Timestamp">
693
                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1136:1">
694
                </property>
695
            </property>
696
            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ClockActor">
697
            </property>
698
            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#LocalInput">
699
            </property>
700
            <property name="_location" class="ptolemy.kernel.util.Location" value="{-280.0, 300.0}">
701
            </property>
702
            <property name="" class="ptolemy.vergil.basic.DocAttribute">
703
                <property name="description" class="ptolemy.data.expr.StringParameter" value="&lt;p&gt;The TimeStamp actor outputs the current date and time.&lt;/p&gt;&#10;&#10;&lt;p&gt;Dates and times can be formatted in a variety of ways. Select a format from the drop-down menu beside the format parameter, or enter a pattern directly into the format field. For more information about date format patterns, see http://java.sun.com/docs/books/tutorial/i18n/format/datepattern.html.&lt;/p&gt;">
704
                </property>
705
                <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Ilkay Altintas">
706
                </property>
707
                <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
708
                </property>
709
                <property name="format (parameter)" class="ptolemy.data.expr.StringParameter" value="The date format. Select a format string from the drop-down menu or type in a custom format string directly into the field. For more information about date formatting patterns, see http://java.sun.com/docs/books/tutorial/i18n/format/datepattern.html">
710
                </property>
711
                <property name="output (port)" class="ptolemy.kernel.util.StringAttribute" value="An output port that broadcasts the current time stamp as a string.">
712
                </property>
713
                <property name="trigger (port)" class="ptolemy.kernel.util.StringAttribute" value="A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time.">
714
                </property>
715
            </property>
716
        </entity>
717
        <entity name="Constant" class="ptolemy.actor.lib.Const">
718
            <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
719
            </property>
720
            <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
721
            </property>
722
            <property name="value" class="ptolemy.data.expr.Parameter" value="year">
723
            </property>
724
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
725
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
726
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
727
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
728
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The Constant actor outputs a constant, which is specified by the value parameter. By default, the actor outputs the integer 1.&lt;/p&gt;&#10;&#10;&lt;p&gt;The actor can be used to output other types of values, e.g., a string (such as &quot;Hello&quot;) or a double (such as 1.2). The actor'&#10;s output type matches the type of the specified value.&lt;/p&gt;&#10;&#10;&lt;p&gt;NOTE: If using a PN Director, the 'firingCountLimit' parameter is often set to a finite integer (e.g. '1') so that the workflow will terminate. &lt;/p&gt;&#10;</configure></property>
729
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the specified constant. By default, the output is 1.</configure></property>
730
<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time.</configure></property>
731
<property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
732
<property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the Constant actor. By default, the value is the integer token 1. The value can be set to another type, e.g., a string (such as &quot;Hello&quot;) or a double (such as 1.2). The  output type matches the type of the value specified here.</configure></property>
733
</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:1:1">
734
            </property>
735
            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.Const">
736
                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:877:1">
737
                </property>
738
            </property>
739
            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ConstantActor">
740
            </property>
741
            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
742
            </property>
743
            <property name="kar" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:kar:57:1">
744
            </property>
745
            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
746
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
747
                </property>
748
                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="40">
749
                </property>
750
            </property>
751
            <property name="_location" class="ptolemy.kernel.util.Location" value="{-220.0, 400.0}">
752
            </property>
753
            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
754
            </property>
755
            <port name="trigger" class="ptolemy.actor.TypedIOPort">
756
                <property name="input"/>
757
                <property name="multiport"/>
758
                <property name="_hide" class="ptolemy.data.expr.SingletonParameter" value="true">
759
                </property>
760
            </port>
761
        </entity>
762
        <relation name="relation" class="ptolemy.actor.TypedIORelation">
763
        </relation>
764
        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
765
        </relation>
766
        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
767
        </relation>
768
        <link port="port" relation="relation2"/>
769
        <link port="Current year.currentTime" relation="relation"/>
770
        <link port="Current year.year" relation="relation2"/>
771
        <link port="Current year.yearParam" relation="relation3"/>
772
        <link port="Time Stamp.output" relation="relation"/>
773
        <link port="Constant.output" relation="relation3"/>
774
    </entity>
775
    <entity name="River name lookup table" class="org.ecoinformatics.seek.datasource.eml.eml2.Eml200DataSource">
776
        <display name="River name&#10;lookup table"/>
777
        <property name="emlFilePath" class="ptolemy.data.expr.FileParameter" value="">
778
            <display name="EML File"/>
779
        </property>
780
        <property name="dataFilePath" class="ptolemy.data.expr.FileParameter" value="">
781
            <display name="Data File"/>
782
        </property>
783
        <property name="schemaDef" class="ptolemy.kernel.util.StringAttribute" value="&lt;schema&gt;&#10;  &lt;table name=&quot;Flowstations.txt&quot;&gt;&#10;    &lt;field name=&quot;Station_code&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Station_name&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;River&quot; dataType=&quot;STRING&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow2000_2004.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Volumetric_rate&quot; dataType=&quot;FLOAT&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow90_1999.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Flow_amount&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow80_1989.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Amount_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow50_1959.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Amount_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow70_1979.txt&quot;&gt;&#10;    &lt;field name=&quot;gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Flow_amount&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow1940_1949.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Amount&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow1960_1969.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow2008.txt&quot;&gt;&#10;    &lt;field name=&quot;STATION&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;DATUM&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;READING&quot; dataType=&quot;FLOAT&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow2005-2007.txt&quot;&gt;&#10;    &lt;field name=&quot;STATION&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;DATUM&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;READING&quot; dataType=&quot;FLOAT&quot;/&gt;&#10;  &lt;/table&gt;&#10;&lt;/schema&gt;&#10;">
784
            <display name="Schema Definition"/>
785
            <property name="schemaDef" class="ptolemy.actor.gui.style.TextStyle">
786
                <property name="height" class="ptolemy.data.expr.Parameter" value="10">
787
                </property>
788
                <property name="width" class="ptolemy.data.expr.Parameter" value="30">
789
                </property>
790
            </property>
791
        </property>
792
        <property name="sqlDef" class="ptolemy.kernel.util.StringAttribute">
793
            <display name="SQL Command"/>
794
            <property name="sqlDef" class="ptolemy.actor.gui.style.TextStyle">
795
                <property name="height" class="ptolemy.data.expr.Parameter" value="10">
796
                </property>
797
                <property name="width" class="ptolemy.data.expr.Parameter" value="30">
798
                </property>
799
            </property>
800
        </property>
801
        <property name="selectedEntity" class="ptolemy.data.expr.StringParameter" value="Flowstations.txt">
802
            <display name="Selected Entity"/>
803
        </property>
804
        <property name="dataOutputFormat" class="ptolemy.data.expr.StringParameter" value="As Cache File Name">
805
            <display name="Data Output Format"/>
806
        </property>
807
        <property name="fileExtensionFilter" class="ptolemy.data.expr.StringParameter" value="">
808
            <display name="File Extension Filter"/>
809
        </property>
810
        <property name="isLenient" class="ptolemy.data.expr.Parameter" value="false">
811
            <display name="Allow lenient data parsing"/>
812
        </property>
813
        <property name="checkVersion" class="ptolemy.data.expr.Parameter" value="false">
814
            <display name="Check for latest version"/>
815
        </property>
816
        <property name="_tableauFactory" class="org.kepler.objectmanager.data.db.QBTableauFactory">
817
            <property name="sqlName" class="ptolemy.kernel.util.StringAttribute" value="sqlDef">
818
            </property>
819
            <property name="schemaName" class="ptolemy.kernel.util.StringAttribute" value="schemaDef">
820
            </property>
821
        </property>
822
        <property name="recordid" class="ptolemy.kernel.util.StringAttribute" value="judithk.895.2">
823
        </property>
824
        <property name="endpoint" class="ptolemy.kernel.util.StringAttribute" value="http://ecogrid.ecoinformatics.org/knb/services/QueryService">
825
        </property>
826
        <property name="namespace" class="ptolemy.kernel.util.StringAttribute" value="eml://ecoinformatics.org/eml-2.0.1">
827
        </property>
828
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
829
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
830
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>matt jones, jing tao, chad</configure></property>
831
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
832
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The EML2Dataset actor provides access to a wide variety of data packages that have been described using EML (Ecological Metadata Language). The actor accesses an EML dataset and handles the mechanical issues involved in parsing metadata, downloading the dataset (if applicable), and emitting data to downstream actors.&lt;/p&gt;&#10;&#10;&lt;p&gt;Each data package contains an EML metadata description and one or more data entities (e.g., data tables, spatial raster images, spatial vector images). The EML metadata allows the described data to be easily ingested into Kepler and exposed for use in downstream components. The data packages can be accessed from the local file system or through any EcoGrid server that provides access to its collection of data objects. The supported data transfer protocols include http, ftp, file, ecogrid, and srb. &lt;/p&gt;&#10;&#10;&lt;p&gt;After parsing the EML metadata, the actor automatically reconfigures its exposed ports to provide one port for each attribute described by the first entity of the EML description. For example, if the first entity is a data table with four columns, the ports might be &quot;Site&quot;, &quot;Date&quot;, &quot;Plot&quot;, and &quot;Rainfall.&quot; These details are obtained from the EML document. To preview the data, right-click the actor icon and select Preview from the drop-down menu.&lt;/p&gt;&#10;&#10;&lt;p&gt;By default, the ports created by the EML2Dataset actor represent data fields, and one tuple of data (e.g., one database row) is emitted on these ports each time the actor fires. Alternatively, the actor can be configured so that the ports represent an array of field values (&quot;AsColumnVector&quot;), or so that the ports represent an entire table of data (&quot;AsTable&quot;). Data tables are formatted in comma-separated-value (CSV) format.&lt;/p&gt;&#10;&#10;&lt;p&gt;If more than one data entity is described in the EML metadata, then the output of the actor defaults to the first entity listed in the EML. To select the other entities, specify an entity with the Selected parameter, or use the Query Builder to describe the filter and join that should be used to produce the data output. To use the Query Builder, right-click the actor and select &quot;Open Actor.&quot; Specify the fields to be output and any filtering constraints to be applied.&lt;/p&gt;</configure></property>
833
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Output ports are automatically configured to provide one port for each attribute in the first entity described in the EML description. For example, if the first entity is a data table with four columns, the ports might be &quot;Site&quot;, &quot;Date&quot;, &quot;Plot&quot;, and &quot;Rainfall.&quot; These details are obtained from the EML document.</configure></property>
834
<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time.</configure></property>
835
<property name="prop:isLenient" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If this parameter is selected, &quot;extra&quot; columns of data (e.g., comments that people have entered on a line or something of that nature) that are not described in the metadata are ignored, allowing the workflow to execute. If the option is unchecked (the default), the workflow execution will halt until the discrepancy between the data and metadata is corrected.</configure></property>
836
<property name="prop:checkVersion" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select this parameter to check the EarthGrid for updates to the data. If the actor finds a version of the data that is more recent than the cached data on your local system, the actor will prompt the user to either download the latest data and metadata or ignore the newer version. Note that different versions of the data can have vastly different structures (new columns, or even new tables of data might be included or removed). If this parameter is selected, users should be prepared to handle changes that might arise from differences in the data structure.</configure></property>
837
<property name="prop:selectedEntity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If this EML data package has multiple entities, the selectedEntity parameter specifies which entity should be output. When this parameter is unset (the default), data from the first entity described in an EML package is output. This parameter is only used if no query statement is specified, or if a query statement is used and the output format is one of &quot;As Table&quot;, &quot;As Byte Array&quot;, &quot;As Uncompressed File Name&quot;, and &quot;As Cache File Name&quot;. To specify a query statement, right-click the actor and select Open Actor.</configure></property>
838
<property name="prop:dataOutputFormat" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify which ports are created for the actor and what data is emitted on those ports during each fire cycle. For example, this field can be configured to produce one port for each column in a data table, or one port that emits the entire data table at once in CSV format. Specifically, the output format choices are:&#10;&lt;table&gt;&#10;&lt;tr&gt;&lt;td&gt;As Field (the default)&lt;/td&gt;&lt;td&gt; The actor creates one output port for each field (i.e., column/attribute/variable) that is described in the EML metadata for the data package. The type of each port (e.g., string, int, double, etc.) matches the base type of the field. If a query statement has been used to subset the data, then only those fields selected in the query statement will be configured as ports. &lt;/td&gt;&lt;/tr&gt;&#10;&#10;&lt;tr&gt;&lt;td&gt;As Table&lt;/td&gt;&lt;td&gt; The selected data will be output as a string that contains the entire entity data. The actor creates three output ports: DataTable - the data itself, Delimiter - delimiter to separate fields, and NumColumns - the number of fields in the table. &lt;/td&gt;&lt;/tr&gt;&#10;&#10;&lt;tr&gt;&lt;td&gt;As Row&lt;/td&gt;&lt;td&gt;  One tuple of selected data is formatted as an array and output. The actor creates one output port (DataRow), and the data type is a record containing each of the individual data fields. &lt;/td&gt;&lt;/tr&gt;&#10;&#10;&lt;tr&gt;&lt;td&gt;As Byte Array&lt;/td&gt;&lt;td&gt; Selected data will be output as an array of bytes. The actor creates two output ports: BinaryData - contains the raw data itself, and EndOfStream - indicates whether the end of data stream has been reached.&lt;/td&gt;&lt;/tr&gt; &#10;&#10;&lt;tr&gt;&lt;td&gt;As UnCompressed File Name&lt;/td&gt;&lt;td&gt; This format is only used when the data package is a compressed file (zip, tar, et al). The compressed archive file is uncompressed after it is downloaded. The actor creates one output port, which contains an array of the filenames of all of the uncompressed archive files. If a FileExtensionFilter is specified, then the array will only contain files that match the specified extension.&lt;/td&gt;&lt;/tr&gt; &#10;&#10;&lt;tr&gt;&lt;td&gt;As Cache File Name&lt;/td&gt;&lt;td&gt;   Kepler stores data files downloaded from remote sites into its cache system. This output format will send the local cache file path for the data package so that workflow designers can directly access the cache files. The actor creates two output ports: CacheLocalFileName (the local file path) and CacheResourceName (the EML data link. e.g., ecogrid://knb/tao.2.1).&lt;/td&gt;&lt;/tr&gt; &#10;&#10;&lt;tr&gt;&lt;td&gt;As Column Vector&lt;/td&gt;&lt;td&gt; This output format is similar to &quot;As Field&quot;, except instead of sending out a single value on each port, the actor sends out an array of all of the data for each field. The type of each port is an array of the base type for the field.&lt;/td&gt;&lt;/tr&gt;&#10;&#10;&lt;tr&gt;&lt;td&gt;As ColumnBased Record&lt;/td&gt;&lt;td&gt;  This output format sends all data on one port using a record structure that encapsulates the entire data entity. The record will contain one array for each data field, and the type of each array will be determined by the type of the field it represents.&lt;/td&gt;&lt;/tr&gt;&#10;&lt;/table&gt;&#10;&#10;</configure></property>
839
<property name="prop:emlFilePath" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The file path of a local EML metadata file used to describe and access an EML data set.</configure></property>
840
<property name="prop:fileExtensionFilter" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A file extension used to limit the array of file names returned by the actor when the selected output type is &quot;As UnCompressed File Name&quot;. This parameter is ignored for other output types.</configure></property>
841
<property name="prop:dataFilePath" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The path to a local data file described by EML (must be used in conjunction with a local EML file). The actor will retrieve the data and automatically configure its ports to output it.</configure></property>
842
</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="{-195.0, 25.0}">
843
        </property>
844
        <port name="CacheLocalFileName" class="ptolemy.actor.TypedIOPort">
845
            <property name="output"/>
846
        </port>
847
        <port name="CacheResourceName" class="ptolemy.actor.TypedIOPort">
848
            <property name="output"/>
849
        </port>
850
    </entity>
851
    <entity name="PrepareData" class="org.ecoinformatics.seek.R.RExpression">
852
        <display name="Prepare Data"/>
853
        <property name="expression" class="ptolemy.kernel.util.StringAttribute" value="# The PrepareData RExpression Actor R code&#10;prepareData &lt;- function(allFlowData, year, rivers, USING_KEPLER=FALSE) {&#10;&#10;  KEEPING_RECORDS &lt;- FALSE&#10;&#10;  # river flow data&#10;  df &lt;- allFlowData&#10;&#10;  # Here, we reduce the data by excluding non-flows - we should be able&#10;  # to find these by opening the &quot;Get input files&quot; composite actor,&#10;  # right-clicking on a datasource actor, choosing &quot;Get metadata&quot;, and&#10;  # looking for the &quot;Missing Value Code&quot;. For this data, however, we&#10;  # must discover missing value codes by inspection.  They include&#10;  # variations on -99 and 9999.9...&#10;&#10;  # [regetz] it seems like only 9999.99 is supposed to indicated NA?&#10;  # replace NA codes with NA and exclude records w/NA flow&#10;  df$flow[ df$flow&lt;0 | abs(df$flow)==9999.99 ] &lt;- NA&#10;  df &lt;- df[ !is.na(df$flow), ]&#10;&#10;  # Next, read supplementary data from a lookup table included with the&#10;  # data package that will allow us to match flow monitoring stations&#10;  # with river names and add those names to a column of our dataframe.&#10;  if (USING_KEPLER) {&#10;    stations &lt;- read.table(rivers, sep=&quot;\t&quot;, header=T,&#10;      na.strings=&quot;&quot;, stringsAsFactors=FALSE)&#10;  } else {&#10;    baseURL &lt;- &quot;http://knb.ecoinformatics.org/knb/metacat?action=read&amp;docid=&quot;&#10;    stations &lt;- read.delim(paste(baseURL, &quot;judithk.894&quot;, sep=&quot;&quot;),&#10;      na.strings=&quot;&quot;, stringsAsFactors=FALSE)&#10;  }&#10;&#10;  # exclude row with blank station code&#10;  stations &lt;- stations[!is.na(stations$Station.code), ]&#10;&#10;  # Some stations in the stations table have no IFR. No IFR = no TPC.&#10;  # For now, remove these records (at least until IFR available)&#10;  b9 &lt;- c(&quot;B9H001-A01&quot;, &quot;B9H002-A01&quot;, &quot;B9H003-A01&quot;, &quot;B9H004-A01&quot;,&#10;    &quot;X4H004-A01&quot;)&#10;  stations &lt;- stations[!(stations$Station.code %in% b9), ]&#10;&#10;  # in the included stations table, only the 1st station on a river is&#10;  # given a name - stations below this, but on the same river have&#10;  # blanks in the river name column.  We must therefore use the river&#10;  # name of the first station to fill in empty river names for the&#10;  # stations below them&#10;  stations$River &lt;- na.omit(stations$River)[cumsum(!is.na(stations$River))]&#10;&#10;  # Clean dates. Date format can be either yy.mm.dd or yyyy.mm.dd&#10;  # ...but first fix a faulty date entry&#10;  df$date[df$date==&quot;96.02 19&quot;] &lt;- &quot;96.02.19&quot;&#10;  # If year is only two digits, first append the century (i.e. 19 or 20)&#10;  # under assumption that any two digit years &gt;40 are in the 1900s&#10;  dates &lt;- levels(df$date)&#10;  clean.date.levels &lt;- ifelse(substr(dates, 3, 3) == &quot;.&quot;,&#10;    paste(ifelse(as.numeric(substr(dates, 1, 2))&gt;40, 19, 20), dates,&#10;    sep=&quot;&quot;), dates)&#10;  levels(df$date) &lt;- clean.date.levels&#10;  #Converting to Date type would be nice, but can be slow on big vectors&#10;  #df$date &lt;- as.Date(df$date, format=&quot;%Y.%m.%d&quot;)&#10;&#10;  # Subset data for the desired year&#10;  df &lt;- df[substr(df$date, 1, 4)==year,]&#10;&#10;  if (nrow(df)==0) {&#10;    return(list(dataNotFound=TRUE))&#10;  }&#10;&#10;  levels(df$date) &lt;- gsub(&quot;\\.&quot;, &quot;-&quot;, levels(df$date))&#10;  df$date &lt;- as.Date(df$date)&#10;&#10;  # clean up factor levels&#10;  df$site &lt;- factor(df$site)&#10;&#10;  # setter and getter functions for custom 'caption' attribute&#10;  'caption&lt;-' &lt;- function(x, value) {&#10;    attr(x, &quot;caption&quot;) &lt;- value&#10;    return(x)&#10;  }&#10;  caption &lt;- function(x) {&#10;    attr(x, &quot;caption&quot;)&#10;  }&#10;  caption(stations) &lt;- paste(&quot;River monitoring station codes, location&quot;,&#10;    &quot;names, and river names used in this analysis.&quot;, sep=&quot; &quot;)&#10;&#10; if (KEEPING_RECORDS) {&#10;  # function for registering data files used&#10;  addToRegistry &lt;- function(registry, obj, name, type = c(&quot;table&quot;,&#10;    &quot;figure&quot;), write=FALSE, ...) {&#10;    type &lt;- match.arg(type)&#10;    fname &lt;- paste(format(Sys.Date(), &quot;%Y%b%d&quot;), name, &quot;.csv&quot;, sep=&quot;&quot;)&#10;    description &lt;- paste(name, type)&#10;    if (write) {&#10;      if (!is.matrix(obj) &amp; !is.data.frame(obj)) {&#10;        stop(&quot;can only write tabular data to CSV&quot;)&#10;      }&#10;      write.csv(obj, fname, ...)&#10;    }&#10;    rbind(registry, data.frame(description, fname))&#10;  }&#10;  # the list of files imported into the workflow as input thus far&#10;  inputdf &lt;- inputdf_in&#10;  inputdf &lt;- rbind(inputdf, data.frame(package=&quot;judithk.895.2&quot;,&#10;    fname=&quot;Flowstations.txt&quot;))&#10;  inputdf &lt;- rbind(inputdf, data.frame(package=&quot;knb.218.2&quot;,&#10;    fname=&quot;ifrLowTable.txt&quot;))&#10;  # create filedf registry of outputs written to file &#10;  # Write stations table to a file and add the file name to the list&#10;  # in filetable_out&#10;  filedf &lt;- addToRegistry(NULL, stations, &quot;RiverStations&quot;, write=TRUE)&#10;  caption(filedf) &lt;- paste(&quot;Output files generated&quot;,&#10;    &quot;during execution of this workflow, in the order they were&quot;,&#10;    &quot;generated. By default, these files reside in the user's .kepler&quot;,&#10;    &quot;directory.&quot;, sep=&quot; &quot;)&#10;  return(list(data_out=df, ifrBase=ifrBase, filetable_out=filetable_out,&#10;    inputdf_out=inputdf))&#10; }&#10;&#10;  return(list(flowData=df, stations=stations))&#10;&#10;}&#10;&#10;ans &lt;- prepareData(allFlowData, year, rivers, USING_KEPLER=TRUE) &#10;invisible(lapply(names(ans), function(nm) assign(nm, ans[[nm]], envir=.GlobalEnv)))">
854
            <display name="R function or script"/>
855
            <property name="R Expression" class="ptolemy.actor.gui.style.TextStyle">
856
                <property name="height" class="ptolemy.data.expr.Parameter" value="10">
857
                </property>
858
                <property name="width" class="ptolemy.data.expr.Parameter" value="30">
859
                </property>
860
            </property>
861
        </property>
862
        <property name="_editorFactory" class="ptolemy.vergil.toolbox.TextEditorTableauFactory">
863
            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="expression">
864
            </property>
865
            <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="80">
866
            </property>
867
            <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="40">
868
            </property>
869
        </property>
870
        <property name="Rcwd" class="ptolemy.data.expr.StringParameter" value="C:\Documents and Settings\drury\.kepler\">
871
            <display name="R working directory"/>
872
        </property>
873
        <property name="save_nosave" class="ptolemy.data.expr.StringParameter" value="--no-save">
874
            <display name="Save or not"/>
875
        </property>
876
        <property name="graphicsFormat" class="ptolemy.data.expr.StringParameter" value="png">
877
            <display name="Graphics Format"/>
878
        </property>
879
        <property name="graphicsOutput" class="ptolemy.data.expr.Parameter" value="true">
880
            <display name="Graphics Output"/>
881
        </property>
882
        <property name="displayGraphicsOutput" class="ptolemy.data.expr.Parameter" value="false">
883
            <display name="Automatically display graphics"/>
884
        </property>
885
        <property name="numXPixels" class="ptolemy.data.expr.StringParameter" value="480">
886
            <display name="Number of X pixels in image"/>
887
        </property>
888
        <property name="numYPixels" class="ptolemy.data.expr.StringParameter" value="480">
889
            <display name="Number of Y pixels in image"/>
890
        </property>
891
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
892
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
893
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Dan Higgins</configure></property>
894
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
895
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The RExpression actor runs an R script or function. Input and output port are created by the user and correspond to R variables used in the specified R script. The actor outputs the result of the evaluated script.&lt;/p&gt;&#10;&#10;&lt;p&gt;The R application must be installed on the local system to use this actor. R is a language and environment for statistical computing and graphics. For more information about R, see http://www.r-project.org/.&lt;/p&gt;&#10;&#10;&lt;p&gt;Kepler contains a number of preconfigured R-actors: Barplot, Boxplot, Scatterplot, Summary, RandomNormal, RandomUniform, Correlation, LinearModel, Regression, RMean, RMedian, RQuantile, and  SummaryStatistics.&lt;/p&gt;</configure></property>
896
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a copy of the text output that R generates. As the actor communicates with R to run the R function or script, the output port sends back the response (i.e., the values and statistical outputs).</configure></property>
897
<property name="port:graphicsFileName" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the file name of the generated graph of the results.</configure></property>
898
<property name="prop:Rcwd" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The 'R' working directory (the home directory by default). </configure></property>
899
<property name="prop:displayGraphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to display the plot once the actor has generated it.</configure></property>
900
<property name="prop:graphicsFormat" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The graphics output format. Currently the actor supports either  *.pdf or  *.png.</configure></property>
901
<property name="prop:numXPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The width of the output graphic in pixels.</configure></property>
902
<property name="prop:numYPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The height of the output graphic in pixels.</configure></property>
903
<property name="prop:expression" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The expression that is evaluated to produce the output.</configure></property>
904
<property name="prop:save_nosave" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to save the R workspace when R is closed; set to '--save' to retrieve the workspace later in a workflow in another R-actor.</configure></property>
905
<property name="prop:graphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to create a graphics output port. By default, the actor will create a graphics output port.</configure></property>
906
</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:8:11">
907
        </property>
908
        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.ecoinformatics.seek.R.RExpression">
909
            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1126:1">
910
            </property>
911
        </property>
912
        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#MathOperationActor">
913
        </property>
914
        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
915
        </property>
916
        <property name="_location" class="ptolemy.kernel.util.Location" value="{-35.0, -45.0}">
917
        </property>
918
        <property name="" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1">
919
        </property>
920
        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1">
921
        </property>
922
        <port name="graphicsFileName" class="ptolemy.actor.TypedIOPort">
923
            <property name="output"/>
924
            <property name="_hide" class="ptolemy.data.expr.SingletonParameter" value="true">
925
            </property>
926
            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
927
            </property>
928
        </port>
929
        <port name="output" class="ptolemy.actor.TypedIOPort">
930
            <property name="output"/>
931
            <property name="_hide" class="ptolemy.data.expr.SingletonParameter" value="false">
932
            </property>
933
            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
934
            </property>
935
        </port>
936
        <port name="allFlowData" class="ptolemy.actor.TypedIOPort">
937
            <property name="input"/>
938
            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
939
            </property>
940
        </port>
941
        <port name="flowData" class="ptolemy.actor.TypedIOPort">
942
            <property name="output"/>
943
            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
944
            </property>
945
            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="EAST">
946
            </property>
947
        </port>
948
        <port name="rivers" class="ptolemy.actor.TypedIOPort">
949
            <property name="input"/>
950
            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
951
            </property>
952
        </port>
953
        <port name="year" class="ptolemy.actor.TypedIOPort">
954
            <property name="input"/>
955
            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
956
            </property>
957
        </port>
958
        <port name="stations" class="ptolemy.actor.TypedIOPort">
959
            <property name="output"/>
960
        </port>
961
        <port name="dataNotFound" class="ptolemy.actor.TypedIOPort">
962
            <property name="output"/>
963
            <property name="_type" class="ptolemy.actor.TypeAttribute" value="boolean">
964
            </property>
965
            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
966
            </property>
967
        </port>
968
    </entity>
969
    <entity name="FlowDataEML" class="ptolemy.actor.TypedCompositeActor">
970
        <display name="Get water flow data from KNB"/>
971
        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="7.0.beta">
972
        </property>
973
        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:7:1">
974
        </property>
975
        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
976
            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
977
            </property>
978
        </property>
979
        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
980
        </property>
981
        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
982
        </property>
983
        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
984
        </property>
985
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
986
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
987
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
988
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
989
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director &quot;inherit&quot; the director from the containing workflow and are called non-opaque.&lt;/p&gt;&#10;&#10;&lt;p&gt;To create a composite actor, drag and drop the Composite actor onto the Workflow canvas. Right-click the actor and select Open Actor from the drop-down menu. A new Kepler application window will open for designing the composite.&lt;/p&gt;</configure></property>
990
</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="{-225.0, -95.0}">
991
        </property>
992
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={544, 96, 1056, 911}, maximized=false}">
993
        </property>
994
        <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[751, 752]">
995
        </property>
996
        <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
997
        </property>
998
        <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{-49.5, -408.28125}">
999
        </property>
1000
        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:328:28:5">
1001
        </property>
1002
        <property name="Annotation" class="ptolemy.vergil.kernel.attributes.TextAttribute">
1003
            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
1004
            </property>
1005
            <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
1006
            </property>
1007
            <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
1008
            </property>
1009
            <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
1010
            </property>
1011
            <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
1012
            </property>
1013
            <property name="bold" class="ptolemy.data.expr.Parameter" value="false">
1014
            </property>
1015
            <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
1016
            </property>
1017
            <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Here, water flow data is downloaded from the repository, combined&#10;into an R dataframe, and passed to the next stage of the analysis. ">
1018
                <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
1019
                    <property name="height" class="ptolemy.data.expr.Parameter" value="20">
1020
                    </property>
1021
                    <property name="width" class="ptolemy.data.expr.Parameter" value="80">
1022
                    </property>
1023
                </property>
1024
            </property>
1025
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
1026
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1027
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
1028
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1029
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
1030
<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is &quot;SansSerif&quot;.</configure></property>
1031
<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
1032
<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
1033
<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
1034
<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
1035
<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
1036
</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:328:24:1">
1037
            </property>
1038
            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
1039
                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
1040
                </property>
1041
            </property>
1042
            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
1043
            </property>
1044
            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
1045
            </property>
1046
            <property name="_location" class="ptolemy.kernel.util.Location" value="{-270.0, -320.0}">
1047
            </property>
1048
            <property name="" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
1049
            </property>
1050
            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
1051
            </property>
1052
        </property>
1053
        <port name="allFlowData" class="ptolemy.actor.TypedIOPort">
1054
            <property name="output"/>
1055
            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
1056
            </property>
1057
            <property name="_location" class="ptolemy.kernel.util.Location" value="{165.0, -435.0}">
1058
            </property>
1059
        </port>
1060
        <port name="currentTime" class="ptolemy.actor.TypedIOPort">
1061
            <property name="input"/>
1062
            <property name="_location" class="ptolemy.kernel.util.Location" value="{40.0, 220.0}">
1063
            </property>
1064
        </port>
1065
        <entity name="Kruger National Park river flow data" class="org.ecoinformatics.seek.datasource.eml.eml2.Eml200DataSource">
1066
            <property name="emlFilePath" class="ptolemy.data.expr.FileParameter" value="">
1067
                <display name="EML File"/>
1068
            </property>
1069
            <property name="dataFilePath" class="ptolemy.data.expr.FileParameter" value="">
1070
                <display name="Data File"/>
1071
            </property>
1072
            <property name="schemaDef" class="ptolemy.kernel.util.StringAttribute" value="&lt;schema&gt;&#10;  &lt;table name=&quot;Flowstations.txt&quot;&gt;&#10;    &lt;field name=&quot;Station_code&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Station_name&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;River&quot; dataType=&quot;STRING&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow2000_2004.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Volumetric_rate&quot; dataType=&quot;FLOAT&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow90_1999.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Flow_amount&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow80_1989.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Amount_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow50_1959.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Amount_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow70_1979.txt&quot;&gt;&#10;    &lt;field name=&quot;gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Flow_amount&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow1940_1949.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Amount&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow1960_1969.txt&quot;&gt;&#10;    &lt;field name=&quot;Gauging_weir&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;Date_of_flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;    &lt;field name=&quot;Flow&quot; dataType=&quot;INTEGER&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow2008.txt&quot;&gt;&#10;    &lt;field name=&quot;STATION&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;DATUM&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;READING&quot; dataType=&quot;FLOAT&quot;/&gt;&#10;  &lt;/table&gt;&#10;  &lt;table name=&quot;flow2005-2007.txt&quot;&gt;&#10;    &lt;field name=&quot;STATION&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;DATUM&quot; dataType=&quot;STRING&quot;/&gt;&#10;    &lt;field name=&quot;READING&quot; dataType=&quot;FLOAT&quot;/&gt;&#10;  &lt;/table&gt;&#10;&lt;/schema&gt;&#10;">
1073
                <display name="Schema Definition"/>
1074
                <property name="schemaDef" class="ptolemy.actor.gui.style.TextStyle">
1075
                    <property name="height" class="ptolemy.data.expr.Parameter" value="10">
1076
                    </property>
1077
                    <property name="width" class="ptolemy.data.expr.Parameter" value="30">
1078
                    </property>
1079
                </property>
1080
            </property>
1081
            <property name="sqlDef" class="ptolemy.kernel.util.StringAttribute">
1082
                <display name="SQL Command"/>
1083
                <property name="sqlDef" class="ptolemy.actor.gui.style.TextStyle">
1084
                    <property name="height" class="ptolemy.data.expr.Parameter" value="10">
1085
                    </property>
1086
                    <property name="width" class="ptolemy.data.expr.Parameter" value="30">
1087
                    </property>
1088
                </property>
1089
            </property>
1090
            <property name="selectedEntity" class="ptolemy.data.expr.StringParameter" value="Flowstations.txt">
1091
                <display name="Selected Entity"/>
1092
            </property>
1093
            <property name="dataOutputFormat" class="ptolemy.data.expr.StringParameter" value="As All Cache File Names">
1094
                <display name="Data Output Format"/>
1095
            </property>
1096
            <property name="fileExtensionFilter" class="ptolemy.data.expr.StringParameter" value="">
1097
                <display name="File Extension Filter"/>
1098
            </property>
1099
            <property name="isLenient" class="ptolemy.data.expr.Parameter" value="false">
1100
                <display name="Allow lenient data parsing"/>
1101
            </property>
1102
            <property name="checkVersion" class="ptolemy.data.expr.Parameter" value="false">
1103
                <display name="Check for latest version"/>
1104
            </property>
1105
            <property name="_tableauFactory" class="org.kepler.objectmanager.data.db.QBTableauFactory">
1106
                <property name="sqlName" class="ptolemy.kernel.util.StringAttribute" value="sqlDef">
1107
                </property>
1108
                <property name="schemaName" class="ptolemy.kernel.util.StringAttribute" value="schemaDef">
1109
                </property>
1110
            </property>
1111
            <property name="recordid" class="ptolemy.kernel.util.StringAttribute" value="judithk.895.2">
1112
            </property>
1113
            <property name="endpoint" class="ptolemy.kernel.util.StringAttribute" value="http://ecogrid.ecoinformatics.org/knb/services/QueryService">
1114
            </property>
1115
            <property name="namespace" class="ptolemy.kernel.util.StringAttribute" value="eml://ecoinformatics.org/eml-2.0.1">
1116
            </property>
1117
            <property name="_location" class="ptolemy.kernel.util.Location" value="{-245.0, -430.0}">
1118
            </property>
1119
            <port name="CacheLocalFileNames" class="ptolemy.actor.TypedIOPort">
1120
                <property name="output"/>
1121
            </port>
1122
            <port name="CacheResourceNames" class="ptolemy.actor.TypedIOPort">
1123
                <property name="output"/>
1124
            </port>
1125
            <port name="Delimiters" class="ptolemy.actor.TypedIOPort">
1126
                <property name="output"/>
1127
            </port>
1128
            <port name="HeaderLines" class="ptolemy.actor.TypedIOPort">
1129
                <property name="output"/>
1130
            </port>
1131
            <port name="FieldNames" class="ptolemy.actor.TypedIOPort">
1132
                <property name="output"/>
1133
            </port>
1134
        </entity>
1135
        <entity name="Data Combiner" class="org.ecoinformatics.seek.R.RExpression">
1136
            <property name="expression" class="ptolemy.kernel.util.StringAttribute" value="# The FileCombiner RExpression actor R code&#10;fileCombiner &lt;- function(datalist, USING_KEPLER=FALSE) {&#10;&#10;  # Workflow assumes that all river data tables have three columns,&#10;  # representing (*in order*): site, date, flow. It does *not* match columns&#10;  # using attribute names, because these have historically been&#10;  # inconsistent across the river flow data sets&#10;&#10; if (USING_KEPLER) {&#10;&#10;  # exclude the Flowstations lookup table from this list of data frames&#10;  datalist &lt;- datalist[names(datalist) != &quot;Flowstations.txt&quot;]&#10;  datalist &lt;- lapply(datalist, function(dat) {&#10;    names(dat) &lt;- c(&quot;site&quot;, &quot;date&quot;, &quot;flow&quot;)&#10;    return(dat)&#10;  })&#10;&#10; } else {&#10;&#10;  # Note these idiosyncracies in the flow data tables:&#10;  #   - the 7th data table is TAB-separated&#10;  #   - the 8th and 9th data table DO have a header row&#10;&#10;  # Construct metacat URLs for flow data stored on KNB. Also need to&#10;  # specify tab-delimited vs CSV, and presence of headers&#10;  docIDs &lt;- paste(&quot;judithk&quot;, c(625:630, 892, 904:905), sep=&quot;.&quot;)&#10;  separators &lt;- ifelse(docIDs==&quot;judithk.892&quot;, &quot;\t&quot;, &quot;,&quot;)&#10;  headers &lt;- ifelse(docIDs %in% c(&quot;judithk.904&quot;, &quot;judithk.905&quot;), TRUE,&#10;    FALSE)&#10;  baseURL &lt;- &quot;http://knb.ecoinformatics.org/knb/metacat?action=read&amp;docid=&quot;&#10;  dataURLs &lt;- paste(baseURL, docIDs, sep=&quot;&quot;)&#10;&#10;  datalist &lt;- mapply(function(url, sep, hdr) {&#10;      dat &lt;- read.table(url, sep=sep, header=hdr)&#10;      names(dat) &lt;- c(&quot;site&quot;, &quot;date&quot;, &quot;flow&quot;)&#10;      return(dat)&#10;    }, url=dataURLs, sep=separators, hdr=headers, SIMPLIFY=FALSE,&#10;      USE.NAMES=FALSE)&#10; }&#10;&#10;  # Load data&#10;  df &lt;- do.call(&quot;rbind&quot;, datalist)&#10;&#10;  # One part of me wants all such transfers to occur together at the end&#10;  # of the script.  The other part of me wants the transfer to occur in&#10;  # close proximity to where the transferred table was generated so that&#10;  # reference to a data frame doesn't occur 100 lines later and seem to&#10;  # &quot;appear out of the blue&quot;.  Here, it seemed best to create &quot;df&quot;, and&#10;  # pass it on immediately.&#10;&#10;  # some functions, which are used below,  These are a bit overkill for&#10;  # this script, but are included for consistency with how the same&#10;  # issues are handled in later steps&#10;&#10;  # [regetz] This is a much simpler way to get what Kevin's original&#10;  # 'mydate' function produces, without requiring the chron package&#10;  mydate &lt;- function() format(Sys.Date(), &quot;%Y%b%d&quot;)&#10;&#10;  ######################################################################&#10;  #writefile &lt;- function(data, filename, s=&quot;, &quot;) {&#10;  #  myd &lt;- mydate()  # returns a date to prepend to file name&#10;  #  fname &lt;- paste(myd, filename, &quot;.csv&quot;, sep=&quot;&quot;)&#10;  #  write.table(data, fname, sep=s)&#10;  #  df &lt;- data.frame(description=paste(filename, &quot;Table&quot;, sep=&quot; &quot;), fname=fname)&#10;  #&#10;  #  # return a data frame &quot;row&quot; that can be added to the growing list&#10;  #  # of files written during analysis&#10;  #  return(df)&#10;  #}&#10;  ######################################################################&#10;  # seems good to have a record of the data used (besides what is&#10;  # visible on the canvas), for one thing, this can be kept with the&#10;  # results report, which includes all figures and tables generated&#10;  # during the analysis It would definitely be best if this data were&#10;  # available programmatically.  And, maybe it is - the package name is&#10;  # the &quot;recordid&quot; and the file name is the &quot;selected entity&quot;, of the&#10;  # eml data source.  But how to access these???  All I &quot;see&quot; from here&#10;  # is the input port, and it only carries cache file name.  So, the&#10;  # package and file name must be entered manually after inspecting the&#10;  # recordid and Selected Entity via &quot;Configue Actor&quot;.  Other files will&#10;  # be added to this list downstream, again, by hand so, building by&#10;  # hand...&#10;  ######################################################################&#10;&#10;  return(list(allFlowData=df))&#10;&#10;}&#10;&#10;ans &lt;- fileCombiner(datalist, USING_KEPLER=TRUE)&#10;invisible(lapply(names(ans), function(nm) assign(nm, ans[[nm]], envir=.GlobalEnv)))&#10;">
1137
                <display name="R function or script"/>
1138
                <property name="R Expression" class="ptolemy.actor.gui.style.TextStyle">
1139
                    <property name="height" class="ptolemy.data.expr.Parameter" value="30">
1140
                    </property>
1141
                    <property name="width" class="ptolemy.data.expr.Parameter" value="60">
1142
                    </property>
1143
                </property>
1144
            </property>
1145
            <property name="Rcwd" class="ptolemy.data.expr.StringParameter" value="/home/regetz/.kepler/">
1146
                <display name="R working directory"/>
1147
            </property>
1148
            <property name="save_nosave" class="ptolemy.data.expr.StringParameter" value="--no-save">
1149
                <display name="Save or not"/>
1150
            </property>
1151
            <property name="graphicsFormat" class="ptolemy.data.expr.StringParameter" value="pdf">
1152
                <display name="Graphics Format"/>
1153
            </property>
1154
            <property name="graphicsOutput" class="ptolemy.data.expr.Parameter" value="false">
1155
                <display name="Graphics Output"/>
1156
            </property>
1157
            <property name="displayGraphicsOutput" class="ptolemy.data.expr.Parameter" value="false">
1158
                <display name="Automatically display graphics"/>
1159
            </property>
1160
            <property name="numXPixels" class="ptolemy.data.expr.StringParameter" value="480">
1161
                <display name="Number of X pixels in image"/>
1162
            </property>
1163
            <property name="numYPixels" class="ptolemy.data.expr.StringParameter" value="480">
1164
                <display name="Number of Y pixels in image"/>
1165
            </property>
1166
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
1167
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1168
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Dan Higgins</configure></property>
1169
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1170
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The RExpression actor runs an R script or function. Input and output port are created by the user and correspond to R variables used in the specified R script. The actor outputs the result of the evaluated script.&lt;/p&gt;&#10;&#10;&lt;p&gt;The R application must be installed on the local system to use this actor. R is a language and environment for statistical computing and graphics. For more information about R, see http://www.r-project.org/.&lt;/p&gt;&#10;&#10;&lt;p&gt;Kepler contains a number of preconfigured R-actors: Barplot, Boxplot, Scatterplot, Summary, RandomNormal, RandomUniform, Correlation, LinearModel, Regression, RMean, RMedian, RQuantile, and  SummaryStatistics.&lt;/p&gt;</configure></property>
1171
<property name="port:graphicsFileName" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the file name of the generated graph of the results.</configure></property>
1172
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a copy of the text output that R generates. As the actor communicates with R to run the R function or script, the output port sends back the response (i.e., the values and statistical outputs).</configure></property>
1173
<property name="prop:Rcwd" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The 'R' working directory (the home directory by default). </configure></property>
1174
<property name="prop:displayGraphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to display the plot once the actor has generated it.</configure></property>
1175
<property name="prop:graphicsFormat" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The graphics output format. Currently the actor supports either  *.pdf or  *.png.</configure></property>
1176
<property name="prop:numXPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The width of the output graphic in pixels.</configure></property>
1177
<property name="prop:numYPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The height of the output graphic in pixels.</configure></property>
1178
<property name="prop:expression" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The expression that is evaluated to produce the output.</configure></property>
1179
<property name="prop:graphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to create a graphics output port. By default, the actor will create a graphics output port.</configure></property>
1180
<property name="prop:save_nosave" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to save the R workspace when R is closed; set to '--save' to retrieve the workspace later in a workflow in another R-actor.</configure></property>
1181
</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:328:21:4">
1182
            </property>
1183
            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.ecoinformatics.seek.R.RExpression">
1184
                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1126:1">
1185
                </property>
1186
            </property>
1187
            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#MathOperationActor">
1188
            </property>
1189
            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
1190
            </property>
1191
            <property name="_location" class="ptolemy.kernel.util.Location" value="{40.0, -400.0}">
1192
            </property>
1193
            <property name="" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1">
1194
            </property>
1195
            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1">
1196
            </property>
1197
            <port name="datalist" class="ptolemy.actor.TypedIOPort">
1198
                <property name="input"/>
1199
                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
1200
                </property>
1201
            </port>
1202
            <port name="allFlowData" class="ptolemy.actor.TypedIOPort">
1203
                <property name="output"/>
1204
                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
1205
                </property>
1206
                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
1207
                </property>
1208
            </port>
1209
        </entity>
1210
        <entity name="Get all EML tables" class="org.ecoinformatics.seek.R.RExpression">
1211
            <property name="expression" class="ptolemy.kernel.util.StringAttribute" value="#&#10;# Convert all tables in a EML DP to a list of data frames &#10;#&#10;&#10;# convert EML tab indicator to &quot;\t&quot;&#10;delimiters &lt;- sub(&quot;#x09&quot;, &quot;\t&quot;, delimiters)&#10;&#10;# note that any header lines in the original data tables are dropped, and&#10;# the data frame headers are instead constructed from the corresponding&#10;# Attribute Names pulled from the EML document &#10;&#10;# create empty list to store data frames&#10;datalist &lt;- list()&#10;&#10;# loop through the files&#10;for (i in seq_along(files)) {&#10;  datafile &lt;- files[[i]]&#10;  sep &lt;- delimiters[[i]]&#10;  skip &lt;- headers[[i]]&#10;  col.names &lt;- fields[[i]]&#10;  datalist[[i]] &lt;- read.table(datafile, comment.char=&quot;&quot;, header=FALSE,&#10;    skip=skip, sep=sep, col.names=col.names)&#10;}&#10;&#10;names(datalist) &lt;- tables&#10;&#10;">
1212
                <display name="R function or script"/>
1213
                <property name="R Expression" class="ptolemy.actor.gui.style.TextStyle">
1214
                    <property name="height" class="ptolemy.data.expr.Parameter" value="10">
1215
                    </property>
1216
                    <property name="width" class="ptolemy.data.expr.Parameter" value="30">
1217
                    </property>
1218
                </property>
1219
            </property>
1220
            <property name="Rcwd" class="ptolemy.data.expr.StringParameter" value="C:\Documents and Settings\Dan Higgins\.kepler\">
1221
                <display name="R working directory"/>
1222
            </property>
1223
            <property name="save_nosave" class="ptolemy.data.expr.StringParameter" value="--no-save">
1224
                <display name="Save or not"/>
1225
            </property>
1226
            <property name="graphicsOutput" class="ptolemy.data.expr.Parameter" value="true">
1227
                <display name="Graphics Output"/>
1228
            </property>
1229
            <property name="displayGraphicsOutput" class="ptolemy.data.expr.Parameter" value="false">
1230
                <display name="Automatically display graphics"/>
1231
            </property>
1232
            <property name="numXPixels" class="ptolemy.data.expr.StringParameter" value="480">
1233
                <display name="Number of X pixels in image"/>
1234
            </property>
1235
            <property name="numYPixels" class="ptolemy.data.expr.StringParameter" value="480">
1236
                <display name="Number of Y pixels in image"/>
1237
            </property>
1238
            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:328:13:20">
1239
            </property>
1240
            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.ecoinformatics.seek.R.RExpression">
1241
                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1126:1">
1242
                </property>
1243
            </property>
1244
            <property name="semanticType000" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#MathOperationActor">
1245
            </property>
1246
            <property name="semanticType111" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
1247
            </property>
1248
            <property name="_location" class="ptolemy.kernel.util.Location" value="{-115.0, -445.0}">
1249
            </property>
1250
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
1251
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1252
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Dan Higgins</configure></property>
1253
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1254
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&#10;&lt;p&gt;The RExpression actor runs an R script or function. Input and output port are created by the user and correspond to R variables used in the specified R script. The actor outputs the result of the evaluated script.&lt;/p&gt;&#10;&#10;&lt;p&gt;The R application must be installed on the local system to use this actor. R is a language and environment for statistical computing and graphics. For more information about R, see http://www.r-project.org/.&lt;/p&gt;&#10;&#10;&lt;p&gt;Kepler contains a number of preconfigured R-actors: Barplot, Boxplot, Scatterplot, Summary, RandomNormal, RandomUniform, Correlation, LinearModel, Regression, RMean, RMedian, RQuantile, and  SummaryStatistics.&lt;/p&gt;&#10;</configure></property>
1255
<property name="port:graphicsFileName" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the file name of the generated graph of the results.</configure></property>
1256
<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a copy of the text output that R generates. As the actor communicates with R to run the R function or script, the output port sends back the response (i.e., the values and statistical outputs).</configure></property>
1257
<property name="prop:Rcwd" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The 'R' working directory (the home directory by default). </configure></property>
1258
<property name="prop:displayGraphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to display the plot once the actor has generated it.</configure></property>
1259
<property name="prop:graphicsFormat" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The graphics output format. Currently the actor supports either  *.pdf or  *.png.</configure></property>
1260
<property name="prop:numXPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The width of the output graphic in pixels.</configure></property>
1261
<property name="prop:numYPixels" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The height of the output graphic in pixels.</configure></property>
1262
<property name="prop:expression" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The expression that is evaluated to produce the output.</configure></property>
1263
<property name="prop:graphicsOutput" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to create a graphics output port. By default, the actor will create a graphics output port.</configure></property>
1264
<property name="prop:save_nosave" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether or not to save the R workspace when R is closed; set to '--save' to retrieve the workspace later in a workflow in another R-actor.</configure></property>
1265
</property>            <property name="" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:287:838:25">
1266
            </property>
1267
            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:360:1:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:287:838:25">
1268
            </property>
1269
            <port name="files" class="ptolemy.actor.TypedIOPort">
1270
                <property name="input"/>
1271
            </port>
1272
            <port name="tables" class="ptolemy.actor.TypedIOPort">
1273
                <property name="input"/>
1274
            </port>
1275
            <port name="delimiters" class="ptolemy.actor.TypedIOPort">
1276
                <property name="input"/>
1277
            </port>
1278
            <port name="headers" class="ptolemy.actor.TypedIOPort">
1279
                <property name="input"/>
1280
            </port>
1281
            <port name="fields" class="ptolemy.actor.TypedIOPort">
1282
                <property name="input"/>
1283
            </port>
1284
            <port name="datalist" class="ptolemy.actor.TypedIOPort">
1285
                <property name="output"/>
1286
            </port>
1287
        </entity>
1288
        <relation name="relation" class="ptolemy.actor.TypedIORelation">
1289
            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1290
            </property>
1291
        </relation>
1292
        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
1293
            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1294
            </property>
1295
        </relation>
1296
        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
1297
            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1298
            </property>
1299
        </relation>
1300
        <relation name="relation4" class="ptolemy.actor.TypedIORelation">
1301
            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1302
            </property>
1303
        </relation>
1304
        <relation name="relation5" class="ptolemy.actor.TypedIORelation">
1305
            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1306
            </property>
1307
        </relation>
1308
        <relation name="relation6" class="ptolemy.actor.TypedIORelation">
1309
            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1310
            </property>
1311
        </relation>
1312
        <relation name="relation7" class="ptolemy.actor.TypedIORelation">
1313
            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1314
            </property>
1315
        </relation>
1316
        <link port="allFlowData" relation="relation7"/>
1317
        <link port="Kruger National Park river flow data.CacheLocalFileNames" relation="relation4"/>
1318
        <link port="Kruger National Park river flow data.CacheResourceNames" relation="relation"/>
1319
        <link port="Kruger National Park river flow data.Delimiters" relation="relation6"/>
1320
        <link port="Kruger National Park river flow data.HeaderLines" relation="relation2"/>
1321
        <link port="Kruger National Park river flow data.FieldNames" relation="relation3"/>
1322
        <link port="Data Combiner.datalist" relation="relation5"/>
1323
        <link port="Data Combiner.allFlowData" relation="relation7"/>
1324
        <link port="Get all EML tables.files" relation="relation4"/>
1325
        <link port="Get all EML tables.tables" relation="relation"/>
1326
        <link port="Get all EML tables.delimiters" relation="relation6"/>
1327
        <link port="Get all EML tables.headers" relation="relation2"/>
1328
        <link port="Get all EML tables.fields" relation="relation3"/>
1329
        <link port="Get all EML tables.datalist" relation="relation5"/>
1330
    </entity>
1331
    <entity name="CheckData" class="ptolemy.actor.TypedCompositeActor">
1332
        <display name="Check data availability"/>
1333
        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.0.beta">
1334
        </property>
1335
        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:12:10">
1336
        </property>
1337
        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
1338
            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
1339
            </property>
1340
        </property>
1341
        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
1342
        </property>
1343
        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
1344
        </property>
1345
        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
1346
        </property>
1347
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
1348
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1349
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
1350
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1351
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director &quot;inherit&quot; the director from the containing workflow and are called non-opaque.&lt;/p&gt;&#10;&#10;&lt;p&gt;To create a composite actor, drag and drop the Composite actor onto the Workflow canvas. Right-click the actor and select Open Actor from the drop-down menu. A new Kepler application window will open for designing the composite.&lt;/p&gt;</configure></property>
1352
</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="{25.0, 75.0}">
1353
        </property>
1354
        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1">
1355
        </property>
1356
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={695, 290, 905, 637}, maximized=false}">
1357
        </property>
1358
        <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 478]">
1359
        </property>
1360
        <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
1361
        </property>
1362
        <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{300.0, 239.0}">
1363
        </property>
1364
        <port name="port" class="ptolemy.actor.TypedIOPort">
1365
            <property name="input"/>
1366
            <property name="_location" class="ptolemy.kernel.util.Location" value="{155.0, 265.0}">
1367
            </property>
1368
            <property name="_type" class="ptolemy.actor.TypeAttribute" value="boolean">
1369
            </property>
1370
        </port>
1371
        <entity name="Throw Exception" class="ptolemy.actor.lib.ThrowException">
1372
            <property name="message" class="ptolemy.kernel.util.StringAttribute" value="No data available for selected year">
1373
            </property>
1374
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
1375
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1376
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
1377
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1378
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The ThrowException actor generates an error when it receives a true Boolean token on any channel of its input multiport. The text of the error message is specified by the message parameter.&lt;/p&gt;&#10;&#10;&lt;p&gt;The actor is similar to ThrowModelError, except that the ThrowException actor's generated error is local (i.e., it is thrown at the local hierarchy level). The ThrowModelError will pass the exception up the workflow hierarchy rather than immediately throwing it.&lt;/p&gt;</configure></property>
1379
<property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that receives Boolean tokens. The actor will generate an error message whenever a true token is received on any channel.</configure></property>
1380
<property name="prop:message" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The error message that will be reported.</configure></property>
1381
</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:379:13:2">
1382
            </property>
1383
            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.ThrowException">
1384
                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:932:1">
1385
                </property>
1386
            </property>
1387
            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ExceptionControlActor">
1388
            </property>
1389
            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#ExceptionControl">
1390
            </property>
1391
            <property name="_location" class="ptolemy.kernel.util.Location" value="{335.0, 295.0}">
1392
            </property>
1393
            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:56:1:urn:lsid:gamma.msi.ucsb.edu/OpenAuth/:211:143:276">
1394
            </property>
1395
            <property name="" class="ptolemy.vergil.basic.DocAttribute">
1396
                <property name="description" class="ptolemy.data.expr.StringParameter" value="&lt;p&gt;The ThrowException actor generates an error when it receives a true Boolean token on any channel of its input multiport. The text of the error message is specified by the message parameter.&lt;/p&gt;&#10;&#10;&lt;p&gt;The actor is similar to ThrowModelError, except that the ThrowException actor's generated error is local (i.e., it is thrown at the local hierarchy level). The ThrowModelError will pass the exception up the workflow hierarchy rather than immediately throwing it.&lt;/p&gt;">
1397
                </property>
1398
                <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Edward A. Lee">
1399
                </property>
1400
                <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
1401
                </property>
1402
                <property name="message (parameter)" class="ptolemy.data.expr.StringParameter" value="The error message that will be reported.">
1403
                </property>
1404
                <property name="input (port)" class="ptolemy.kernel.util.StringAttribute" value="A multiport that receives Boolean tokens. The actor will generate an error message whenever a true token is received on any channel.">
1405
                </property>
1406
            </property>
1407
        </entity>
1408
        <relation name="relation" class="ptolemy.actor.TypedIORelation">
1409
        </relation>
1410
        <link port="port" relation="relation"/>
1411
        <link port="Throw Exception.input" relation="relation"/>
1412
    </entity>
1413
    <relation name="relation" class="ptolemy.actor.TypedIORelation">
1414
        <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1415
        </property>
1416
    </relation>
1417
    <relation name="relation3" class="ptolemy.actor.TypedIORelation">
1418
    </relation>
1419
    <relation name="relation4" class="ptolemy.actor.TypedIORelation">
1420
        <property name="width" class="ptolemy.data.expr.Parameter" value="1">
1421
        </property>
1422
    </relation>
1423
    <relation name="relation5" class="ptolemy.actor.TypedIORelation">
1424
    </relation>
1425
    <relation name="relation6" class="ptolemy.actor.TypedIORelation">
1426
    </relation>
1427
    <relation name="relation2" class="ptolemy.actor.TypedIORelation">
1428
    </relation>
1429
    <link port="port" relation="relation5"/>
1430
    <link port="port2" relation="relation6"/>
1431
    <link port="Get year.port" relation="relation2"/>
1432
    <link port="River name lookup table.CacheLocalFileName" relation="relation4"/>
1433
    <link port="PrepareData.allFlowData" relation="relation"/>
1434
    <link port="PrepareData.flowData" relation="relation5"/>
1435
    <link port="PrepareData.rivers" relation="relation4"/>
1436
    <link port="PrepareData.year" relation="relation2"/>
1437
    <link port="PrepareData.stations" relation="relation6"/>
1438
    <link port="PrepareData.dataNotFound" relation="relation3"/>
1439
    <link port="FlowDataEML.allFlowData" relation="relation"/>
1440
    <link port="CheckData.port" relation="relation3"/>
1441
</entity>
1442
<entity name="DisplayFileNames" class="ptolemy.actor.lib.gui.Display">
1443
    <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={326, 527, 869, 95}, maximized=false}">
1444
    </property>
1445
    <property name="_paneSize" class="ptolemy.actor.gui.SizeAttribute" value="[869, 73]">
1446
    </property>
1447
    <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="10">
1448
    </property>
1449
    <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="40">
1450
    </property>
1451
    <property name="suppressBlankLines" class="ptolemy.data.expr.Parameter" value="false">
1452
    </property>
1453
    <property name="title" class="ptolemy.data.expr.StringParameter" value="">
1454
    </property>
1455
<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
1456
<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1457
<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong, Edward A. Lee</configure></property>
1458
<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
1459
<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>&lt;p&gt;The Display actor reads tokens of any type via its input multiport, and displays each token on a separate line in a text display window.&lt;/p&gt;&#10;&#10;&lt;p&gt;Specify the size of the text display window with the rowsDisplayed and columnsDisplayed parameters. Simply resizing the window onscreen does not persistently change the size when the workflow is saved, closed, and then re-opened. &lt;/p&gt;&#10;&#10;&lt;p&gt;If the input is a string token, then the actor strips the surrounding quotation marks before displaying the value.&lt;/p&gt; &#10;&#10;&lt;p&gt;Select the suppressBlankLines parameter to specify that the actor not add blank lines to the display. By default, the actor will add blank lines.&lt;/p&gt;&#10;&#10;&lt;p&gt;Note: this actor can consume large amounts of memory. It is not advisable to use it to display large output streams.&lt;/p&gt;</configure></property>
1460
<property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts tokens of any type.</configure></property>
1461
<property name="prop:suppressBlankLines" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether the actor should display blank lines (the default) or suppress them.</configure></property>
1462
<property name="prop:rowsDisplayed" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical size of the display, in rows. The value is an integer that defaults to 10.</configure></property>
1463
<property name="prop:columnsDisplayed" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal size of the display, in columns. The value is an integer that defaults to 40.</configure></property>
1464
<property name="prop:title" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The title of the text display window. If specified, the value will appear in the title bar of the text display window.</configure></property>
1465
</property>    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:7:1">
1466
    </property>
1467
    <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.gui.Display">
1468
        <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:883:1">
1469
        </property>
1470
    </property>
1471
    <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#TextualOutputActor">
1472
    </property>
1473
    <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#TextualOutput">
1474
    </property>
1475
    <property name="_location" class="ptolemy.kernel.util.Location" value="[375.0, -15.0]">
1476
    </property>
1477
</entity>
1478
<entity name="Plot base flow" class="org.ecoinformatics.seek.R.RExpression">
1479
    <property name="expression" class="ptolemy.kernel.util.StringAttribute" value="plotBaseFlow &lt;- function(aggdf, USING_KEPLER=FALSE) {&#10;	# Plot InFlowRequirements of each river along with the observed flow&#10;	# for that river, during the date range of interest.  We generate 2&#10;	# summary graphs for each river.  First, a RegetzPolygonPlot showing&#10;	# daily flow in relation to the IFR, with acceptable flow shown in&#10;	# gray, and TPC exceedances (or, alternatively unacceptable flow as&#10;	# defined by the IFR) shown in red.  Immediately following this is a&#10;	# boxplot showing the distribution of observed flow by month.  &#10;	&#10;	&#10;	# make list of aggdf by month (but only for for rivers in df)&#10;	flowByMonth &lt;- split(subset(aggdf, select=-river),&#10;			aggdf$river)[unique(aggdf$river)]&#10;	&#10;	# determine year of analysis from the data&#10;	year &lt;- unique(format(aggdf$date, &quot;%Y&quot;))&#10;	if (length(year)!=1) {&#10;		stop(&quot;more than one year included in flow data&quot;)&#10;	}&#10;	&#10;	# define the plot creation function&#10;	ifrplot &lt;- function(dat, river, year, ...) {&#10;		&#10;		# construct plot title&#10;		m &lt;- paste(&quot;River Flow TPC, Base IFR: &quot;, river, &quot; River\n&quot;, sep=&quot;&quot;)&#10;		s &lt;- paste(c(&quot;01-Jan-&quot;, &quot;to 31-Dec-&quot;), year, sep=&quot;&quot;, collapse=&quot; &quot;)&#10;		mtxt &lt;- paste(m, s)&#10;		&#10;		# insert any missing days, then fill in IFR for corresponding month&#10;		allDates &lt;- data.frame(date=seq(min(dat$date), max(dat$date), by=1))&#10;		dat &lt;- merge(allDates, dat, all.x=TRUE)&#10;		ifrToFill &lt;- months(dat$date[is.na(dat$ifr)], abbreviate=TRUE)&#10;		dat$ifr[is.na(dat$ifr)] &lt;- dat$ifr[match(ifrToFill, dat$month)]&#10;		&#10;		# if max flow &gt;200, plot log10 values instead&#10;		if(max(dat$flow, na.rm=TRUE)&lt;=200) {&#10;			ytxt &lt;- expression(paste(&quot;flow &quot;, bgroup(&quot;(&quot;, frac(m^3, s), &quot;)&quot; ) ) )&#10;			flow &lt;- dat$flow&#10;			ifr &lt;- dat$ifr&#10;		} else {&#10;			ytxt &lt;- expression(paste(log[10], &quot; flow + 1&quot;,&#10;							bgroup(&quot;(&quot;, frac(m^3, s), &quot;)&quot; ) ) )&#10;			flow &lt;- log10(dat$flow + 1)&#10;			ifr &lt;- log10(dat$ifr + 1)&#10;		}&#10;		&#10;		plot(dat$date, flow, type=&quot;n&quot;, main=mtxt, ylab=ytxt)&#10;		&#10;		# color area between observed flow and IFR, using red if observed&#10;		# flow is below IFR and gray if it is above. if flow is NA, use IFR&#10;		# value (thus no shading will appear)&#10;		flow[is.na(dat$flow)] &lt;- ifr[is.na(dat$flow)]&#10;		polygon(c(dat$date, rev(dat$date)), c(ifr,&#10;						rev(ifelse(flow &lt; ifr, flow, ifr))), border=NA,&#10;				col=&quot;red&quot;)&#10;		polygon(c(dat$date, rev(dat$date)), c(ifr,&#10;						rev(ifelse(flow &gt; ifr, flow, ifr))), border=NA,&#10;				col=&quot;gray&quot;)&#10;		&#10;		# add lines for the flow and ifr, but skipping NA values&#10;		ifr[is.na(dat$flow)] &lt;- NA&#10;		flow[is.na(dat$flow)] &lt;- NA&#10;		lines(dat$date, flow)&#10;		lines(dat$date, ifr, lwd=2)&#10;		&#10;		# create and place a legend&#10;		legend(&quot;topright&quot;, legend=c(&quot;base IFR&quot;, &quot;below IFR&quot;, &quot;above IFR&quot;),&#10;				lty=c(1, NA, NA), lwd=c(2, NA, NA), pch=c(NA, 22, 22),&#10;				pt.bg=c(NA, &quot;red&quot;, &quot;gray&quot;), pt.cex=c(NA, 2, 2),  bty=&quot;n&quot; )&#10;		&#10;	}&#10;	&#10;	# define the plot creation function&#10;	ifrboxplot &lt;- function(dat, river, year, ...) {&#10;		&#10;		# construct plot title&#10;		m &lt;- paste(&quot;River Flow TPC, Base IFR: &quot;, river, &quot; River\n&quot;, sep=&quot;&quot;)&#10;		s &lt;- paste(c(&quot;01-Jan-&quot;, &quot;to 31-Dec-&quot;), year, sep=&quot;&quot;, collapse=&quot; &quot;)&#10;		mtxt &lt;- paste(m, s)&#10;		&#10;		# insert any missing days, then fill in IFR for corresponding month&#10;		allDates &lt;- data.frame(date=seq(min(dat$date), max(dat$date), by=1))&#10;		dat &lt;- merge(allDates, dat, all.x=TRUE)&#10;		ifrToFill &lt;- months(dat$date[is.na(dat$ifr)], abbreviate=TRUE)&#10;		dat$ifr[is.na(dat$ifr)] &lt;- dat$ifr[match(ifrToFill, dat$month)]&#10;		&#10;		# if max flow &gt;200, plot log10 values instead&#10;		if(max(dat$flow, na.rm=TRUE)&lt;=200) {&#10;			ytxt &lt;- expression(paste(&quot;flow &quot;, bgroup(&quot;(&quot;, frac(m^3, s), &quot;)&quot; ) ) )&#10;			flow &lt;- dat$flow&#10;			ifr &lt;- dat$ifr&#10;		} else {&#10;			ytxt &lt;- expression(paste(log[10], &quot; flow + 1&quot;,&#10;							bgroup(&quot;(&quot;, frac(m^3, s), &quot;)&quot; ) ) )&#10;			flow &lt;- log10(dat$flow + 1)&#10;			ifr &lt;- log10(dat$ifr + 1)&#10;		}&#10;				&#10;		# color area between observed flow and IFR, using red if observed&#10;		# flow is below IFR and gray if it is above. if flow is NA, use IFR&#10;		# value (thus no shading will appear)&#10;		flow[is.na(dat$flow)] &lt;- ifr[is.na(dat$flow)]&#10;&#10;		#### new plot here ############&#10;		&#10;		# reorder the levels of month in dat so that boxplot doesn't plot&#10;		# monthly data alphabetically&#10;		dat$month &lt;- factor(dat$month, levels = month.abb)&#10;		boxplot(flow~dat$month, main=mtxt, ylab=ytxt)&#10;		&#10;		# add asterices for monthly ifrs&#10;		points(dat$month, ifr, pch=8, col=&quot;red&quot;)&#10;		legend(&quot;topright&quot;, legend=c(&quot;Monthly flow summary&quot;, &quot;Monthly IFR&quot;),&#10;				pch=c(22, 8), col=c(&quot;black&quot;, &quot;red&quot;), pt.cex=c(2, 1), bty=&quot;n&quot; )&#10;		&#10;	}&#10;	&#10;	# plot graphs of daily flow, along with flow boxplots&#10;	i &lt;- 1&#10;	fnames &lt;- c()&#10;	for (river in names(flowByMonth)) {&#10;		# first plot&#10;		fname &lt;- paste(getwd(), &quot;/plot_&quot;, river, &quot;_&quot;, i, &quot;.png&quot;, sep=&quot;&quot;)&#10;		fnames[i] &lt;- fname&#10;		# open png device with river-specific filename&#10;		png(file=fname, width=792, height=612)&#10;		par(mai=c(0.75, 1.25, 0.75, 0.75))&#10;		# plot&#10;		ifrplot(flowByMonth[[river]], river, year)&#10;		# Close output device&#10;		dev.off()&#10;		i &lt;- i + 1&#10;		&#10;		# second plot&#10;		fname &lt;- paste(getwd(), &quot;/plot_&quot;, river, &quot;_&quot;, i, &quot;.png&quot;, sep=&quot;&quot;)&#10;		fnames[i] &lt;- fname&#10;		# open png device with river-specific filename&#10;		png(file=fname)&#10;		par(mai=c(0.75, 1.25, 0.75, 0.75))&#10;		# plot&#10;		ifrboxplot(flowByMonth[[river]], river, year)&#10;		# Close output device&#10;		dev.off()&#10;		i &lt;- i + 1&#10;	}&#10;	&#10;	return(list(fnames=fnames))&#10;}&#10;&#10;ans &lt;- plotBaseFlow(aggFlowData, USING_KEPLER=TRUE) &#10;invisible(lapply(names(ans), function(nm) assign(nm, ans[[nm]], envir=.GlobalEnv)))">
1480
        <display name="R function or script"/>
1481
        <property name="R Expression" class="ptolemy.actor.gui.style.TextStyle">
1482
            <property name="height" class="ptolemy.data.expr.Parameter" value="10">
1483
            </property>
1484
            <property name="width" class="ptolemy.data.expr.Parameter" value="30">
1485
            </property>
1486
        </property>
1487
    </property>
1488
    <property name="_editorFactory" class="ptolemy.vergil.toolbox.TextEditorTableauFactory">
1489
        <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="expression">
1490
        </property>
1491
        <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="80">
1492
        </property>
1493
        <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="40">
1494
        </property>
1495
    </property>
1496
    <property name="Rcwd" class="ptolemy.data.expr.StringParameter" value="/home/regetz/.kepler/">
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff