NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: plotting variable on xy axis

Hi Jacky,

>    I would like to know if anyone has successfully plotted temperature (or 
> someother variable) with respect to longitude and latitude. Please can 
> someone give me some hints on how I can accomplish this. My aim is to come 
> up with a contour graph, where the position of a weather station is defined 
> using longitude and latidude, and the data i.e. temperature will then be 
> shown as a contour (presumably using VisAD's contour class). So for every 
> weather station there will be a point on the map, my problem is to specify 
> the location using some sort of array or tuple, also the data needs to be 
> stored about temperature, wind, etc. I have looked at the examples i.e 
> P4_01, P3_0x, etc and tried modifying them to meet my need, but I have done 
> so with little success
>    I know this is not uncommon and has been done before, so I would 
> appreciate it if someone can tell me how I can accomplish my task, or where 
> I should be looking at.

Start with P3_05.java from Ugo's tutorial, but substitute
an Irregular2DSet for the Linear2DSet in domain_set.
Something like:

  int n = ... // numbber of weather stations
  float[][] samples = new float[2][n];
  for (int i=0; i<n; i++) {
    samples[0][i] = ... // latitude of station i
    samples[1][i] = ... // longitude of station i
  }
  domain_set = new Irregular2DSet(LatitudeLongitudeTuple, samples);

Then also:

  float[][] flat_samples = new float[1][n];
  for (int i=0; i<n; i++) {
    flat_samples[0][i] = ... // temperature at station i
  }

Good luck,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: