Home
Manual
Packages
Global Index
Keywords
Quick Reference
|
all functions - s
save
|
save, file, var1, var2, ...
restore, file, var1, var2, ...
saves the variables VAR1, VAR2, etc. in the binary file FILE,
or restores them from that file.
The VARi may be either non-record or record data in the case that
FILE contains records.
If one of the VARi does not already exist in FILE, it is created
by the save command; after add_record, save adds or stores VARi to
the current record. See add_record for more. The VARi may be
structure definitions (for the save command) to declare data
structures for the file. This is necessary only in the case that
a record variable is a pointer -- all of the potential data types
of pointees must be known. No data structures may be declared
using the save command after the first record has been added.
If no VARi are present, save saves all array variables, and
restore restores every non-record variable in the file if there
is no current record, and every variable in the current record if
there is one.
builtin function, documented at i0/std.i line 2311
|
SEE ALSO:
|
openb,
createb,
updateb,
get_vars,
add_record,
get_addrs,
jt,
jc,
_read,
_write,
data_align
|
scalar
|
scalar -- get optional scalar parameter
PROTOTYPE
x = scalar(xarg, xdef, lt=, le=, gt=, ge=, type=, arg=, fn=);
ARGUMENTS
XARG argument passed to the function.
XDEF default value for the scalar argument (optional, if not
specified, then it is guessed that the caller must supply the
argument).
KEYWORDS
GE= to be valid, XARG must be >= GE (optional, only one of GT or GE
can be used).
GT= to be valid, XARG must be > GT (optional, only one of GT or GE
can be used).
LE= to be valid, XARG must be <= LE (optional, only one of LT or LE
can be used).
LT= to be valid, XARG must be < LT (optional, only one of LT or LE
can be used).
TYPE= data type of the scalar (optional).
FN= function name for error messages (optional string).
ARG= argument name for error messages (optional string).
DESCRIPTION
Check XARG and return a scalar value (i.e., either XARG converted to TYPE
if it is not void or XDEF otherwise). If XARG is not within any specified
bound or if it is not a scalar or if it is void (e.g., not specified) and
there is no default value XDEF, an error message is written out.
EXAMPLE
The following function has 2 scalar arguments X and Y, the 1st one is an
integer (of type long) which must be specified and be strictly greater
than 22 while the 2nd default to .5 and must be in [0., 1.]:
func foo(x,y) {
x= scalar(x, gt=22, type=long, fn="foo", arg="X");
y= scalar(y, .5, ge=0., le=1., type=double, fn="foo", arg="Y");
...
}
WARNING
There is no checking of consistency of options.
HISTORY: 29 Sept. 1995 by Eric THIEBAUT. (Modified slightly by DHM)
interpreted function, defined at i/string.i line 240
|
sech
|
sech(x)
csch(x)
returns the hyperbolic secant (1/cosh) or cosecant (1/sinh) of
its argument, without overflowing for large x.
interpreted function, defined at i0/std.i line 567
|
SEE ALSO:
|
sinh,
cosh,
tanh,
asinh,
acosh,
atanh
|
series_n
|
series_n(r, s)
returns the minimum number n of terms required for the geometric
series
1 + r + r^2 + r^3 + ... + r^n = s
to reach at least the given value s. An alternate viewpoint is
that n is the minimum number of terms required to achieve the
sum s, with a ratio no larger than r.
Returns 0 if r<1 and s>1/(1-r), or if s<1.
The routine makes the most sense for r>1 and s substantially
greater than 1. The intended use is to determine the minimum
number of zones required to span a given thickness t with a given
minimum zone size z, and maximum taper ratio r (assumed >1 here):
n= series_n(r, t/z);
With this n, you have the option of adjusting r or z downwards
(using series_r or series_s, respectively) to achieve the final
desired zoning.
R or S or both may be arrays, as long as they are conformable.
interpreted function, defined at i/series.i line 127
|
SEE ALSO:
|
series_s,
series_r
|
series_r
|
series_r(s, n)
returns the ratio r of the finite geometric series, given the sum s:
1 + r + r^2 + r^3 + ... + r^n = s
Using n<0 will return the the reciprocal of n>0 result, that is,
series_r(s, -n) == 1.0/series_r(s, n)
If n==0, returns s-1 (the n==1 result).
S or N or both may be arrays, as long as they are conformable.
interpreted function, defined at i/series.i line 51
|
SEE ALSO:
|
series_s,
series_n
|
series_s
|
series_s(r, n)
returns the sum s of the finite geometric series
1 + r + r^2 + r^3 + ... + r^n
Using n<0 is equivalent to using the reciprocal of r, that is,
series_s(r, -n) == series_s(1./r, n)
R or N or both may be arrays, as long as they are conformable.
interpreted function, defined at i/series.i line 10
|
SEE ALSO:
|
series_r,
series_n
|
set3_object
|
set3_object, drawing_function, _lst(arg1,arg2,...)
set up to trigger a call to draw3, adding a call to the
3D display list of the form:
DRAWING_FUNCTION, _lst(ARG1, ARG2, ...)
When draw3 calls DRAWING_FUNCTION, the external variable _draw3
will be non-zero, so DRAWING_FUNCTION can be written like this:
func drawing_function(arg1,arg2,...)
{
require, "pl3d.i";
if (_draw3) {
list= arg1;
arg1= _nxt(list);
arg2= _nxt(list);
...
......
......
return;
}
......
......
set3_object, drawing_function, _lst(arg1,arg2,...);
}
interpreted function, defined at i/pl3d.i line 630
|
SEE ALSO:
|
get3_xy,
get3_light,
sort3d
|
set_blocksize
|
set_blocksize, file, blocksize
sets smallest cache block size for FILE to BLOCKSIZE. BLOCKSIZE
is rounded to the next larger number of the form 4096*2^n if
necessary; cache blocks for this file will be multiples of
BLOCKSIZE bytes long. The default BLOCKSIZE is 0x4000 (16 KB).
builtin function, documented at i0/std.i line 2461
|
SEE ALSO:
|
openb,
updateb,
createb,
save,
restore,
_read,
_write
|
set_filesize
|
set_filesize, file, filesize
sets the new family member threshhold for FILE to FILESIZE.
Whenever a new record is added (see add_record), if the current file
in the FILE family has at least one record and the new record would
cause the current file to exceed FILESIZE bytes, a new family
member will be created to hold the new record.
The default FILESIZE is 0x400000 (4 MB).
builtin function, documented at i0/std.i line 2470
|
SEE ALSO:
|
openb,
updateb,
createb,
add_record
|
set_idler
|
set_idler, idler_function
sets the idler function to IDLER_FUNCTION. Instead of waiting
for keyboard input when all its tasks are finished, the interpreter
will invoke IDLER_FUNCTION with no arguments. The idler function
is normally invoked only once, so input from the keyboard resumes
after one call to the idler. Of course, an idler is free to call
set_idler again before it returns, which will have the effect of
calling that function in a loop.
builtin function, documented at i0/std.i line 2751
|
SEE ALSO:
|
batch
|
set_path
|
set_path, "dir1:dir2:dir3:..."
or set_path
sets the include file search path to the specified list of
directories. The specified directories are searched left to
right for include files specified as relative file names in
#include directives, or to the include or require functions.
If the argument is omitted, restores the default search path,
".:~/yorick:~/Yorick:Y_SITE/i:Y_SITE/contrib",
where y_site is the main Yorick directory for this site.
The Y_LAUNCH directory is the directory which contains the
executable; this directory is omitted if it is the same as
Y_SITE.
Only the "end user" should ever call set_path, and then only in
his or her custom.i file, for the purpose of placing a more
elaborate set of personal directories containing Yorick procedures.
For example, if someone else maintains Yorick code you use, you
might put their ~/yorick on your include path.
builtin function, documented at i0/std.i line 219
|
SEE ALSO:
|
Y_LAUNCH,
Y_SITE,
include,
require
|
set_primitives
|
set_primitives, file, prims
Return the primitive data types for FILE as an array of 32
integers. Versions for particular machines are defined in
prmtyp.i, and can be accessed using functions like
sun_primitives or i86_primitives. See __xdr for a complete
list. The format is:
[size, align, order] repeated 6 times for char, short, int,
long, float, and double, except that char align is always 1,
so result(2) is the structure alignment (see struct_align).
[sign_address, exponent_address, exponent_bits,
mantissa_address, mantissa_bits,
mantissa_normalization, exponent_bias] repeated twice for
float and double. See the comment at the top of prmtyp.i
for an explanation of these fields.
the total number of items is thus 3*6+7*2=32.
interpreted function, defined at i0/std.i line 2207
|
SEE ALSO:
|
get_primitives,
createb,
__xdr,
__i86
|
set_style
|
set_style, landscape, systems, legends, clegends
set the detailed style of the current drawing. The arguments
are all inputs, having the same meanings as for get_style (which
see). All arguments are required, so you may need to call
get_style as a starting point, if you only want to make a few
changes. See the Y_SITE/g/work.gs and the other .gs files for
examples of reasonable values to choose.
Calling set_style destroys anything that was plotted in the
window, like the style= keyword of the window command.
interpreted function, defined at i/style.i line 70
|
SEE ALSO:
|
get_style,
read_style,
write_style
|
set_tolerances
|
set_tolerances()
or old_tols= set_tolerances([tol1, tol2, lost_tol])
returns the current tolerances for the ray tracking. Initially,
these are [1.e-3, 1.e-6, 0.0]. In the second form, sets new
tolerances. If any of TOL1, TOL2, or LOST_TOL is zero, that
tolerance is restored to its default value. If TOL1 is less
than zero, the root polishing operation which requires TOL1
and TOL2 is not done at all.
builtin function, documented at i0/drat.i line 1274
|
SEE ALSO:
|
track_rays,
integ_flat,
integ_linear,
streak,
snap
|
set_vars
|
set_vars, file, names
or set_vars, file, nonrec_names, rec_names
Change the names of the variables in FILE to NAMES. If the
file has record variables, you can use the second form to change
the record variable names. Either of the two lists may be nil
to leave those names unchanged, but if either is not nil, it must
be a 1D array of strings whose length exactly matches the number
of that type of variable actually present in the file.
builtin function, documented at i0/std.i line 2496
|
SEE ALSO:
|
openb,
updateb,
has_records,
get_vars
|
setz3
|
setz3, zc
Set the camera position to z=ZC (x=y=0) in the viewer's coordinate
system. If ZC is nil, set the camera to infinity (default).
interpreted function, defined at i/pl3d.i line 113
|
SEE ALSO:
|
rot3,
orient3,
undo3,
save3,
restore3,
light3
|
sgi64_primitives
|
sgi64_primitives, file
sets FILE primitive data types to be native to 64-bit SGI workstations.
interpreted function, defined at i0/std.i line 2128
|
shock
|
sound
Set up the initial conditions for evolve to launch a strong wave, which
steepens into a shock as it propagates.
interpreted function, defined at i/demo1.i line 76
|
SEE ALSO:
|
sound,
evolve
|
show
|
show, f
or show, f, pat
or show, f, 1
prints a summary of the variables contained in binary file F.
If there are too many variables, use the second form to select
only those variables whose first few characters match PAT.
In the third form, continues the previous show command where it
left off -- this may be necessary for files with large numbers of
variables.
The variables are printed in alphabetical order down the columns.
The print function can be used to obtain other information about F.
interpreted function, defined at i0/std.i line 1828
|
SEE ALSO:
|
openb,
jt,
jc
|
showgal
|
showgal(q,rot=,comp=)
displays galaxy with componants using different colors
interpreted function, defined at contrib/gadget.i line 963
|
showsim
|
loads and displays gadget binary format simulations
imin= minimum indice
imax= maximum indice
pers= perspective plot
vel= velocity plot (dodgy)
dens= isodensity plot
delay= delay between shots
jpg= saves picture
xrange= either e.g. 1e4 or [1e4,2e4]
yrange= "" (by default equal xrange)
zrange= ""
sub = if non zero plots one particle in ten
npix = number of pixel for density maps
col = color plot w.r.t. depth
iso = 3D isocontour
isovel = 3D isocontour of vx 1 vy 2 vz componant
dir = directory for output
center= position of new frame center
notxt= if non void remove file name
cut = if non void returns subsim
nodisp = if non void doesn't plot anything
comp= component filter (if void is equal to [1,1,1,1,1] (all parts displayed);
uses black blue red green cyan magenta)
rot= rotation (0=[x,y], 1=[y,z], 2=[z,x] )
flag= should contain a index range of particles to select
color= obvious
noerase= obvious
interpreted function, defined at contrib/gadget.i line 586
|
SEE ALSO:
|
|
showxyz
|
display a cluster of points in xyz projections
interpreted function, defined at contrib/gadget.i line 545
|
SEE ALSO:
|
|
sign
|
sign(x)
returns algebraic sign of it argument, or closest point on the
unit circle for complex x. Guaranteed that x==sign(x)*abs(x).
sign(0)==+1.
builtin function, documented at i0/std.i line 682
|
SEE ALSO:
|
abs
|
silo_cd
|
silo_cd, dirname
change current silo directory to DIRNAME, which may contain
.. or . constructs as a UNIX pathname
accepts silo= keyword to operate on a silo file other than the
current silo file
interpreted function, defined at i/silo.i line 65
|
SEE ALSO:
|
silo_ls,
silo_var,
silo_open,
silo_close
|
silo_ls
|
silo_ls
or silo_ls, dirname
or itemlist= silo_ls(dirname)
or itemlist= silo_ls(dirname, fulldirname)
list current silo directory or DIRNAME
if called as a function, returns a 1D array of strings beginning
with ".", and optionally returns FULLDIRNAME, which is the
full path name of the directory listed
- the individual items in the list do not include the
directory path
- subdirectory names end with "/", so you can find them
using strpart(itemlist,0:0)=="/"
accepts silo= keyword to operate on a silo file other than the
current silo file
interpreted function, defined at i/silo.i line 101
|
SEE ALSO:
|
silo_ls,
silo_cd,
silo_open,
silo_close
|
silo_open
|
silo_open, filename
or silo= silo_open(filename)
open FILENAME for later use with silo_... functions
There is a single current silo file, which is opened and set
by the first form. The other silo_... functions normally
operate on this current file, but also accept a silo= keyword,
which is a list returned by the second calling sequence for
silo_open.
interpreted function, defined at i/silo.i line 2
|
SEE ALSO:
|
silo_cd,
silo_ls,
silo_var,
silo_close
|
silo_var
|
var= silo_var(varname)
return silo variable VARNAME
accepts silo= keyword to operate on a silo file other than the
current silo file
interpreted function, defined at i/silo.i line 88
|
SEE ALSO:
|
silo_ls,
silo_cd,
silo_open,
silo_close
|
simpson
|
integral= simpson(function, a, b)
or integral= simpson(function, a, b, epsilon)
returns the integral of FUNCTION(x) from A to B. If EPSILON is
given, Simpson's rule is refined until that fractional accuracy
is obtained. EPSILON defaults to 1.e-6.
If the notvector= keyword is supplied and non-zero, then FUNCTION
may not be called with a list of x values to return a list of
results. By default, FUNCTION is assumed to be a vector function.
If the function is very smooth, romberg may work better.
interpreted function, defined at i/romberg.i line 58
|
SEE ALSO:
|
romberg,
max_doublings
|
simpson_cosmo
|
integral= simpson(function, a, b)
or integral= simpson(function, a, b, epsilon)
returns the integral of FUNCTION(x) from A to B. If EPSILON is
given, Simpson's rule is refined until that fractional accuracy
is obtained. EPSILON defaults to 1.e-6.
If the notvector= keyword is supplied and non-zero, then FUNCTION
may not be called with a list of x values to return a list of
results. By default, FUNCTION is assumed to be a vector function.
If the function is very smooth, romberg may work better.
interpreted function, defined at contrib/cosmo.i line 331
|
SEE ALSO:
|
romberg,
max_doublings
|
sin
|
sin(x)
cos(x)
tan(x)
returns the sine, cosine, or tangent of its argument,
which is in radians.
builtin function, documented at i0/std.i line 518
|
SEE ALSO:
|
asin,
acos,
atan
|
sinh
|
sinh(x)
cosh(x)
tanh(x)
returns the hyperbolic sine, cosine, or tangent of its argument.
builtin function, documented at i0/std.i line 557
|
SEE ALSO:
|
sech,
csch,
asinh,
acosh,
atanh
|
sizeof
|
sizeof(object)
returns the size of the object in bytes, or 0 for non-array objects.
sizeof(structure_definition) returns the number of bytes per instance.
sizeof(binary_file) returns the file size in bytes.
builtin function, documented at i0/std.i line 385
|
SEE ALSO:
|
dimsof,
typeof,
structof,
numberof
|
slice2
|
slice2, plane, nverts, xyzverts
or slice2, plane, nverts, xyzverts, values
Slice a polygon list, retaining only those polygons or
parts of polygons on the positive side of PLANE, that is,
the side where xyz(+)*PLANE(+:1:3)-PLANE(4) > 0.0.
The NVERTS, XYZVERTS, and VALUES arrays serve as both
input and output, and have the meanings of the return
values from the slice3 function. It is legal to omit the
VALUES argument (e.g.- if there is no fcolor function).
In order to plot two intersecting slices, one could
slice (for example) the horizontal plane twice (slice2x) -
first with the plane of the vertical slice, then with minus
that same plane. Then, plot first the back part of the
slice, then the vertical slice, then the front part of the
horizontal slice. Of course, the vertical plane could
be the one to be sliced, and "back" and "front" vary
depending on the view point, but the general idea always
works.
interpreted function, defined at i/slice3.i line 880
|
SEE ALSO:
|
slice3,
plane3,
slice2x,
slice2_precision
|
slice2x
|
slice2, plane, nverts, values, xyzverts
Slice a polygon list, retaining only those polygons or
parts of polygons on the positive side of PLANE, that is,
the side where xyz(+)*PLANE(+:1:3)-PLANE(4) > 0.0.
The NVERTS, VALUES, and XYZVERTS arrays serve as both
input and output, and have the meanings of the return
values from the slice3 function.
interpreted function, defined at i/slice3.i line 863
|
SEE ALSO:
|
slice2,
slice2_precision
|
slice3
|
slice3, m3, fslice, nverts, xyzverts
or color_values= slice3(m3, fslice, nverts, xyzverts, fcolor)
or color_values= slice3(m3, fslice, nverts, xyzverts, fcolor, 1)
slice the 3D mesh M3 using the slicing function FSLICE, returning
the lists NVERTS and XYZVERTS. NVERTS is the number of vertices
in each polygon of the slice, and XYZVERTS is the 3-by-sum(NVERTS)
list of polygon vertices. If the FCOLOR argument is present, the
values of that coloring function on the polygons are returned as
the value of the slice3 function (numberof(color_values) ==
numberof(NVERTS) == number of polygons).
If the slice function FSLICE is a function, it should be of the
form:
func fslice(m3, chunk)
returning a list of function values on the specified chunk of the
mesh m3. The format of chunk depends on the type of m3 mesh, so
you should use only the other mesh functions xyz3 and getv3 which
take m3 and chunk as arguments. The return value of fslice should
have the same dimensions as the return value of getv3; the return
value of xyz3 has an additional first dimension of length 3.
If FSLICE is a list of 4 numbers, it is taken as a slicing plane
with the equation FSLICE(+:1:3)*xyz(+)-FSLICE(4), as returned by
plane3.
If FSLICE is a single integer, the slice will be an isosurface for
the FSLICEth variable associated with the mesh M3. In this case,
the keyword value= must also be present, representing the value
of that variable on the isosurface.
If FCOLOR is nil, slice3 returns nil. If you want to color the
polygons in a manner that depends only on their vertex coordinates
(e.g.- by a 3D shading calculation), use this mode.
If FCOLOR is a function, it should be of the form:
func fcolor(m3, cells, l, u, fsl, fsu, ihist)
returning a list of function values on the specified cells of the
mesh m3. The cells argument will be the list of cell indices in
m3 at which values are to be returned. l, u, fsl, fsu, and ihist
are interpolation coefficients which can be used to interpolate
from vertex centered values to the required cell centered values,
ignoring the cells argument. See getc3 source code.
The return values should always have dimsof(cells).
If FCOLOR is a single integer, the slice will be an isosurface for
the FCOLORth variable associated with the mesh M3.
If the optional argument after FCOLOR is non-nil and non-zero,
then the FCOLOR function is called with only two arguments:
func fcolor(m3, cells)
interpreted function, defined at i/slice3.i line 203
|
SEE ALSO:
|
mesh3,
plane3,
xyz3,
getv3,
getc3,
slice2,
plfp
|
snap
|
snap(f, rays)
or snap(f, rays, slimits)
returns the time-integrated specific intensity for the rad-hydro
problem dumped in file F, on the specified RAYS, with the
specified limits SLIMITS on the transport integrals.
The first dimension of RAYS may be length 3, 5, or 6 to represent
the ray(s) in TDG/DIRT coordinates (x,y,theta), "best" coordinates
(x,y,z,theta,phi), or internal coordinates (cos,sin,y,z,x,r),
respectively. The remaining dimensions of RAYS, if any, will be
called "nrays" below.
The SLIMITS parameter, if present, is the value of the s-coordinate
-- position along the ray -- at which to start and stop the
integration of the transport equation. SLIMITS may be nil, a 1-D
array of length 2, or a 2-by-nrays array. Each component of SLIMITS
is [s_start, s_stop]; if s_stop line 193
|
SEE ALSO:
|
reset_options,
streak,
streak_save,
integ_flat,
integ_linear,
streak_times,
form_rays,
best_rays,
dirt_rays,
internal_rays
|
snap_worker
|
snap_worker(transp, selfem, time)
The snap function actually works by replacing the drat_compress
with snap_worker. See the source for snap in drat.i for details.
interpreted function, defined at i0/drat.i line 272
|
solar_system
|
xyz = moon(time)
return position XYZ of the moon relative to center of earth
at TIME; the XYZ has leading dimension 3; x is along the vernal
equinox, z is ecliptic north. Corrections due to Schlyter (see
sch_planets) are applied. Claimed accurate to under 1 arc minute
over some reasonable time. TIME is in days since 0/Jan/00 (that is,
0000 UT 31/Dec/99). This is 1.5 days earlier than the J2000 epoch.
interpreted function, defined at i/kepler.i line 342
|
SEE ALSO:
|
solar_system,
sch_moon,
kepler
|
solve
|
solve
interpreted function, defined at i/demo4.i line 45
|
sort
|
sort(x)
or sort(x, which)
returns an array of longs with dimsof(X) containing index values
such that X(sort(X)) is a monotonically increasing array. X can
contain integer, real, or string values. If X has more than one
dimension, WHICH determines the dimension to be sorted. The
default WHICH is 1, corresponding to the first dimension of X.
WHICH can be non-positive to count dimensions from the end of X;
in particular a WHICH of 0 will sort the final dimension of X.
WARNING: The sort function is non-deterministic if some of the
values of X are equal, because the Quick Sort algorithm
involves a random selection of a partition element.
For information on sorting with multiple keys (and on making
sort deterministic), type the following:
#include "msort.i"
help, msort
builtin function, documented at i0/std.i line 1129
|
SEE ALSO:
|
median,
digitize,
interp,
integ,
histogram
|
sort3d
|
sort3d(z, npolys, &list, &vlist)
given Z and NPOLYS, with numberof(Z)==sum(npolys), return
LIST and VLIST such that Z(VLIST) and NPOLYS(LIST) are
sorted from smallest average Z to largest average Z, where
the averages are taken over the clusters of length NPOLYS.
Within each cluster (polygon), the cyclic order of Z(VLIST)
remains unchanged, but the absolute order may change.
This sorting order produces correct or nearly correct order
for a plfp command to make a plot involving hidden or partially
hidden surfaces in three dimensions. It works best when the
polys form a set of disjoint closed, convex surfaces, and when
the surface normal changes only very little between neighboring
polys. (If the latter condition holds, then even if sort3d
mis-orders two neighboring polys, their colors will be very
nearly the same, and the mistake won't be noticeable.) A truly
correct 3D sorting routine is impossible, since there may be no
rendering order which produces correct surface hiding (some polys
may need to be split into pieces in order to do that). There
are more nearly correct algorithms than this, but they are much
slower.
interpreted function, defined at i/pl3d.i line 880
|
SEE ALSO:
|
get3_xy
|
sound
|
sound
Set up the initial conditions for evolve to launch a weak sound wave.
interpreted function, defined at i/demo1.i line 62
|
SEE ALSO:
|
shock,
evolve
|
span
|
span(start, stop, n)
or span(start, stop, n, which)
returns array of N doubles equally spaced from START to STOP.
The START and STOP arguments may themselves be arrays, as long as
they are conformable. In this case, the result will have one
dimension of length N in addition to dimsof(START, STOP).
By default, the result will be N-by-dimsof(START, STOP), but
if WHICH is specified, the new one of length N will be the
WHICHth. WHICH may be non-positive to position the new
dimension relative to the end of dimsof(START, STOP); in
particular WHICH of 0 produces a result with dimensions
dimsof(START, STOP)-by-N.
builtin function, documented at i0/std.i line 1033
|
SEE ALSO:
|
spanl,
indgen,
array
|
spanl
|
spanl(start, stop, n)
or spanl(start, stop, n, which)
similar to the span function, but the result array have N points
spaced at equal ratios from START to STOP (that is, equally
spaced logarithmically). See span for discussion of WHICH argument.
START and STOP must have the same algebraic sign for this to make
any sense.
interpreted function, defined at i0/std.i line 1049
|
SEE ALSO:
|
span,
indgen,
array
|
spann
|
spann(zmin, zmax, n)
return no more than N equally spaced "nice" numbers between
ZMIN and ZMAX.
interpreted function, defined at i0/graph.i line 1668
|
SEE ALSO:
|
span,
spanl,
plc,
plfc
|
spin3
|
spin3
or spin3, nframes
or spin3, nframes, axis
Spin the current 3D display list about AXIS over NFRAMES. Keywords
tlimit= the total time allowed for the movie in seconds (default 60),
dtmin= the minimum allowed interframe time in seconds (default 0.0),
bracket_time= (as for movie function in movie.i)
The default AXIS is [-1,1,0] and the default NFRAMES is 30.
interpreted function, defined at i/pl3d.i line 945
|
SEE ALSO:
|
rot3
|
spline
|
dydx= spline(y, x)
-or- yp= spline(dydx, y, x, xp)
-or- yp= spline(y, x, xp)
computes the cubic spline curve passing through the points (X, Y).
With two arguments, Y and X, spline returns the derivatives DYDX at
the points, an array of the same length as X and Y. The DYDX values
are chosen so that the piecewise cubic function returned by the four
argument call will have a continuous second derivative.
The X array must be strictly monotonic; it may either increase or
decrease.
The values Y and the derivatives DYDX uniquely determine a piecewise
cubic function, whose value is returned in the four argument form.
In this form, spline is analogous to the piecewise linear interpolator
interp; usually you will regard it as a continuous function of its
fourth argument, XP. The first argument, DYDX, will normally have
been computed by a previous call to the two argument spline function.
However, this need not be the case; another DYDX will generate a
piecewise cubic function with continuous first derivative, but a
discontinuous second derivative. For XP outside the extreme values
of X, spline is linear (if DYDX1 or DYDX0 keywords were specified,
the function will NOT have continuous second derivative at the
endpoint).
The XP array may have any dimensionality; the result YP will have
the same dimensions as XP.
If you only want the spline evaluated at a single set of XP, use the
three argument form. This is equivalent to:
yp= spline(spline(y,x), y, x, xp)
The keywords DYDX1 and DYDX0 can be used to set the values of the
returned DYDX(1) and DYDX(0) -- the first and last values of the
slope, respectively. If either is not specified or nil, the slope at
that end will be chosen so that the second derivative is zero there.
The function tspline (tensioned spline) gives an interpolation
function which lies between spline and interp, at the cost of
requiring you to specify another parameter (the tension).
interpreted function, defined at i/spline.i line 10
|
SEE ALSO:
|
interp,
tspline
|
split
|
T splits tensor tens into n^p subtensor
where p = dimsof(tens)(1) and returns
a tensor of dimension p+1 where the last index runs alongs
the subtensors; works in dimensions 2 to 5.
interpreted function, defined at contrib/split.i line 264
|
split_bytscl
|
split_bytscl(x, 0)
or split_bytscl(x, 1)
as bytscl function, but scale to the lower half of a split
palette (0-99, normally the color scale) if the second parameter
is zero or nil, or the upper half (100-199, normally the gray
scale) if the second parameter is non-zero.
interpreted function, defined at i/slice3.i line 1253
|
SEE ALSO:
|
split_palette
|
split_palette
|
split_palette
or split_palette, "palette_name.gp"
split the current palette or the specified palette into two
parts; colors 0 to 99 will be a compressed version of the
original, while colors 100 to 199 will be a gray scale.
interpreted function, defined at i/slice3.i line 1226
|
SEE ALSO:
|
pl3tree,
split_bytscl
|
splitb
|
T rebuild tensor tens from n^p subtensor
interpreted function, defined at contrib/split.i line 335
|
SEE
|
ALSO,
split,,
bsplit,,
vsplit,,
esplit
|
sprime
|
ypprime= sprime(dydx, y, x, xp)
computes the derivative of the cubic spline curve passing through the
points (X, Y) at the points XP.
The DYDX values will have been computed by a previous call to SPLINE,
and are chosen so that the piecewise cubic function returned by the four
argument call will have a continuous second derivative.
The X array must be strictly monotonic; it may either increase or
decrease.
interpreted function, defined at i/spline.i line 309
|
sqrt
|
sqrt(x)
returns the square root of its argument.
builtin function, documented at i0/std.i line 649
|
SEE ALSO:
|
abs
|
srcanchor
|
NT
srcanchor, infile, outfile, tags
convert yorick source to html
Copy infile to outfile quoting any html special characters, inserting
anchors at function definitions/declarations, and cross-referencing
function calls to definitions. Tags should be a two dimensional string
array containing in tags (1,) the function names, and in tags(2,),
tags(3,) and tags(4,) the directory, file, and line where each functions
is defined/declared.
interpreted function, defined at contrib/htmldoc.i line 426
|
SEE ALSO:
|
mkhtmldoc,
tagscan,
mkdoc
|
strchr
|
strchr -- get first/last index of a character in a string
SYNOPSIS: i = strchr(s, c)
i = strchr(s, c, last=1)
DIAGNOSTIC: returns 0 if character C is not found in string S.
HISTORY: October 27, 1995 by Eric THIEBAUT.
interpreted function, defined at i/string.i line 155
|
SEE ALSO:
|
strmatch
|
streak
|
streak(f, rays)
or streak(f, rays, slimits)
returns the transparency and self-emission as functions of time for
the rad-hydro problem dumped in file F, on the specified RAYS, with
the specified limits SLIMITS on the transport integrals.
The first dimension of RAYS may be length 3, 5, or 6 to represent
the ray(s) in TDG/DIRT coordinates (x,y,theta), "best" coordinates
(x,y,z,theta,phi), or internal coordinates (cos,sin,y,z,x,r),
respectively. The remaining dimensions of RAYS, if any, will be
called "nrays" below.
The SLIMITS parameter, if present, is the value of the s-coordinate
-- position along the ray -- at which to start and stop the
integration of the transport equation. SLIMITS may be nil, a 1-D
array of length 2, or a 2-by-nrays array. Each component of SLIMITS
is [s_start, s_stop]; if s_stop line 38
|
SEE ALSO:
|
reset_options,
snap,
streak_save,
integ_flat,
integ_linear,
streak_times,
form_rays,
best_rays,
dirt_rays,
internal_rays,
apply_funcs
|
streak_save
|
streak_save, outname, f, rays
or streak_save, outname, f, rays, slimits
or streak_save, outfile, f, rays, slimits
is the same as the streak function, except that the results of
the transport calculation are placed into a PDB file called
OUTNAME, instead of being accumulated in memory. All of the
options for the streak function are available, except for
drat_compress (which is set to streak_saver).
If the first argument is OUTFILE, a file variable instead of a
file name, then that file is used for output. You can create
OUTFILE and add static variables to it with save (but do NOT call
add_record) which streak_save otherwise wouldn't know about.
The output file has history records at the same times as the
input file. Each record contains "time" (a double scalar),
and the two arrays "transp", the transparency (between 0 and 1),
and "selfem", the self emission (which has the same units as
ekap in the file F). The dimensions of transp and selfem
are ngroup-by-2-by-nrays (where nrays represents zero or more
dimensions, copied from the RAYS input array). The RAYS and
SLIMITS inputs are placed into the output file as non-record
variables, and any variables in the drat_static option are
copied form F to the output file. The gb and gav variables
are copied from F into the output file as well. If the drat_glist
option is present, that is stored in the output file also.
OPTIONS: all options available for streak except drat_compress,
drat_gb, drat_gav, drat_static
interpreted function, defined at i0/drat.i line 295
|
SEE ALSO:
|
streak,
snap
|
streak_saver
|
streak_saver(transp, selfem, time)
The streak_save function actually works by replacing the drat_compress
with streak_saver. See the source for streak_saver in drat.i for
details.
interpreted function, defined at i0/drat.i line 366
|
streak_times
|
streak_times(f)
returns the times from file F whic lie between the optional
drat_start and drat_stop.
interpreted function, defined at i0/drat.i line 897
|
SEE ALSO:
|
drat_start,
drat_stop
|
strlen
|
strlen(string_array)
returns an long array with dimsof(STRING_ARRAY) containing the
lengths of the strings. The null string (0) is considered to
have length 0, just like "".
builtin function, documented at i0/std.i line 1226
|
SEE ALSO:
|
strmatch,
strpart,
strtok
|
strmatch
|
strmatch(string_array, pattern)
or strmatch(string_array, pattern, case_fold)
returns an int array with dimsof(STRING_ARRAY) with 0 where
PATTERN was not found in STRING_ARRAY and 1 where it was found.
If CASE_FOLD is specified and non-0, the pattern match is
insensitive to case, that is, an upper case letter will match
the same lower case letter and vice-versa.
builtin function, documented at i0/std.i line 1252
|
SEE ALSO:
|
strtok,
strpart,
strlen
|
strpart
|
strpart(string_array, m:n)
returns another string array with the same dimensions as
STRING_ARRAY which consists of characters M through N of
the original strings. M and N are 1-origin indices; if
M is omitted, the default is 1; if N is omitted, the default
is the end of the string. If M or N is non-positive, it is
interpreted as an index relative to the end of the string,
with 0 being the last character, -1 next to last, etc.
Finally, the returned string will be shorter than N-M+1
characters if the original doesn't have an Mth or Nth
character, with "" (note that this is otherwise impossible)
if neither an Mth nor an Nth character exists. A 0
is returned for any string which was 0 on input.
builtin function, documented at i0/std.i line 1263
|
SEE ALSO:
|
strmatch,
strtok,
strlen
|
strtok
|
strtok(string_array, delimiters)
or strtok(string_array)
strips the first token off of each string in STRING_ARRAY.
A token is delimited by any of the characters in the string
DELIMITERS. If DELIMITERS is blank, nil, or not given, the
default DELIMITERS is " \t\n" (blanks, tabs, or newlines).
The result is a string array ts with dimensions
2-by-dimsof(STRING_ARRAY); ts(1,) is the first token, and
ts(2,) is the remainder of the string (the character which
terminated the first token will be in neither of these parts).
The ts(2,) part will be 0 (i.e.- the null string) if no more
characters remain after ts(1,); the ts(1,) part will be 0 if
no token was present. A STRING_ARRAY element may be 0, in
which case (0, 0) is returned for that element.
builtin function, documented at i0/std.i line 1234
|
SEE ALSO:
|
strmatch,
strpart,
strlen
|
strtolower
|
strtolower -- convert a string to lower case letters
SYNOPSIS: s2 = strtolower(s)
HISTORY: October 10, 1995 by Eric THIEBAUT.
interpreted function, defined at i/string.i line 90
|
SEE ALSO:
|
strtoupper
|
strtoupper
|
strtoupper -- convert a string to upper case letters
SYNOPSIS: s2 = strtoupper(s)
HISTORY: October 10, 1995 by Eric THIEBAUT.
interpreted function, defined at i/string.i line 76
|
SEE ALSO:
|
strtolower
|
strtrim
|
strtrim(string)
or strtrim(string, which)
or strtrim(string, which, blank=blank)
returns STRING without leading and/or trailing blanks. If STRING is
only made of blanks, return "". If STRING is 0x0, return 0x0.
If WHICH is 1, trim leading blanks (least expensive). If WHICH is 2,
trim trailing blanks (a more costly operation). If WHICH is 3, (the
default) trim both leading and trailing blanks.
If STRING is an array of strings, result has same dimensions.
The BLANK keyword is a string constituted by characters considered
as blanks; by default, BLANK is " \t\n" meaning that spaces,
tabs, and newlines are discarded.
In the BLANK string, "^", "]", and "-" are treated specially:
"]" and "-", if present, should come first in the list to avoid
special treatment, while "^" should not come first.
interpreted function, defined at i/string.i line 114
|
struct_align
|
struct_align, file, alignment
in binary file FILE, align new struct members which are themselves
struct instances to begin at a byte address which is a multiple of
ALIGNMENT. (This affects members declared explicitly by add_member,
as well as implicitly by save or add_variable.) If ALIGNMENT is <=0,
returns to the default for this machine. The struct alignment is in
addition to the alignment implied by the most restrictively aligned
member of the struct. Most machines want ALIGNMENT of 1.
builtin function, documented at i0/std.i line 2642
|
SEE ALSO:
|
add_member
|
structof
|
structof(object)
returns the data type of OBJECT, or nil for non-array OBJECTs.
Use typeof(object) to get the ASCII name of a the data type.
builtin function, documented at i0/std.i line 329
|
SEE ALSO:
|
typeof,
dimsof,
numberof,
sizeof,
nameof
|
sum
|
sum(x)
returns the scalar sum of all elements of its array argument.
builtin function, documented at i0/std.i line 774
|
SEE ALSO:
|
avg,
min,
max
|
sun3_primitives
|
sun3_primitives, file
sets FILE primitive data types to be native to Sun-2 or Sun-3.
interpreted function, defined at i0/std.i line 2104
|
sun_primitives
|
sun_primitives, file
sets FILE primitive data types to be native to Sun, HP, IBM, etc.
interpreted function, defined at i0/std.i line 2096
|
symbol_def
|
symbol_def(func_name)(arglist)
or symbol_def(var_name)
invokes the function FUNC_NAME with the specified ARGLIST,
returning the return value. ARGLIST may be zero or more arguments.
In fact, symbol_def("fname")(arg1, arg2, arg3) is equivalent to
fname(arg1, arg2, arg3), so that "fname" can be the name of any
variable for which the latter syntax is meaningful -- interpreted
function, built-in function, or array.
Without an argument list, symbol_def("varname") is equivalent to
varname, which allows you to get the value of a variable whose name
you must compute.
DO NOT OVERUSE THIS FUNCTION. It works around a specific deficiency
of the Yorick language -- the lack of pointers to functions -- and
should be used for such purposes as hook lists (see openb).
builtin function, documented at i0/std.i line 2941
|
SEE ALSO:
|
symbol_set
|
symbol_set
|
symbol_set, var_name, value
is equivalent to the redefinition
varname= value
except that var_name="varname" is a string which must be computed.
DO NOT OVERUSE THIS FUNCTION. It works around a specific deficiency
of the Yorick language -- the lack of pointers to functions, streams,
bookmarks, and other special non-array data types.
builtin function, documented at i0/std.i line 2962
|
SEE ALSO:
|
symbol_def
|
sysafe
|
sysafe, "command line"
or system, "command line"
pass the command line to a UNIX sh (Bourne) shell for execution.
This requires a fork() system call, which in turn makes a copy of
the yorick executable in virtual memory before replacing that copy
with the sh shell. If yorick has grown to enormous size, the copy
can bring your machine to its knees or kill it. If you include
sysafe.i before yorick grows (before you start the calculation that
requires the large data arrays), a pipe is opened to an sh which
remains running, and the original system command is replaced by
sysafe. Future system commands will be piped to the already
running sh, so no dangerous copy operation is required.
There are four problems with this approach:
(1) You can't run interactive programs with sysafe, because the
stdin is from the pipe (sysafe_pipe) instead of the keyboard.
Attempting to do so may lock up yorick.
(2) Since the command runs asynchronously now, yorick can't wait
until it completes, and yorick's prompt will often precede
the output from the command, unlike using the default system
function.
(3) Some typographical errors in commands may kill the sh; since
you don't start a new one each time, the system command will
stop working.
(4) The shorthand $ syntax still uses the dangerous system call;
you need to call system as an ordinary function for sysafe
to protect you.
interpreted function, defined at i/sysafe.i line 10
|
SEE ALSO:
|
system_orig
|
system
|
system, "shell command line"
Passes the command line string to a shell for execution.
If the string is constant, you may use the special syntax:
$shell command line
(A long command line may be continued by ending the line with \
as usual.) The system function syntax allows Yorick to compute
parts of the command line string, while the simple $ escape
syntax does not. In either case, the only way to get output
back from such a command is to redirect it to a file, then
read the file. Note that Yorick does not regain control
until the subordinate shell finishes. (Yorick will get control
back if the command line backgrounds the job.)
WARNING: If Yorick has grown to a large size, this may crash
your operating system, since the underlying POSIX fork function
first copies all of the running Yorick process before the exec
function can start the shell. See Y_SITE/sysafe.i for a fix.
builtin function, documented at i0/std.i line 191
|
SEE ALSO:
|
popen
|
|