def test_doGetDataSet(): org = javaaddpath('http://autoplot.org/jnlp/latest/autoplot.jar') apds = org.autoplot.idlsupport.APDataSet() apds.setDataSetURI( 'http://autoplot.org/data/swe-np.xls?column=data&depend0=dep0') apds.doGetDataSet() vv = apds.values() assert vv[0] == 3.4716999530792236
def test_APDataSet(): org = javaaddpath('http://autoplot.org/jnlp/latest/autoplot.jar') apds = org.autoplot.idlsupport.APDataSet() assert apds is not None
def test_javaaddpath(): org = javaaddpath('http://autoplot.org/jnlp/latest/autoplot.jar') assert org is not None
# demo how Autoplot library is used to export data. This # loads an xls file into ndarrays, and then formats the # data to a CDF file. from autoplot import javaaddpath, to_ndarray, to_qdataset # Download autoplot.jar if needed and return Python bridge object org = javaaddpath('http://autoplot.org/jnlp/latest/autoplot.jar') # Create Autoplot Data Set apds = org.autoplot.idlsupport.APDataSet() # Set URI apds.setDataSetURI('http://autoplot.org/data/swe-np.xls?column=data&depend0=dep0') # Get the data apds.doGetDataSet() print(apds.toString()) # http://autoplot.org/data/swe-np.xls?column=data&depend0=dep0 # data: data[dep0=288] (dimensionless) # dep0: dep0[288] (days since 1899-12-30T00:00:00.000Z) (DEPEND_0) # Extract data values vv = to_ndarray( apds, 'data' ) tt = to_ndarray( apds, 'dep0' ) # Now export the same data using Autoplot sc= org.autoplot.ScriptContext ttqds= to_qdataset( tt ) vvqds= to_qdataset( tt, vv )
import autoplot as ap org = ap.javaaddpath() apds = org.autoplot.idlsupport.APDataSet() apds.loadDataSet('vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=DST1800&timerange=Oct+2016') epoch = ap.to_ndarray(apds, 'Epoch') dst = ap.to_ndarray(apds, 'DST') ap.applot(epoch, dst)
import autoplot as ap import time org = ap.javaaddpath('http://autoplot.org/latest/autoplot.jar') apds = org.autoplot.idlsupport.APDataSet() apds.loadDataSet('vap+inline:findgen(4000,500)') # that's 2 000 000 elements t0 = time.time() dd = ap.to_ndarray(apds, 'ds_0') print('%.1f s for %s' % (time.time() - t0, str(dd.shape))) print('----') apds.loadDataSet('vap+inline:findgen(2000000)') # that's 2 000 000 elements t0 = time.time() dd = ap.to_ndarray(apds, 'ds_0') print('%.1f s for %s' % (time.time() - t0, str(dd.shape))) print('----')