Run galfit using a votable
Created: 2012-07-26 12:20:52
Last updated: 2012-09-07 12:39:42
It runs galfit and adjust the paramenters specified. This workflow has a dependency on the stil library (http://www.star.bris.ac.uk/~mbt/stil/). Galfit is called by a bash script as 'galfit'. Galfit is called for every row in the votable. Columns where the result file name and the configuration 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 galfit using a votable |
Descriptions (1)
It runs galfit and adjust the paramenters specified. This workflow has a dependency on the stil library (http://www.star.bris.ac.uk/~mbt/stil/). Galfit is called by a bash script as 'galfit'. Galfit is called for every row in the votable. Columns where the result file name and the configuration 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 (5)
Name |
Description |
ColumnNameWithConfigFile |
|
ColumnNameWithNewConfigFile |
|
ExperimentFolder |
main working folder
|
votable |
|
Precedence |
|
Processors (2)
Name |
Type |
Description |
Create_galfit_script |
beanshell |
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(columnNameWithConfigFile)==null)
throw new Exception(columnNameWithConfigFile+" is not a column on the votable");
if(mapping.get(columnNameWithNewConfigFile)==null)
throw new Exception(columnNameWithNewConfigFile+" 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(columnNameWithConfigFile) );
String fileName2 = (String) rseq.getCell( (int) mapping.get(columnNameWithNewConfigFile) );
script += "galfit " + fileName + "\n";
script += "mv $orig "+ fileName2 + "\n";
}
rseq.close();
}catch (Exception ex){
script = "Exception during the process: \n"+ ex.getMessage();
throw new Exception(script);
} |
RunGalfit |
externaltool |
|
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
Create_galfit_script |
|
votable
columnNameWithNewConfigFile
columnNameWithConfigFile
experimentFolder
|
script
|
Outputs (2)
Name |
Description |
Tool_STDOUT |
|
Tool_STDERR |
|
Datalinks (7)
Source |
Sink |
ColumnNameWithConfigFile |
Create_galfit_script:columnNameWithConfigFile |
ColumnNameWithNewConfigFile |
Create_galfit_script:columnNameWithNewConfigFile |
ExperimentFolder |
Create_galfit_script:experimentFolder |
votable |
Create_galfit_script:votable |
Create_galfit_script:script |
RunGalfit:script |
RunGalfit:STDOUT |
Tool_STDOUT |
RunGalfit:STDERR |
Tool_STDERR |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1 (earliest)
(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