//
// Sounding.java
//
/*
VisAD system for interactive analysis and visualization of numerical
data. Copyright (C) 1996 - 2017 Bill Hibbard, Curtis Rueden, Tom
Rink, Dave Glowacki, Steve Emmerson, Tom Whittaker, Don Murray, and
Tommy Jasmin.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA
*/
package visad.sounder;
import visad.*;
import visad.java3d.DirectManipulationRendererJ3D;
import visad.data.netcdf.units.UnitsDB;
import visad.data.netcdf.units.DefaultUnitsDB;
import visad.data.netcdf.StandardQuantityDB;
import java.util.Vector;
import java.rmi.RemoteException;
/**
Sounding is the VisAD class for atmospheric soundings.
It extends FlatField.
*/
public class Sounding extends FlatField {
static private UnitsDB udb;
static private StandardQuantityDB qdb;
static private RealType Pressure;
static private RealType Temperature;
static private RealType DewPoint;
static private FunctionType soundingType;
static {
try {
udb = DefaultUnitsDB.instance();
qdb = StandardQuantityDB.instance();
Pressure = qdb.get("Pressure");
Temperature = qdb.get("Temperature");
DewPoint = new RealType("DewPoint", udb.get("K"), null);
RealTupleType ttd = new RealTupleType(Temperature, DewPoint);
soundingType = new FunctionType(Pressure, ttd);
}
catch (VisADException e) {
e.printStackTrace();
}
}
//- this sounding's display_s
//
private Vector soundingDisplay_s = new Vector();
//- this sounding's DataReference
//
private DataReferenceImpl sounding_ref;
/** pressures in hPa, temperatures and dewpoints in K */
public Sounding(float[] pressures, float[] temperatures, float[] dewpoints)
throws VisADException, RemoteException {
super(soundingType, makePressureSet(pressures));
if (temperatures == null && dewpoints == null) {
throw new VisADException("temperatures and dewpoints cannot both be null");
}
int length = getLength();
if ((temperatures != null && temperatures.length != length) ||
(dewpoints != null && dewpoints.length != length)) {
throw new VisADException("temperatures and dewpoints cannot have " +
"different lengths");
}
if (temperatures == null) {
temperatures = new float[length];
for (int i=0; i
Ads help maintain this website.