/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.das2.qds; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; import org.das2.datum.Units; /** * grids (X,Y,Z) data into a table Z(X,Y) * @author jbf */ public class GridDataSet extends AbstractDataSet { TreeMap xtags; TreeMap ytags; Map rxtags; Map rytags; Map values; int ix; int iy; private static final double fill= -1e31; 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 */ public void add(QDataSet slice) { QDataSet bds=null; if ( slice.rank()==1 ) { double x = slice.value(0); double y = slice.value(1); double z = slice.value(2); add( x, y, z ); bds= (QDataSet)slice.property(QDataSet.BUNDLE_0); } else if ( slice.rank()==2 ) { for ( int i=0; i