package org.das2.qds; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; import org.das2.datum.Units; /** * grids a bundle of (X,Y,Z) data into a table Z(X,Y). * @author jbf */ public final class GridDataSet extends AbstractDataSet { TreeMap xtags; TreeMap ytags; Map rxtags; Map rytags; Map values; int ix; int iy; private static final double FILL= -1e31; /** * creates the dataset, initially length is zero. */ public GridDataSet() { xtags = new TreeMap<>(); ix=0; rxtags= new HashMap<>(); ytags = new TreeMap<>(); iy=0; rytags= new HashMap<>(); values = new HashMap<>(); properties.put( QDataSet.FILL_VALUE, FILL ); } /** * add either rank 1 slice ( x,y,z ) or * add rank 2 dataset ( *,3 ) * @param slice rank 1 or rank 2 bundle */ public void add(QDataSet slice) { QDataSet bds=null; if ( slice.rank()==1 ) { double xx = slice.value(0); double yy = slice.value(1); double zz = slice.value(2); add( xx, yy, zz ); bds= (QDataSet)slice.property(QDataSet.BUNDLE_0); } else if ( slice.rank()==2 ) { for ( int i=0; i