Comparing Quantities
Created: 2011-09-23 13:32:16
This workflow receives the name of the property to compare, a file with a list of names of galaxies, and a file with the list of original values of that property. The property name must be the same used in the VOtable returned by the Vizier service.
The workflow calls to sesame name resolver using as input the names of the galaxies and gets the coordinates. Then it calls to Vizier service and provides to it with the coordinates as input, in order to get a VOTable with information about each galaxy. From each VOTable, it extracts the value of the property selected by the user and then compares this values with the values provided by the file with the original values.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Descriptions (1)
This workflow receives the name of the property to compare, a file with a list of names of galaxies, and a file with the list of original values of that property. The property name must be the same used in the VOtable returned by the Vizier service.
The workflow calls to sesame name resolver using as input the names of the galaxies and gets the coordinates. Then it calls to Vizier service and provides to it with the coordinates as input, in order to get a VOTable with information about each galaxy. From each VOTable, it extracts the value of the property selected by the user and then compares this values with the values provided by the file with the original values.
|
Dependencies (0)
Inputs (1)
Name |
Description |
property |
|
Processors (23)
Name |
Type |
Description |
REST_Service |
rest |
|
extractSearchParam |
externaltool |
|
Write_Text_File |
localworker |
Script
BufferedWriter out;
if (encoding == void) {
out = new BufferedWriter(new FileWriter(outputFile));
}
else {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), encoding));
}
out.write(filecontents);
out.flush();
out.close();
outputFile = filecontents;
|
encoding_value_1 |
stringconstant |
Valueutf-8 |
outputFile_value |
stringconstant |
Valuefiletmp.txt |
REST_Service_2 |
rest |
|
Write_Text_File_2 |
localworker |
Script
BufferedWriter out;
if (encoding == void) {
out = new BufferedWriter(new FileWriter(outputFile));
}
else {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), encoding));
}
out.write(filecontents);
out.flush();
out.close();
outputFile = filecontents;
|
outputFile_value_1 |
stringconstant |
Valuevotable.xml |
extractQuantity |
externaltool |
|
readLinesFile |
workflow |
|
Names_galaxies |
stringconstant |
ValueEnter file with the name of galaxies list |
filtering_and_extract_only_float_number |
localworker |
Scriptimport java.util.regex.*;
filteredlist = new ArrayList();
Pattern thePat = Pattern.compile(regex);
int theGroup = Integer.parseInt(group);
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
Matcher matcher = thePat.matcher(item);
if (matcher.find()) {
filteredlist.add(matcher.group(theGroup));
}
}
|
regex_value |
stringconstant |
Value\[\s*(-?[0-9]+\.[0-9]+)\s*\] |
group_value |
stringconstant |
Value1 |
Merge_String_List_to_a_String |
localworker |
ScriptString seperatorString = "\n";
if (seperator != void) {
seperatorString = seperator;
}
StringBuffer sb = new StringBuffer();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
sb.append(item);
if (i.hasNext()) {
sb.append(seperatorString);
}
}
concatenated = sb.toString();
|
seperator_value |
stringconstant |
Value* |
Write_Text_File_3 |
localworker |
Script
BufferedWriter out;
if (encoding == void) {
out = new BufferedWriter(new FileWriter(outputFile));
}
else {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), encoding));
}
out.write(filecontents);
out.flush();
out.close();
outputFile = filecontents;
|
outputFile_value_2 |
stringconstant |
ValueBMagnitude.txt |
Select_File |
localworker |
Scriptimport java.awt.CardLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.filechooser.FileFilter;
class FileExtFilter extends FileFilter {
public FileExtFilter(String ext, String label, boolean includeDir) {
this.ext = ext;
this.label = label;
this.includeDir = includeDir;
}
public String getDescription() {
return this.label;
}
public boolean accept(File file) {
if (file.isDirectory() && includeDir) {
return true;
} else {
return file.getName().endsWith(this.ext);
}
}
String ext, label;
boolean includeDir;
}
if (title == void) {
title = null;
}
if ((fileExtensions == void) || (fileExtensions == null)) {
fileExtensions = "";
}
if ((fileExtLabels == void) || (fileExtLabels == null)) {
fileExtLabels = "";
}
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle(title);
String[] fileTypeList = fileExtensions.split(",");
String[] filterLabelList = fileExtLabels.split(",");
if (fileTypeList != null && filterLabelList != null && fileTypeList.length != filterLabelList.length) {
throw new RuntimeException("The list of extensions and file filter labels must be the same length");
}
// create the file filters
for (int i = 0; i < fileTypeList.length; i++) {
FileExtFilter filter = new FileExtFilter(fileTypeList[i], filterLabelList[i], true);
chooser.setFileFilter(filter);
}
chooser.showOpenDialog(null);
File file = chooser.getSelectedFile();
selectedFile = file.getAbsolutePath();
|
fileExtensions_value |
stringconstant |
Valuetxt |
fileExtLabels_value |
stringconstant |
Valuetxt |
title_value |
stringconstant |
ValueEnter local file with the list of quantities |
Tool |
externaltool |
|
Outputs (2)
Name |
Description |
remoteValues |
|
comparingFile |
|
Datalinks (27)
Source |
Sink |
readLinesFile:lines |
REST_Service:object_name |
Write_Text_File:outputFile |
extractSearchParam:filetmp |
encoding_value_1:value |
Write_Text_File:encoding |
REST_Service:responseBody |
Write_Text_File:filecontents |
outputFile_value:value |
Write_Text_File:outputFile |
extractSearchParam:STDOUT |
REST_Service_2:searchParam |
encoding_value_1:value |
Write_Text_File_2:encoding |
REST_Service_2:responseBody |
Write_Text_File_2:filecontents |
outputFile_value_1:value |
Write_Text_File_2:outputFile |
Write_Text_File_2:outputFile |
extractQuantity:votable |
property |
extractQuantity:property |
Names_galaxies:value |
readLinesFile:title |
regex_value:value |
filtering_and_extract_only_float_number:regex |
extractQuantity:STDOUT |
filtering_and_extract_only_float_number:stringlist |
group_value:value |
filtering_and_extract_only_float_number:group |
filtering_and_extract_only_float_number:filteredlist |
Merge_String_List_to_a_String:stringlist |
seperator_value:value |
Merge_String_List_to_a_String:seperator |
encoding_value_1:value |
Write_Text_File_3:encoding |
Merge_String_List_to_a_String:concatenated |
Write_Text_File_3:filecontents |
outputFile_value_2:value |
Write_Text_File_3:outputFile |
fileExtensions_value:value |
Select_File:fileExtensions |
fileExtLabels_value:value |
Select_File:fileExtLabels |
title_value:value |
Select_File:title |
Select_File:selectedFile |
Tool:MBLocal |
Write_Text_File_3:outputFile |
Tool:MBRemote |
Write_Text_File_3:outputFile |
remoteValues |
Tool:MBComparing |
comparingFile |
Uploader
License
All versions of this Workflow are
licensed under:
BSD License
Version 1
(of 1)
Credits (0)
(People/Groups)
None
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
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment