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: Gridded2DSet


Hi Don,

I got the ((lat,lon) -> value) method to work, but the output looks very "blocky" even with "high resolution". Please see:

http://www.cimms.ou.edu/~kmanross/VCPRPE/KIWA-APMap_compareHiRes.gif

Is there a way to make this smoother? Better yet, could I contour the outter edge and fill in that countour?

Below is part of the code that I used to perform the ((lat,lon) -> value)

#################################################################

    Gridded2DSet gridSet = (Gridded2DSet) terrainData_FF.getDomainSet();

    float[] lonFloat = new float[lonVect.size()];
    float[] latFloat = new float[latVect.size()];
    float[][] apFloat = new float[1][gridSet.getLength()];

    if (lonVect.size() != latVect.size())
    {
      System.out.println("LatLon sampling error.  No AP map available");
      return null;
    }

    for (int e = 0; e < lonVect.size(); e++)
    {
      Real ln = (Real) lonVect.get(e);
      Real lt = (Real) latVect.get(e);
      lonFloat[e] = (float) ln.getValue();
      latFloat[e] = (float) lt.getValue();
    }

    float[][] apLonLat = {lonFloat, latFloat};
    int[] valueIndicies = gridSet.valueToIndex(apLonLat);
    double[][] apDoubles = new double[1][valueIndicies.length];

    RealTupleType apLonLat_rtt = new RealTupleType(lon, lat);
    RealType value = RealType.getRealType("value");
    FunctionType ap_func = new FunctionType(apLonLat_rtt, value);

    FlatField apFF = new FlatField(ap_func, gridSet);

    // First set all the range values to NaN
    for (int g = 0; g < apFloat[0].length; g++)
    { apFloat[0][g] = Float.NaN; }
    apFF.setSamples(apFloat);

    // Now set specific range values
    for (int g = 0; g < apDoubles[0].length; g++)
    { apDoubles[0][g] = 14000.0; }
    apFF.setSamples(valueIndicies, apDoubles);

    return apFF;

#################################################################

Thanks!

-kevin.


Don Murray wrote:
Kevin-

Which method did you use - the (index -> (lat,lon)) or the
(lat,lon) -> value)?  I would think that the latter would
give you what you want, but if that's what you are using, then
I'm not sure what' going on.



--
+------------------------------------------------------------+
Kevin L. Manross        [KD5MYD]               (405)-366-0557
CIMMS Research Associate               kevin.manross@xxxxxxxx
[NSSL-WRDD/SWATN]           http://www.cimms.ou.edu/~kmanross

"My opinions are my own and not representative of CIMMS, NSSL,
 NOAA or any affiliates"
+------------------------------------------------------------+


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