ViRBO Interface

From autoplot.org

Jump to: navigation, search

Autoplot's data reader is used to access ViRBO data from MATLAB and IDL. Below are test scripts. The server should be complete in early 2009. The following are examples of the slightly outdated syntax. The most recent versions of these scripts that are used to test the server are at http://timeseries.org/Devel

Contents

  1. MATLAB
  2. IDL
    1. Configure IDL
    2. Interactive Session
    3. Another example
    4. Problems

1 MATLAB

dataurl = 'http://aurora.gmu.edu:8080/TimeSeriesServer/SourceAcronym';          
timestart = 0;                                                                  
timeend   = 3600000*2;                                                          
Setno     = [1:6];                                                              
Varno     = [1,1,1,2,2,2];                                                      
 
 
% Download ~20 MB jar file                                                      
javaaddpath('http://www.autoplot.org/autoplot/images/AutoplotAll.jar');         
 
for setno=1:length(Setno)                                                       
  varno = Varno(setno);                                                         
  name  = sprintf('/Subset%d/bin/SourceAcronym_Subset%d',setno,setno);          
  name  = sprintf('%s-%d-v0.dods',name,varno);                                  
  url   = [dataurl,name];                                                       
  apds  = org.virbo.idlsupport.APDataSet;                                       
          apds.setDataSetURL(url);                                              
          apds.doGetDataSet;                                                    
  x     = apds.values;                                                          
end                                                                             
 
for setno=1:length(Setno)                                                       
  varno = Varno(setno);                                                         
  name  = sprintf('/Subset%d/bin/SourceAcronym_Subset%d',setno,setno);          
  name  = sprintf('%s-%d-v0.dods?time>%d&time<%d',name,varno,timestart,timeend)
  url   = [dataurl,name];                                                       
  apds  = org.virbo.idlsupport.APDataSet;                                       
          apds.setDataSetURL(url);                                              
          apds.doGetDataSet;                                                    
  x     = apds.values;                                                          
end

2 IDL

2.1 Configure IDL

export CLASSPATH=VirboAutoplot/dist/AutoplotAll.jar
export IDLJAVAB_LIB_LOCATION=/usr/local/jdk1.6.0_06/jre/lib/i386/client/

2.2 Interactive Session

IDL> qds= OBJ_NEW('IDLjavaObject$APDataSet', 'org.virbo.idlsupport.APDataSet') 
% QDataSetBridge v1.4.0
% GetDataSet v1.2.1
IDL> qds->setDataSetUrl, 'http://www.autoplot.org/data/swe-np.xls?column=data&depend0=dep0'
IDL> qds->doGetDataSet
IDL> help, qds->values()
<Expression>    DOUBLE    = Array[287]
IDL> help, qds->depend(0)
<Expression>    STRING    = 'dep0'
IDL> help, qds->values('dep0')
<Expression>    DOUBLE    = Array[287]
IDL> plot, qds->values('dep0'), qds->values()
IDL> print, (qds->property('dep0','UNITS'))->toString()      ; this needs improvement
t1970

2.3 Another example

/media/mini/nbprojects/virbo/agu2008/VirboAutoplot/dist
localhost$ export CLASSPATH=jumbojar.jar

/media/mini/nbprojects/virbo/agu2008/VirboAutoplot/dist
localhost$ export IDLJAVAB_LIB_LOCATION=/usr/local/jdk1.6.0_06/jre/lib/i386/client/

/media/mini/nbprojects/virbo/agu2008/VirboAutoplot/dist
localhost$ idl
IDL Version 6.4 (linux x86 m32). (c) 2007, ITT Visual Information Solutions
Installation number: 102181.
Licensed for personal use by Jeremy Faden only.
All other use is strictly prohibited.

IDL> qds= OBJ_NEW('IDLjavaObject$GetDataSet', 'org.virbo.idlsupport.APDataSet') 
% QDataSetBridge v1.4.0
% GetDataSet v1.2.1
IDL> qds->setDataSetUrl, 'file:///c:/Documents+and+Settings/jbf/Desktop/Product+Summary.xls?sheet=nist+lo&column=H'
IDL> qds->doGetDataSet
IDL> data= qds->values(  )
IDL> print, data
             NaN             NaN             NaN             NaN             NaN             NaN             NaN
             NaN             NaN             NaN             NaN             NaN             NaN             NaN
             NaN             NaN             NaN             NaN             NaN             NaN             NaN
             NaN             NaN             NaN             NaN             NaN             NaN             NaN
             NaN             NaN             NaN             NaN             NaN             NaN             NaN
             NaN             NaN             NaN             NaN             NaN             NaN             NaN
             NaN             NaN             NaN             NaN             NaN             NaN             NaN
             NaN             NaN             NaN       13.919000       18.741000       24.918000       32.634000
       42.210000       53.776000       67.655000       83.979000       103.05000       124.83000       149.66000
       177.99000       209.02000       242.73000       280.35000       321.96000       365.38000       413.09000
       461.87000       516.49000       573.17000       632.53000       695.99000       766.04000       844.23000
       932.71000       1043.4000       1183.9000       1384.8000       1691.8000       2222.7000             NaN
             NaN             NaN
IDL> qds->setDataSetUrl, 'http://aurora.gmu.edu:8080/TimeSeriesServer/OMNI/OMNI2/bin/OMNI_OMNI2-1-v0.dds?timeseries'
IDL> qds->doGetDataSet
% Dods.getDataSet
IDL>  data= qds->values(  )
IDL> help, data
DATA            DOUBLE    = Array[403248]
IDL> plot, data
IDL> 

2.4 Problems

  • IDL on 64-bit Linux must be run in 32bit mode (idl -32).
  • Does mac always use java 1.3? This would be a problem, since Autoplot is java 1.5.
  • The CLASSPATH must be set before the IDL session starts. Bob thinks Matlab doesn't have this problem.
Personal tools