Find instruments of a special type in a section of space described in HCI coordinates
Created: 2011-08-24 10:33:26
Last updated: 2011-08-24 10:33:30
This workflow takes a type of isnstrument as input and the minimum and maxium coordinates in HCI as input. Cadence for the location service is for defining the 'continues' presence.
Output is a VOTable based on the ICS return where two columns are added for the time this instrument has entered and exited the Region of Interest.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Find instruments of a special type in a section of space described in HCI coordinates |
Descriptions (1)
This workflow takes a type of isnstrument as input and the minimum and maxium coordinates in HCI as input. Cadence for the location service is for defining the 'continues' presence.
Output is a VOTable based on the ICS return where two columns are added for the time this instrument has entered and exited the Region of Interest. |
Dependencies (0)
Inputs (8)
Name |
Description |
r_hci_1 |
minimum radius in HCI
|
r_hci_2 |
maximum radius in HCI
|
long_hci_1 |
minimal longitude in HCI
|
long_hci_2 |
maximum longitude in HCI
|
lat_hci_1 |
minium latitude in HCI
|
lat_hci_2 |
maximum latitude in HCI
|
instrument_type |
Type of instrument
this term must be included in 'keywords' fo the ICS
|
allowdCadence |
Cadence in hours.
ILS contains entries for planets and observatories in regular intervals. The cadence can different depending on how fast a target object is moving. Most target objects have a cadence of one day.
|
Processors (23)
Name |
Type |
Description |
ICS |
wsdl |
Wsdlhttp://msslxw.mssl.ucl.ac.uk:8080/helio-ics/HelioTavernaService?wsdlWsdl OperationQuery |
Query_query |
xmlsplitter |
|
FROM_value |
stringconstant |
Valueinstrument |
construct_where_ics |
beanshell |
Scriptwhere_string = "keywords,*"+instrument_type+"*"; |
Extract_content_of_columns_from_VOTables |
workflow |
|
ColumnNames_value |
stringconstant |
Valueobservatory_name |
Remove_String_Duplicates |
localworker |
ScriptList strippedlist = new ArrayList();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
if (strippedlist.contains(item) == false) {
strippedlist.add(item);
}
}
|
ILS |
wsdl |
Wsdlhttp://msslxw.mssl.ucl.ac.uk:8080/helio-ils/HelioTavernaService?wsdlWsdl OperationQuery |
ILS_query |
xmlsplitter |
|
FROM_value_1 |
stringconstant |
Valuetrajectories |
construct_where_ils |
beanshell |
Scriptwhere_string = new ArrayList();
String tmp= "r_hci,"+r1+"/"+r2+";long_hci,"+long1+"/"+long2+";lat_hci,"+lat1+"/"+lat2+";target_obj,";
coord_constraint="r_hci,"+r1+"/"+r2+";long_hci,"+long1+"/"+long2+";lat_hci,"+lat1+"/"+lat2;
for(int i=0; i |
remove_empty_results |
beanshell |
Scriptvotable_out = new ArrayList();
for (int i =0; i< votable_in.size(); i++) {
if(votable_in.get(i).indexOf("")!=-1) {
votable_out.add(votable_in.get(i));
}
}
time |
stringconstant |
Valuetime |
target_obj |
stringconstant |
Valuetarget_obj |
parseVOTable |
beanshell |
Scriptimport java.io.StringReader;
import java.util.Hashtable;
import org.w3c.dom.*;
import org.xml.sax.InputSource;
import org.apache.xerces.parsers.DOMParser;
private void getPositions(){
NodeList nodesVO = docVO.getElementsByTagName("FIELD");
for(int i=0; i< nodesVO.getLength(); i++){
Element voFieldNode = nodesVO.item(i);
String name = voFieldNode.getAttribute("name");
for(int j = 0; j< collumn.size(); j++){
if(name.trim().equals(collumn.get(j).trim())){
positions.put(collumn.get(j), i);
debug = debug.concat("\npos " + i+ "\n");
}
}
}
}
private void findValues(){
String[] tr = voTable.split("");
debug= debug.concat("length tr " + tr.length + "\n");
for(int i = 1; i< tr.length; i++)
{
String[] td = tr[i].split("");
debug= debug.concat("length td " + td.length + "\n");
for(int j =0; j< collumn.size();j++){
String value = td[positions.get(collumn.get(j))+1];
debug= debug.concat(" value " + value.trim().length() + "\n");
if(value!=null && value.trim().length()>0){
valueLists.get(j).add(value.substring(0,value.lastIndexOf("<")));
} else
{
valueLists.get(j).add("");
}
}
}
}
Hashtable positions= new Hashtable();
List valueLists = new ArrayList();
for(int i=0;i
getObservatory |
beanshell |
Scriptimport java.util.Hashtable;
private void getPositions(){
//NodeList nodesVO = docVO.getElementsByTagName("FIELD");
int pos =0;
int pos2 =0;
int i=0;
while((pos2=voTable.indexOf("");
debug= debug.concat("length tr " + tr.length + "\n");
for(int i = 1; i< tr.length; i++)
{
String[] td = tr[i].split("");
debug= debug.concat("length td " + td.length + "\n");
String value = td[position+1];
debug= debug.concat(" value " + value.trim().length() + " " + value + "\n");
if(value!=null && value.trim().length()>0){
valueOut=value.substring(0,value.lastIndexOf("<"));
return;
}
}
}
int position = -1;
String debug = "debug";
valueOut = new String();
try {
this.getPositions();
if(position==-1){
return;
}
this.findValues();
}
catch (Exception e){
debug= debug+ e.toString();
}
|
generateTimeIntervals |
beanshell |
Scriptimport java.text.SimpleDateFormat;
time_intervals= new ArrayList();
int cad = Integer.parseInt(cadence);
cad = cad *60 *60 *1000; //milliseconds
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
long cur;
long pre_cur=0;
long start=0;
int start_pos=0;
for(int i = 0; i< times.size(); i++) {
cur=sdf.parse(times.get(i)+"+0000").getTime();
if(start == 0) {
start_pos = i;
start =cur;
pre_cur = cur;
}
if(pre_cur + cad < cur) {
ArrayList list = new ArrayList();
list.add(times.get(start_pos));
list.add(times.get(i-1));
time_intervals.add(list);
start_pos = i;
start =cur;
}
pre_cur = cur;
}
//last
ArrayList list = new ArrayList();
list.add(times.get(start_pos));
list.add(times.get(times.size()-1));
time_intervals.add(list);
|
CreateVOTable |
beanshell |
Scriptint findLastNode(String VOTable, String node) {
int pos = VOTable.lastIndexOf("<"+node);
int pos2 = VOTable.indexOf(">",pos);
if(VOTable.charAt(pos2-1)=='/'){
return pos2+1;
}
return (VOTable.lastIndexOf(new String(""+node+">"))+node.length()+3);
}
int findField(String name) {
String[] parts = ics_votable.split("";
String paraField1 = "\n\n";
votable_out = ics_votable.substring(0, findLastNode(ics_votable, "INFO"))+"\n";
votable_out = votable_out+infoField+paraField1;
votable_out = votable_out + ics_votable.substring(findLastNode(ics_votable,"INFO"), ics_votable.indexOf("\n "+
"Time when observatory entered region of interest\n"+
"";
String endtimeField = "\n\n "+
"Time when observatory exited region of interest\n"+
"\n";
votable_out = votable_out + ics_votable.substring(ics_votable.indexOf(""));
for(int i=1; i")+1,obs.indexOf("<"));
int index=-1;
for(int j=0;j"+time_intervals.get(index).get(0).get(j).get(0)+" | \n"+
" "+time_intervals.get(index).get(0).get(j).get(1)+" | \n"+
" \n";
}
}
}
void closeVOTable(){
votable_out = votable_out + ics_votable.substring(findLastNode(ics_votable, "TR")+1);
}
votable_out=new String();
int pos=findField("observatory_name");
addInfo();
addFieldnames();
writeValues(pos);
closeVOTable(); |
construct_where_ics_2 |
beanshell |
Scriptwhere_string = "keywords,*"+instrument_type+"*;observatory_name,";
for (int i =0; i< observatories.size(); i++) {
where_string = where_string +observatories.get(i);
if(i |
ICS2 |
wsdl |
Wsdlhttp://msslxw.mssl.ucl.ac.uk:8080/helio-ics/HelioTavernaService?wsdlWsdl OperationQuery |
ICS2_query |
xmlsplitter |
|
FlattenList |
beanshell |
Scriptlist4= new ArrayList();
for(int i=0; i |
returnVOTable |
beanshell |
ScriptVOTable=list3.get(0).get(0).get(0); |
|
Beanshells (11)
Name |
Description |
Inputs |
Outputs |
construct_where_ics |
|
instrument_type
|
where_string
|
construct_where_ils |
|
r1
r2
long1
long2
lat1
lat2
obs
|
where_string
coord_constraint
|
remove_empty_results |
|
votable_in
|
votable_out
|
parseVOTable |
|
voTable
collumn
|
valueLists
debug
collumn
|
getObservatory |
|
voTable
collumn
|
valueOut
debug
|
generateTimeIntervals |
|
times
cadence
|
time_intervals
|
CreateVOTable |
|
observatories
time_intervals
ics_votable
constraint
|
votable_out
|
construct_where_ics_2 |
|
instrument_type
observatories
|
where_string
|
FlattenList |
|
list5
|
list4
|
returnVOTable |
|
list3
|
VOTable
|
parseVOTable |
|
voTable
collumn
|
valueLists
debug
collumn
|
Datalinks (36)
Source |
Sink |
Query_query:output |
ICS:query |
FROM_value:value |
Query_query:FROM |
construct_where_ics:where_string |
Query_query:WHERE |
instrument_type |
construct_where_ics:instrument_type |
ICS:response |
Extract_content_of_columns_from_VOTables:VOTable |
ColumnNames_value:value |
Extract_content_of_columns_from_VOTables:ColumnNames |
Extract_content_of_columns_from_VOTables:ValueLists |
Remove_String_Duplicates:stringlist |
ILS_query:output |
ILS:query |
FROM_value_1:value |
ILS_query:FROM |
construct_where_ils:where_string |
ILS_query:WHERE |
lat_hci_1 |
construct_where_ils:lat1 |
lat_hci_2 |
construct_where_ils:lat2 |
long_hci_2 |
construct_where_ils:long2 |
long_hci_1 |
construct_where_ils:long1 |
r_hci_1 |
construct_where_ils:r1 |
r_hci_2 |
construct_where_ils:r2 |
Remove_String_Duplicates:strippedlist |
construct_where_ils:obs |
ILS:response |
remove_empty_results:votable_in |
remove_empty_results:votable_out |
parseVOTable:voTable |
time:value |
parseVOTable:collumn |
remove_empty_results:votable_out |
getObservatory:voTable |
target_obj:value |
getObservatory:collumn |
allowdCadence |
generateTimeIntervals:cadence |
parseVOTable:valueLists |
generateTimeIntervals:times |
getObservatory:valueOut |
CreateVOTable:observatories |
ICS2:response |
CreateVOTable:ics_votable |
construct_where_ils:coord_constraint |
CreateVOTable:constraint |
FlattenList:list4 |
CreateVOTable:time_intervals |
instrument_type |
construct_where_ics_2:instrument_type |
getObservatory:valueOut |
construct_where_ics_2:observatories |
ICS2_query:output |
ICS2:query |
construct_where_ics_2:where_string |
ICS2_query:WHERE |
FROM_value:value |
ICS2_query:FROM |
generateTimeIntervals:time_intervals |
FlattenList:list5 |
CreateVOTable:votable_out |
returnVOTable:list3 |
returnVOTable:VOTable |
VOTable |
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 (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
(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