Run sextractor using a votable
Created: 2012-07-26 11:23:30
Last updated: 2012-09-07 12:25:41
It runs sextractor and adjust the paramenters specified.
This workflow has a dependency on the stil library (http://www.star.bris.ac.uk/~mbt/stil/).
Sextractor is called by an bash script as 'sex'.
Sextractor is called for every row in the votable.
Columns where the configuration file and the image file name are defined must be especified.
These files should be accesibles from taverna.
ExperimentFolder provides the root folder for the experiment.
If the configuration files contain references to other files, they must be accesible from taverna.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Run sextractor using a votable |
Descriptions (1)
It runs sextractor and adjust the paramenters specified.
This workflow has a dependency on the stil library (http://www.star.bris.ac.uk/~mbt/stil/).
Sextractor is called by an bash script as 'sex'.
Sextractor is called for every row in the votable.
Columns where the configuration file and the image file name are defined must be especified.
These files should be accesibles from taverna.
ExperimentFolder provides the root folder for the experiment.
If the configuration files contain references to other files, they must be accesible from taverna. |
Dependencies (1)
Inputs (4)
Name |
Description |
ColumnNameImageFile |
|
ColumnNameWithConfigFile |
|
votable |
|
Precedence |
|
Processors (2)
Name |
Type |
Description |
Create_sextractor_script |
beanshell |
It creates a script that call sextractor (sex) for every row in the votable. This beanshell requires stil library Scriptimport java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
import java.util.regex.Pattern;
import uk.ac.starlink.table.ColumnInfo;
import uk.ac.starlink.table.RowSequence;
import uk.ac.starlink.table.StarTable;
import uk.ac.starlink.table.StarTableFactory;
public StarTable loadVOTable( File file ) throws IOException {
return new StarTableFactory().makeStarTable( file.toString(), "votable" );
}
void writeStringToAFile(String filepath, String content) throws IOException{
BufferedWriter out = new BufferedWriter(new FileWriter(filepath));
out.write(content);
out.close();
}
String fileVotablePath = "";
File tmpfile = File.createTempFile("astro", null);
FileWriter writer = new FileWriter(tmpfile);
writer.write(votable);
writer.close();
fileVotablePath = tmpfile.getAbsolutePath();
script = "";
Map mapping = new HashMap();
Vector mappingPos = new Vector();
//Map mappingIds = new HashMap();
int nCol;
try{
//open the table
File file = new File(fileVotablePath);
StarTable table = loadVOTable(file);
//get the column info
nCol = table.getColumnCount();
for(int i =0; i< nCol; i++){
ColumnInfo colInfo = table.getColumnInfo(i);
mapping.put(colInfo.getName(), i); //names to positions
mappingPos.add(colInfo.getName()); //positions to names
}
if(mapping.get(columnNameImageFile)==null)
throw new Exception(columnNameImageFile+" is not a column on the votable");
if(mapping.get(columnNameWithConfigFile)==null)
throw new Exception(columnNameWithConfigFile+" is not a column on the votable");
script="#!/bin/bash \n";// +
//"cd " + experimentFolder + " \n" +
//"path=$(pwd) \n"; //+
//"file=\"/galfit.01\" \n" +
//"orig=$path$file \n";
RowSequence rseq = table.getRowSequence();
while ( rseq.next() ) {
String fileName = (String) rseq.getCell( (int) mapping.get(columnNameImageFile) );
String fileName2 = (String) rseq.getCell( (int) mapping.get(columnNameWithConfigFile) );
script += "sex " + fileName + " -c " +fileName2+ "\n";
}
rseq.close();
}catch (Exception ex){
script = "Exception during the process: \n"+ ex.getMessage();
throw new Exception(script);
} |
RunSextractor |
externaltool |
It runs the script that receives as input. In order to make the script runnable, it uses chmod |
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
Create_sextractor_script |
It creates a script that call sextractor (sex) for every row in the votable. This beanshell requires stil library |
votable
columnNameWithConfigFile
columnNameImageFile
|
script
|
Outputs (2)
Name |
Description |
Tool_STDOUT |
|
Tool_STDERR |
|
Datalinks (6)
Source |
Sink |
votable |
Create_sextractor_script:votable |
ColumnNameImageFile |
Create_sextractor_script:columnNameImageFile |
ColumnNameWithConfigFile |
Create_sextractor_script:columnNameWithConfigFile |
Create_sextractor_script:script |
RunSextractor:script |
RunSextractor:STDOUT |
Tool_STDOUT |
RunSextractor:STDERR |
Tool_STDERR |
Uploader
License
All versions of this Workflow are
licensed under:
Version 2 (latest)
(of 2)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (1)
(Workflows/Files)
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