/** * _more_ * * @param soundingObs _more_ * @return _more_ */ protected List<DataChoice> getTimeMatchingDataChoices(List<SoundingOb> soundingObs) { List<DataChoice> newChoices = new ArrayList<DataChoice>(); List categories = new ArrayList(); DataCategory cat = new DataCategory(DataCategory.CATEGORY_RAOBSOUNDING); cat.setForDisplay(false); categories.add(cat); List compCategories = new ArrayList(); DataCategory compCat = new DataCategory("None"); compCat.setForDisplay(false); compCategories.add(compCat); Hashtable props = Misc.newHashtable(DataChoice.PROP_ICON, "/auxdata/ui/icons/Balloon.gif"); for (Iterator iter = soundingObs.iterator(); iter.hasNext(); ) { SoundingOb ob = (SoundingOb) iter.next(); String name = ob.getLabel(); DateTime obTime = ob.getTimestamp(); DataSelection timeSelect = null; if (obTime != null) { ArrayList times = new ArrayList(1); times.add(obTime); timeSelect = new DataSelection(times); } DataChoice choice = new DirectDataChoice(this, ob, getName(), name, categories, timeSelect, props); newChoices.add(choice); } return newChoices; }
/** * Adds the {@link ucar.unidata.data.DataChoice}s of the current input data via {@link * #addDataChoice(DataChoice)}. */ protected void doMakeDataChoices() { int i = 0; List soundingObs = getRDS().getSoundingObs(); List categories = new ArrayList(); DataCategory cat = new DataCategory(DataCategory.CATEGORY_RAOBSOUNDING); cat.setForDisplay(false); categories.add(cat); List compCategories = new ArrayList(); DataCategory compCat = new DataCategory("None"); compCat.setForDisplay(false); compCategories.add(compCat); CompositeDataChoice composite = new CompositeDataChoice(this, soundingObs, getName(), "RAOB Data", categories); Hashtable props = Misc.newHashtable(DataChoice.PROP_ICON, "/auxdata/ui/icons/Balloon.gif"); for (Iterator iter = soundingObs.iterator(); iter.hasNext(); ) { SoundingOb ob = (SoundingOb) iter.next(); String name = ob.getLabel(); DateTime obTime = ob.getTimestamp(); DataSelection timeSelect = null; if (obTime != null) { ArrayList times = new ArrayList(1); times.add(obTime); timeSelect = new DataSelection(times); } DataChoice choice = new DirectDataChoice(this, ob, composite.getName(), name, categories, timeSelect, props); composite.addDataChoice(choice); } addDataChoice(composite); }
/** * Gets the SoundingOb associated with this DataChoice. The VisAD {@link visad.MathType} of the * return value is the {@link visad.Tuple} ({@link visad.DateTime}, {@link * visad.georef.EarthLocationTuple}, {@link ucar.visad.functiontypes.InSituAirTemperatureProfile}, * {@link ucar.visad.functiontypes.DewPointProfile}). * * @param dc DataChoice for data * @param dataSelection subselection criteria * @return The sounding observation. * @throws RemoteException Java RMI problem * @throws VisADException VisAD problem */ private Data makeSoundingOb(DataChoice dc, DataSelection dataSelection) throws VisADException, RemoteException { SoundingOb so = getRDS().initSoundingOb((SoundingOb) dc.getId()); if (so == null) { return null; } RAOB raob = so.getRAOB(); SoundingStation ss = (SoundingStation) so.getStation(); // sanity check FlatField t = raob.getTemperatureProfile(); if (t.getDomainSet().getLength() == 1) { return null; } return new Tuple( new Data[] { so.getTimestamp(), ((SoundingStation) so.getStation()).getNamedLocation(), raob.getTemperatureProfile(), raob.getDewPointProfile(), raob.getWindProfile() }); }