CDFROTATE

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
NOTES

NAME

cdfrotate −− interpolates data over an arbitrary rectangular area rotated with respect to the original two−dimensional domain

SYNOPSIS

cdfrotate x_name y_name x_value y_value theta [−xprange xplow xphigh] [−yprange yplow yphigh] [−xp0] [−yp0] [−all] [−allrange xlow ylow xhigh yhigh] [−vector u_name v_name] [−vector . . . .]

DESCRIPTION

Cdfrotate expects a common data format file on the standard input with index fields x_name and y_name defining a plane. The standard output produces a common data format file with data linearly interpolated to points within a rectangle in this plane. This rectangle has sides parallel to a new set of coordinate axes, xnamep and ynamep (i.e, xname and yname each with a ’p’ appended), which are rotated by an angle theta from the old xname and yname axes, and displaced so that the x_namep−y_namep origin coincides with (x_value, y_value) in the x_name−y_name plane. The sides of the rectangle may be specified by several means. The −xprange argument defines the x_namep limits of the rectangle to be at xplow and xphigh, while the −yprange argument sets y_namep limits at yplow and yphigh. −xp0 sets both x_namep limits at zero, collapsing the range to a segment of the y_namep axis; and −yp0 likewise sets both y_namep limits at zero. The −all argument instructs cdfrotate to choose the size of the rectangle as the minimum needed to enclose the entire domain of data, and the −allrange argument causes cdfrotate to use the smallest rectangle which encloses the rectangle in the x_name−y_name plane with corners at (xlow, ylow) and (xhigh, yhigh). By default, cdfrotate chooses the rectangle as if it had received the −all argument.

In the output file the index fields x_name and y_name are replaced by two different index fields named x_namep and y_namep. Both new index fields have grid spacing corresponding to the smaller of the grid intervals of x_name and y_name. Both xnamep and ynamep are defined to be zero at the pivot point, and range within the bounds of the x_namep−y_namep rectangle described above. (Exception: if the upper and lower x_namep limits are equal or the upper and lower y_namep limits are equal, so that the rectangle becomes a line and one of the new dimensions has a size of one, that dimension is not included in the output file; the total dimensionalities of fields with x_name and y_name dimensions are reduced by one.) All data fields which have x_name and y_name as dimensions are redefined over this new domain, with data values determined by bilinear interpolation. For fields which have more than these two dimensions, the interpolation is done for each of the possible combinations of values of the other dimensions. Fields which have neither x_name nor y_name dimensions are passed untouched; fields with only one of the two dimensions are not allowed and will cause cdfrotate to die. Areas in the new domain which extend beyond the original x_name−y_name domain are filled with bad data values. Fields in the static slice as well as in the one or more variable slices are processed.

Cdfrotate also optionally rotates one or more pairs of vector components specified by the −vector argument(s) to the new axes of the x_namep−y_namep plane. A given set of vector components are assumed to have the names u_name and v_name in the variable field(s). These are typically the x_name and y_name components of a velocity field. New vector components u_namep and v_namep parallel to the x_namep and y_namep axes respectively are computed and included in the output. The original fields u_name and v_name are deleted.

EXAMPLE

kestrel% cdfrotate x y −1.75 1.5 30 −xprange −10 15 −yprange 0 20 −vector u v < in_file > out_file

This example would define the coordinate axes xp and yp to lie at 30 degree angles with the x and y axes, such that the xp−yp origin coincides with (−1.75, 1.5) in the x−y plane. Data would be interpolated within a rectangle with corners at (−10, 0) and (15, 20) in the xp−yp plane. Index fields x and y would be deleted and new index fields xp and yp added; and these dimensions would also replace x and y in all data field descriptions. The u and v fields would be replaced by up and vp, calculated so that the vector is rotated −30 degrees. All dimensions not mentioned in the command line are left untouched, as are data fields without the x and y dimensions.

NOTES

Cdfrotate has identical source code to cdfocut, except for a different user interface which makes cdfocut work as a degenerate case of cdfrotate; namely, cdfocut functions like cdfrotate with the −y0 option specified, so that a line segment (oblique cut) of data is interpolated.