Fw: How to set Latitude and Longitude range (Vis5D topography file), make it 0 ~ 360
=?ISO-2022-JP?B?GyRCTi0waUhBGyhC?=
monica at cwb.gov.tw
Tue May 16 21:24:30 MDT 2006
Hello,
I mean that "Netcdf" file data is main, "McIDAS Base Map" file and
"Vis5D topography" file data is secondary.
So, "McIDAS Base Map" file and "Vis5D topography" file data domain
should be ranging from 0 to 360.
My netcdf file range :
Latitude : -90 ~ 90
Longitude : 0.0 ~ 357.5
"McIDAS Base Map" file and "Vis5D topography" file range
Latitude : -90 ~ 90
Longitude : -180.0 ~ 180.0
I want to be :
My netcdf file range :
Latitude : -90 ~ 90
Longitude : 0.0 ~ 357.5
McIDAS Base Map" file and "Vis5D topography" file range
Latitude : -90 ~ 90
Longitude : 0.0 ~ 357.5
My question is when I just use code
lonMap.setRange(lonRange[0], lonRange[1]);
"McIDAS Base Map" file still be normally display, but "Vis5D
topography" file just display range 0 ~ 180 (180 ~ 360 not display,
why?)
So I need way to solve this problem.
Thanks you :)
Monica
----- Original Message -----
From: Curtis Rueden
To: 劉育帆
Cc: visad
Sent: Wednesday, May 17, 2006 3:07 AM
Subject: Re: How to set Latitude and Longitude range (Vis5D topography
file), make it 0 ~ 360
Hi,
I am not an expert on the netCDF format, but will try to comment as best
I can.
If you do not call setRange at all, does the auto-scaling sets the range
as -180 to 180? If so, it would seem your data's range is actually -180
to 180 (unless perhaps there is a bug in the netCDF reader?). If you
want it to display as 0 to 360 instead, you could replace the domain set
with one ranging from 0 to 360, or use an OffsetUnit to adjust the
values. However, it looks like you have tried to replace the domain set,
which should work, assuming the ranges of the two data objects line up
properly.
If you cannot figure it out, I would be willing to investigate your
problem a bit if you can send me your data files and source code
demonstrating the issue.
-Curtis
On 5/14/06, 劉育帆 <monica at cwb.gov.tw> wrote:
Dear All:
I use a "McIDAS Base Map" file and a "Vis5D topography" file
to match a netcdf file. but it get some error..
My netcdf file range :
Latitude : -90 ~ 90
Longitude : 0.0 ~ 357.5
I use
[code]
Vis5DTopoForm topoAdapter = new Vis5DTopoForm();
topoImage = topoAdapter.open(new URL(topoFile));
//set Latitude and Longitude range, lonRange[0] = 0.0, lonRange[1]
= 357.5
double lonRange[] = lonMap.getRange();
double latRange[] = latMap.getRange();
lonMap.setRange(lonRange[0], lonRange[1]);
latMap.setRange(latRange[0], latRange[1]);
............
//topoAdapter
FunctionType imageFunctionType = (FunctionType)
topoImage.getType();
RealTupleType imageDomainType = imageFunctionType.getDomain();
RealTupleType imageRangeType = (RealTupleType)
imageFunctionType.getFlatRange();
ScalarMap rgbMap = new ScalarMap((RealType)
imageRangeType.getComponent(0), Display.RGB);
display.addMap(rgbMap);
//set Vis5D topography map range
LinearLatLonSet origin_set =
(LinearLatLonSet)((FlatField)topoImage).getDomainSet();
int origin_length[] = origin_set.getLengths();
LinearLatLonSet domain_set = new LinearLatLonSet(imageDomainType,
lonRange[0], lonRange[1], origin_length[0], latRange[1], latRange[0],
origin_length[1]);
FlatField vals_ff = new FlatField(imageFunctionType, domain_set);
double[][] flat_samples = ((FlatField)topoImage).getValues();
vals_ff.setSamples(flat_samples, false);
DataReferenceImpl imageRef = new DataReferenceImpl("ImageRef");
imageRef.setData(vals_ff);
[/code]
I try to several ways but not get right result..
1.Anything not to do
http://unicle.netfirms.com/visad/ex0502-1.JPG
2.just set Latitude and Longitude range
http://unicle.netfirms.com/visad/ex0502.JPG
3.just set Vis5D topography map range(use LinearLatLonSet)
http://unicle.netfirms.com/visad/ex0512-1.JPG
4.both "set Latitude and Longitude range" and "set Vis5D topography
map range(use LinearLatLonSet)"
http://unicle.netfirms.com/visad/ex0512.JPG
I think the default range of "Vis5D topography file" is -180 ~ 180.
so when I want set the new range 0 ~ 360, it could be error..
Could someone give me a direction ? thanks a lot...
More information about the visad
mailing list