[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20040510: IDV problem with units on METAR plots



>From: Tom Whittaker <address@hidden>
>Organization: SSEC
>Keywords: 200405101525.i4AFPrtK019218  IDV RealTypes

Hi Tom-

>It seems that if I load my CRAS bundle, and then try to add the latest METAR 
>data (via the normal chooser route), I get a pop-up:
>
>An error has occurred
>making shapes
>Incompatible units  & Fahrenheit
>
>The values are not plotted, but a Control is created, and so I can then select
>a different parameter (say, windspeed) which is plotted just fine -- I just 
>cannot select anything with temperature or I get this error.
>
>The bundle is available at:
>http://www.ssec.wisc.edu/~tomw/idv/cras00z.xidv

Here's the problem.  When you load in your CRAS data, it has a variable
"T" with null units (get Aune to add units to his vis5d files. ;-)).
When you read in the point data, it has a variable T with units of
K, but when I call RealType.getRealType("T", unit), I get an error
(since the RealType with name T has null units) and then I just use
the one with null units.  Your station model has the unit for T
set to be "Fahrenheit", and since this is incompatible with null,
you see the error message.

So, the basic problem is that VisAD does not allow two RealTypes to
have the same name and different units.

One option would be to create a new unique realtype (e.g, T_0) with
the correct units, but then T_0 would not be an alias for Temperature
which the station model uses.  It only understands "T".

The other option might be to change the Vis5D adapter to use standard
units for variables when units are not supplied.  I'm pretty sure
that T is always in K, P is always mb, etc.

Or, if you have other insight into this problem, let me know.

Don

>
>The stacktrace:
>ERROR ucar.unidata.util.LogUtil - An error has occurred
>making shapes
>Incompatible units  & Fahrenheit
>ucar.unidata.util.WrapperException: Incompatible units  & 
>Fahrenheitvisad.UnitException: Attempt to convert from unit "" to unit "K"
>         at ucar.visad.display.StationModelDisplayable.makeShapes(StationModel
> Dis
>playable.java:585)
>         at ucar.visad.display.StationModelDisplayable.makeShapesFromPointObsF
> iel
>d(StationModelDisplayable.java:457)
>         at ucar.visad.display.StationModelDisplayable.makeNewDataWithShapes(S
> tat
>ionModelDisplayable.java:401)
>         at ucar.visad.display.StationModelDisplayable.setStationData(StationM
> ode
>lDisplayable.java:249)
>         at ucar.unidata.idv.control.StationModelControl.loadData(StationModel
> Con
>trol.java:271)
>         at ucar.unidata.idv.control.StationModelControl$PCListener.loadDataIf
> NoC
>ontrolChangeEventReceivedLately(StationModelControl.java:1020)
>         at ucar.unidata.idv.control.StationModelControl$PCListener.access$130
> 0(S
>tationModelControl.java:936)
>         at ucar.unidata.idv.control.StationModelControl$9.run(StationModelCon
> tro
>l.java:1053)
>         at ucar.unidata.util.Misc$1.run(Misc.java:1311)
>
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publically available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.