Average solar wind speed at ACE
Created: 2014-01-13 14:13:14
This routine returns the average solar wind speed from ACE data given an input time interval.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Anja Le Blanc
Nataliya Bourrel
Andrii Lynnyk |
Titles (1)
MDES simple execution - Obtain data from a mission |
Descriptions (1)
MDES provide access to certain heliospheric missions available at AMDA. This obtain the data for a certain time range and a mission name. |
Dependencies (0)
Inputs (2)
Name |
Description |
STARTTIME |
starttime of time intervall
|
ENDTIME |
endtime of time interval
|
Processors (16)
Name |
Type |
Description |
LongTimeQuery_output |
xmlsplitter |
|
GetStatus |
wsdl |
Wsdlhttp://manunja.cesr.fr/Amda-Helio/WebServices/HelioLongQueryService.wsdlWsdl OperationGetStatus |
GetStatus_input |
xmlsplitter |
|
GetStatus_output |
xmlsplitter |
|
GetResult |
wsdl |
Wsdlhttp://manunja.cesr.fr/Amda-Helio/WebServices/HelioLongQueryService.wsdlWsdl OperationGetResult |
GetResult_input |
xmlsplitter |
|
GetResult_output |
xmlsplitter |
|
ExceptionHandling |
beanshell |
Scriptif(status.matches(".*ERROR.*")){
throw new Exception("error");
} |
LongTimeQuery |
wsdl |
Wsdlhttp://manunja.cesr.fr/Amda-Helio/WebServices/HelioLongQueryService.wsdlWsdl OperationLongTimeQuery |
LongTimeQuery_input |
xmlsplitter |
|
XPath_Service |
xpath |
Xpath Expression/ResultInfo/resultURI |
Beanshell |
beanshell |
Scripturl = url_list.get(0) |
Url_to_dataurl |
beanshell |
modify URL to the URL where the data resides. Scripturl_out = url_list.get(0).replaceFirst(".xml","data.asc") |
Read_Text_File |
localworker |
ScriptBufferedReader getReader (String fileUrl, String encoding) throws IOException {
InputStreamReader reader;
try {
if (encoding == null) {
reader = new FileReader(fileUrl);
} else {
reader = new InputStreamReader(new FileInputStream(fileUrl),encoding);
}
}
catch (FileNotFoundException e) {
// try a real URL instead
URL url = new URL(fileUrl);
if (encoding == null) {
reader = new InputStreamReader (url.openStream());
} else {
reader = new InputStreamReader (url.openStream(), encoding);
}
}
return new BufferedReader(reader);
}
StringBuffer sb = new StringBuffer(4000);
if (encoding == void) {
encoding = null;
}
BufferedReader in = getReader(fileurl, encoding);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
Beanshell_AverageSpeed |
beanshell |
ScriptString content = text;
String[] lines = content.split("\\n");
double[] velocities = new double[lines.length-2];
double vel_tot = 0;
double vel_av = 0;
int samplesNumber = 0;
for(int n = 2; n < lines.length; n++)
{
String[] values = lines[n].split("\\s+");
System.out.println("Velocity [" + n + "] : " + values[1]);
if(!Double.valueOf(values[1]).isNaN())
{
velocities[samplesNumber] = Double.valueOf(values[1]);
vel_tot += Double.valueOf(values[1]);
samplesNumber++;
}
}
vel_av = vel_tot/samplesNumber;
debug=content; |
Text_constant |
stringconstant |
ValueACE |
Beanshells (4)
Name |
Description |
Inputs |
Outputs |
ExceptionHandling |
|
status
|
|
Beanshell |
|
url_list
|
url
|
Url_to_dataurl |
modify URL to the URL where the data resides. |
url_list
|
url_out
|
Beanshell_AverageSpeed |
|
text
|
debug
vel_av
|
Outputs (2)
Name |
Description |
url |
|
average_sw_speed |
|
Datalinks (19)
Source |
Sink |
GetStatus_input:output |
GetStatus:parameters |
LongTimeQuery_output:ID |
GetStatus_input:ID |
GetStatus:parameters |
GetStatus_output:input |
GetResult_input:output |
GetResult:parameters |
LongTimeQuery_output:ID |
GetResult_input:ID |
GetResult:parameters |
GetResult_output:input |
GetStatus_output:Status |
ExceptionHandling:status |
LongTimeQuery_input:output |
LongTimeQuery:parameters |
ENDTIME |
LongTimeQuery_input:ENDTIME |
STARTTIME |
LongTimeQuery_input:STARTTIME |
Text_constant:value |
LongTimeQuery_input:FROM |
GetResult_output:ResultInfo |
XPath_Service:xml_text |
XPath_Service:nodelist |
Beanshell:url_list |
Beanshell:url |
Url_to_dataurl:url_list |
Url_to_dataurl:url_out |
Read_Text_File:fileurl |
Read_Text_File:filecontents |
Beanshell_AverageSpeed:text |
LongTimeQuery:parameters |
LongTimeQuery_output:input |
Beanshell:url |
url |
Beanshell_AverageSpeed:vel_av |
average_sw_speed |
Coordinations (1)
Controller |
Target |
ExceptionHandling |
GetResult |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (0)
None
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(6)
Only the first 2 workflows that use similar services are shown. View all workflows that use these services.
Comments (0)
No comments yet
Log in to make a comment