/** * Create e field description from the field * * @param fi field to use */ protected void makeFieldDescription(FieldImpl fi) { if (fi == null) { fieldsDescription = "Bad data: null"; return; } try { if (ucar.unidata.data.grid.GridUtil.isTimeSequence(fi)) { fi = (FieldImpl) fi.getSample(0); } PointOb ob = (PointOb) fi.getSample(0); Tuple tuple = (Tuple) ob.getData(); MathType[] comps = ((TupleType) tuple.getType()).getComponents(); Trace.msg("PointDataSource #vars=" + comps.length); StringBuffer params = new StringBuffer(comps.length + " Fields:<ul>"); String dataSourceName = getName(); DataChoice.addCurrentName(new TwoFacedObject("Point Data>Time", "Time")); DataChoice.addCurrentName(new TwoFacedObject("Point Data>Latitude", "Latitude")); DataChoice.addCurrentName(new TwoFacedObject("Point Data>Altitude", "Altitude")); for (int i = 0; i < comps.length; i++) { params.append("<li>"); String paramName = ucar.visad.Util.cleanTypeName(comps[i].toString()); DataAlias alias = DataAlias.findAlias(paramName); params.append(paramName); if (alias != null) { params.append(" -- " + alias.getLabel()); DataChoice.addCurrentName( new TwoFacedObject( dataSourceName + ">" + alias.getLabel() + " -- " + paramName, paramName)); } else { DataChoice.addCurrentName( new TwoFacedObject(dataSourceName + ">" + paramName, paramName)); } Data data = tuple.getComponent(i); if (data instanceof Real) { Unit unit = ((Real) data).getUnit(); if (unit != null) { params.append(" [" + unit.toString() + "]"); } } } fieldsDescription = params.toString(); } catch (Exception exc) { logException("getting description", exc); } }