[Top] [Prev] [Next] [Bottom]

9.2 Some Yorick-like Functions: yorick.py

The module yorick.py contains a few functions similar to ones in Yorick, which perform array manipulations necessary in doing 3D graphics. Those array manipulations which were too slow to do in interpreted code have been put into a Python extension module arrayfnsmodule (see Section 9.3 "Additional Array Operations: arrayfnsmodule" on page 102). We shall depart from our usual format here, and just give the calling sequences followed by a short explanation for each of the functions.

zcen_ (x, i = 0)

Returns an array whose ith dimension is one smaller than the ith dimension of x, with the elements along the ith being the averages of two adjacent elements in the original x. i cannot be larger than 5.

dif_ (x, i = 0)

Returns an array whose ith dimension is one smaller than the ith dimension of x, with the elements along the ith being the differences of two adjacent elements in the original x. i cannot be larger than 5.

maxelt_ (*x)

maxelt_ accepts a sequence of one or more possible multi-dimensional numerical objects and computes their maximum. In principle these can be of arbitrary complexity, since the routine recurses.

minelt_ (*x)

minelt_ accepts a sequence of one or more possible multi-dimensional numerical objects and computes their minimum. In principle these can be of arbitrary complexity, since the routine recurses.

rem_0_ (z)

rem_0_ (z) returns a copy of array z after having replaced any zero elements with 1.e-35. Assumes z has one or two dimensions.

avg_ (z)

avg_ (z) returns the average of all elements of its array argument.

sign_ (x)

Returns 1 if x >= 0, -1 otherwise.

timer_ (elapsed, *split)

timer_print (label, split, *other_args)

see Section 8.16 "Timing: timer, timer_print" on page 94.


[Top] [Prev] [Next] [Bottom]

support@icf.llnl.gov
Copyright © 1997,Regents of the University of California. All rights reserved.