package org.autoplot.pds; import gov.nasa.pds.label.Label; import gov.nasa.pds.label.object.ArrayObject; import gov.nasa.pds.label.object.FieldDescription; import gov.nasa.pds.label.object.TableObject; import gov.nasa.pds.label.object.TableRecord; import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URL; import org.autoplot.datasource.AbstractDataSource; import org.autoplot.datasource.DataSetURI; import org.autoplot.datasource.URISplit; import org.das2.datum.Units; import org.das2.qds.ArrayDataSet; import org.das2.qds.DDataSet; import org.das2.qds.QDataSet; import org.das2.qds.util.DataSetBuilder; import org.das2.util.monitor.NullProgressMonitor; import org.das2.util.monitor.ProgressMonitor; /** * * @author jbf */ public class PdsDataSource extends AbstractDataSource { public PdsDataSource(URI uri) { super(uri); } private ArrayDataSet getFromTable( TableObject t, String columnName ) throws IOException { TableRecord r= t.readNext(); int icol= -1; if ( r!=null ) { icol= r.findColumn(columnName); } DataSetBuilder dsb= new DataSetBuilder(1,100); while ( (r=t.readNext())!=null ) { dsb.nextRecord( (double)r.getDouble(icol) ); } return dsb.getDataSet(); } private double[] flatten( double[][] dd ) { double[] rank1= new double[dd.length*dd[0].length]; int nj= dd[0].length; int kk= 0; for ( int i=0; i