Пример #1
0
  static {
    Real mdp = null;
    Real mp = null;
    Real mws = null;

    try {
      mdp = (Real) DewPoint.getRealType().missingData();
      mp = (Real) AirPressure.getRealType().missingData();
      mws = (Real) WaterVaporMixingRatio.getRealType().missingData();
    } catch (Exception e) {
      System.err.print("Couldn't initialize class: ");
      e.printStackTrace();
      System.exit(1);
    }

    missingDewPoint = mdp;
    missingPres = mp;
    missingWsat = mws;
  }
Пример #2
0
  /**
   * Computes the saturation mixing-ratio property from the input data. A {@link
   * java.beans.PropertyChangeEvent} is fired for the output property if it differs from the
   * previous value.
   *
   * @throws TypeException if a VisAD data object has the wrong type.
   * @throws VisADException if a VisAD failure occurs.
   * @throws RemoteException if a Java RMI failure occurs.
   */
  void clock() throws TypeException, VisADException, RemoteException {

    Real oldValue;
    Real newValue;

    synchronized (this) {
      if (!dirty) {
        oldValue = wSat;
        newValue = wSat;
      } else {
        newValue = (Real) WaterVaporMixingRatio.create(pressure, dewPoint);
        oldValue = wSat;
        wSat = newValue;
        dirty = false;
      }
    }

    firePropertyChange(OUTPUT_PROPERTY_NAME, oldValue, newValue);
  }