Re: contouring

From: Dennis Shea (shea AT XXXXXX)
Date: Tue Nov 26 2002 - 10:51:44 MST

  • Next message: Qiaozhen Mu: "how to incorporate NCL into fortran"

    >Is there any way to contour randomly positioned data (station data)
    >without interpolating it to a grid first?

    Sorry, no.

    >I know there are several easy
    >functions for interpolating random data into the grid size of your choice,
    >and I've seen statements in the help archives implying that random data
    >has to be gridded before ncl can contour it. However, I know GMT can
    >contour station data using some sort of triangulation method and I'm
    >wondering if anyone knows if NCL has a similar feature. If it
    >does, I haven't found it yet. Thanks.

    To the best of my knowledge, triangulation methods also are interpolatory
    (though it may depend on your definition of "interpolation").

    Perhaps, behind the interface, GMT uses "triangulation" to interpolate to
    grid and then plot. It just does not require that the user
    explicitly do it. As with all things of this sort, there are tradeoffs.
    How much control, do you have of GMT's triangulation method? Do you
    have options to set that may change the behaviour of the contour
    program? Some examples: smoothness, resolution, ...

    NCL requires that the user explicitly choose from one of several
    interpolation functions. If you are on a sphere, perhaps cssgrid
    is the best. In fact, cssgrid *does* use triangulation
    [specifically, Delaunay triangulations] to perform the interpolation(s).

    Further, NCL allows the user to 'tweak' various parameters
    to get the best result.

    see: http://ngwww.ucar.edu/ngdoc/ng/ngmath/cssgrid/parameters.html

    A user could establish a function the passes in the locations
    and values; uses an appropriate interpolation function and, finally,
    invokes the desired plot function. The

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
    procedure GMT_plot (latz,lonz,z [,...])
    begin
      lonGrid = whatever ; these could be passed as arguments also
      latGrid = whatever
      
      grid = cssgrid_Wrap (latz,lonz, z, latGrid, lonGrid) ; contributed.ncl
      
      plot = gsn_csm...(...,grid,res)
      
    end
    begin
         :
         GMT_plot (lat_pts,lon_pts, data [,...])
    end

    Dennis Shea

    _______________________________________________
    ncl-talk mailing list
    ncl-talk AT ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Tue Nov 26 2002 - 11:34:13 MST