Hi Patrick,
As you say, for graphics, when the resolution of the image is
less than the grid resolution, striding is an excellent way to get
better performance without losing quality.
Your idea does sound like a convenient method for reading data
using strides, when the variables being plotted are file
variables. However if the SHADE plot is showing a more complex
_expression_ perhaps involving combinations of variables regridded
to a new grid, then the qualifier would be ambiguous. It may be
more cumbersome, but it is really necessary to to attach the
striding information to the file variables or their grids.
Certainly a script can set up the striding according to the size
of the grid and the output resolution of the image. Here's an
example. Similar logic could be used to define a stride and use
the SET
AXIS/STRIDE command, or to define strides on a sub-region of
the grid.
yes? let xres = 600
yes? let yres = 400
yes? let nx = `var,return=isize`
yes? let ny = `var,return=jsize`
yes? let istride = MAX(1,INT(nx/xres + 0.5))
yes? let jstride = MAX(1,INT(ny/yres + 0.5))
yes? define symbol region_spec = [i=1:`nx`:`istride`,j=1:`ny`:`jstride`]
yes? shade var($region_spec), lon2D($region_spec),
lat2D($region_spec)
-Ansley
On 9/26/2016 2:51 AM, Patrick Brockmann wrote:
Hi,
There is already a way to control subsampling by applying strides
on axis. This is very usefull
to display quickly maps with quite large grids (1442x1022 for
example).
This is described in paragraph 2.1.1 NetCDF data and strides
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/data-set-basics/NETCDF-DATA#_VPID_39
Now, I would find very convenient to control this directly from a
qualifier and not by previous
set/cancel of strided axis.
Something like
yes? use curvilinear.nc
yes? shade/stride=4 var, lon2D, lat2D
yes? shade/stride=2 var, lon2D, lat2D
Rather than
yes? use curvilinear.nc
yes? SET AXIS/STRIDE=4 `var,RETURN=xaxis`
yes? SET AXIS/STRIDE=4 `var,RETURN=yaxis`
yes? shade var, lon2D, lat2D
yes? CANCEL AXIS/STRIDE `var,RETURN=xaxis`
yes? CANCEL AXIS/STRIDE `var,RETURN=yaxis`
yes? SET AXIS/STRIDE=2 `var,RETURN=xaxis`
yes? SET AXIS/STRIDE=2 `var,RETURN=yaxis`
yes? shade var, lon2D, lat2D
Is is possible ?
And to go further, does a mechanism to set this stride value
according to the size of the target image could be implemented ?
Because there is finally no point to process all points of
variables if
the map is displayed as a small image. Just a thought...
Best regards
Patrick
|