randata [ parameter=value ... ] [ outputfile ]
Parameters are: num_dims, master_file, num_lines, num_samples, var_type, max_value, min_value, seed_value.
randata makes a single variable, one or two-dimensional dataset with random values. For two-dimensional datasets, the size of the dataset is based on the size of a specified master dataset or by specifying the size of the dimensions line and sample. For one-dimensional datasets, the size of the dataset is determined by specifying the size of the dimension sample.
Any valid Terascan datatype can be used for the output variable type (datasets). The output variable is named 'x'. The random values are scaled to lie within the user specified values of max_value and min_value. A seed_value can be supplied to make individual random datasets unique.
There are no input TeraScan datasets. There is exactly one output TeraScan dataset.
This specifies the number of dimensions of the output dataset.
Valid responses are [1 or 2]. The default is 1.
If num_dims=2, then master_file can optionally be used to specify the name of the master dataset used to define the region of interest (and thus also the size of the dataset).
A valid response is any TeraScan dataset that contains an earth transform. The default is no master.
If num_dims=2 and master_file = '' (i.e. none), it is necessary to specify the number of lines in the dataset.
Valid responses are [>0]. There is no default.
If num_dims=1 or if master_file = '', it is necessary to specify the number of samples in the output dataset.
Valid responses are [>0]. There is no default.
This is the data type of the output variable. The data can be either byte (unsigned 8-bit), short (16-bit signed integer), long (32-bit signed integer), float (32-bit real) or double (64-bit real).
Valid responses are [byte, short, long, real, or double]
There is no default.
This is the maximum value of a random number in the output dataset variable. This value must be less than or equal to the maximum valid value for the specified var_type.
Valid responses are the numeric range of var_type. The default is [1].
This is the minimum value of a random number in the output dataset variable. This value must be greater than or equal to the minimum valid value for the specified var_type.
Valid responses are the numeric range of var_type. The default is [0].
This is a seed value to initiate the random number generator. Unique datasets can be created by specifying different values of seed_value.
Valid responses are any integer. The default is [0].
This is an example that creates a two-dimensional random value dataset. The name of the dataset is n12.randata. This procedure is for research purposes.
% randata output file : char(255) ? n12.randata num_dims : int ? [1] 2 master_file : char( 15) ? [] n12.93201.0221 var_type : char( 6) ? sh max_value : real ? [1] 50 min_value : real ? [0] -50 seed_value : real ? [0] 12345679 %
Emath2 combines the original dataset with the random value dataset into a new dataset called n12.ran.
% emath2 n12.*.0221 n12.randata n12.ran file1_vars : char(255) ? *ch3 file2_vars : char(255) ? x expression : char(255) ? x1+x2 var_name : char( 31) ? ch3n var_units : char( 31) ? [] var_type : char( 15) ? [float] sh offset : real ? [0] scale_factor : real ? : %
Display both the original image and the random value image side by side. The differences will be quite noticable.
Note, this example adds only 10% noise to the original image dataset. The percent of random values added are at the user's discretion.
spectral, testim, fakedata, master, const2d, spect, spect2d, xcorrel
The UNIX functions srand48 and drand48 are used to generate the random numbers. srand48 defines the seed; drand48 generate uniformly random numbers in the interval [0, 1).
seed_value is rounded to the nearest integer prior to passing to srand48.
When the output datatype is floating point, the following formula is used to scale the data into the range [min_value, max_value):
(max_value - min_value)*drand48() + min_value
When the output datatype is fixed point, the following formula is used to scale the data into the range [min_value, max_value]:
(int)((max_value - min_value + 1.)*drand48()) + min_value
In the second formula, min_value and max_value are first rounded to nearest integers.
Last Update: $Date: 1998/05/29 20:19:40 $