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

[Support #IGM-709644]: Transparency in track



Hi Maswood-

> I have a problem of displaying turtle track and I would like to
> modify/augment/extend the code of IDV.
> 
> Here is the screen shot displayed by IDV. This is a turtle track .
> 
> So I'd like to visualize transparency in this track and modify the width of
> the track based on other  variables.

You can map a parameter to alpha, but not to line width.  LineWidth is a VisAD 
ConstantMap only and is a single value.

> As the IDV is build on top of Visad and most of the displayed function is
> inherited from visad , I
> was thinking of changing the code of visad.
> 
> There is a section in visad about how to implement transparency using an
> Alpha Map section in "4.6: Transparency "
> 
> http://www.ssec.wisc.edu/~billh/tutorial/s4/Section4.html
> 
> In this example when the height is high, the object is less
> transparent(opaque).
> 
> where I'd like to display that when time frame is earlier, the track would
> be less transparent.
> the more recent the times, the track would be more transparent.
> 
> The problem is its : not clear  where and how IDV uses "Visad display
> function" to plot or visualizes the track
> and which class/function  need be to modified for that.

The IDV wraps a lot of the VisAD ScalarMap functionality in the 
DisplayMaster/Displayable classes in ucar.visad.display.  A DisplayableData 
object wraps a DataReference and the ScalarMaps/ConstantMaps applicable to the 
data in the DataReference.  The DisplayMaster is a wrapper for the VisAD 
DisplayImpl.  There is some information in the IDV Workshop materials:

http://www.unidata.ucar.edu/software/IDV/docs/workshop/dev/data/VisADDisplayModel.html

One way to do what you want without changing any code is the following:

- Load in your track.
- Select the Formulas Data Source and then the Grids->One value colored by 
another formula and select the Plan View->Color-Filled Contour Plan View 
display and click Create Display.
- When the Field Selector pops up, select the parameter you want to display for 
the "Data field" and the Track->Basic->Time field for the "Color field" and 
click OK.  That will plot the data colored by time.
- Now, for that display, select the Edit->Color Table->Edit Color Table menu to 
bring up the color table editor.  In the editor:
  - Click the Transparency radio button and set a desired transparency for the 
old time data.
  - in the color bar, click on the left side of the bar to set the transparency 
for the low time value.
  - then right click on the color bar and select the Edit 
Colors->Transparency->Interpolate->Right menu from the popup menu to 
interpolate the transparency from the low to high values. 

That will display your track with older times more transparent than newer times.

I know that's not intuitive, but it does provide the right combination of 
ScalarMaps to get the job done.

However, if you want to use a track control and the associated features it 
provides (e.g. animation), then you would need to modify/subclass the 
ucar.unidata.idv.control.TrackControl and/or 
ucar.visad.display.TrackDisplayable to set the color table based on the shown 
times.

> Any kind of suggestion would be greatly helpful and appreciated.

Don Murray

Ticket Details
===================
Ticket ID: IGM-709644
Department: Support IDV
Priority: Normal
Status: Open