Hi Stuart-
Stuart Maclean wrote:
Don Murray wrote:
Hi Stuart-
Try using the ImageRGBDisplayable instead. As a test, use the IDV
to load in the image and then use the Imagery->Geolocate an Image
formula to navigate it. Essentially, that formula does what you do
below.
Hi Don, I am not quite sure how to test this in IDV. Using 2.3, what
steps are you suggesting? I cannot find an Imagery menu anywhere.
Do i load from my filesystem, or from Data Sources|Satellite Imagery?
Load the image in from the file system through the Files Chooser.
In the Field Selector, you should see a Field that has the VisAD
MathType. Then Select the Formulas Data Source and if there is
no Imagery category, then the formula will be under System. We
changed the categorization recently, but perhaps it was after
2.3.
I tried ImageRGBDisplayable in my code and I still see nothing, using
a MapProjectionDisplayJ2D built with no-args constructor.
Okay, see below.
I changed my code from
ImageRGBDisplayable.setData( myField );
to
ImageRGBDisplayable.loadData( myField );
setData is the generic method that just puts the data into the
DataReference. loadData also sets up the appropriate ScalarMaps.
and now I DO see my image. I got the idea from the idv class
ImageControl, which maintains an ImageRGBDisplayable instance and
calls loadData on it.
That's a good model to follow.
Alas the original color scheme does not seem to have been preserved,
as it was in the case of the VisAD code, i.e. using just Visad
objects, none from IDV. How do I get my ImageRGBDisplayable to
preserve my source color palette?
You neeed to call setColorPalette with the gray color table.
Something like:
imageDisplayable.setColorPalette(visad.BaseColorControl.initTableGreyWedge(new
float[3][255]);
If you used the constructor to include alpha, change the 3 to a 4 in
the previous call.
Don
*************************************************************
Don Murray UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx P.O. Box 3000
(303) 497-8628 Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************