Package reflectometry :: Package model1d :: Package model :: Module auxs

Module auxs

source code

Supplementary or auxiliary Functions
Functions
 
vector(n)
Return a vector of the given length.
source code
 
dense(v)
Force v to be a dense array.
source code
 
ravel(biglist)
Ravels a list of lists into a single list.
source code
 
takelist(biglist, indices)
mimics numeric.take
source code
 
combine(biglist)
combines a list of lists into one list and removes duplicates
source code
 
resize_array(array, newlen)
resise an array to new length
source code
 
pmp(x, p)
pmp(x,p) returns the pair x plus/minus p%
source code
 
pm(x, v)
pm(x,v) returns the pair x plus/minus v
source code
 
isInt(v)
Check variable v is a int or not?
source code
 
isLong(v)
Check variable v is a Long or not?
source code
 
isFloat(v)
Check variable v is a float or not?
source code
 
isBool(v)
Check variable v is a boolean or not?
source code
 
isString(v)
Check variable v is a string or not?
source code
 
isType(v)
Check variable v is a type or not?
source code
 
isObject(v)
Check variable v is a object or not?
source code
 
isvector(v)
Check variable v is a vector or not?
source code
 
isfactory(v)
Check variable v is a factory or not?
source code
 
isscientific(v)
Return true if string v contains value(uncertainty).
source code
 
clipboard(vectors, labels=None)
clipboard((v1,v2,...),labels=('label1','label2',...))
source code
 
getBmpImage4Fig(fig) source code
 
CopyImage(canvas, plotType=0)
0: matplotlib plot 1: wx.lib.plot 2: other
source code
 
CopyImageOLD(canvas)
From PBSrefl
source code
 
AFloat(x)
Change a variable x into a scalar float varible
source code
 
tFloat(x)
Change a variable x into a scalar float varible
source code
 
readdata(filename)
Read data from file
source code
 
savedata(data, filename)
Save data into file.
source code
Function Details

dense(v)

source code 

Force v to be a dense array.

The return value may be different from the input value. If used as a return vector, be sure to call it as v=dense(v); f(v) rather than f(dense(v)) because the latter form will send a temporary vector to f() which is immediately garbage collected. If the vector is a pure input vector the two forms are equivalent.

ravel(biglist)

source code 

Ravels a list of lists into a single list.

Similar to numpy.ravel() except you don't need each list to have the same number of elements

takelist(biglist, indices)

source code 

mimics numeric.take

except lists can be comprised of any element(even other lists)

pmp(x, p)

source code 

pmp(x,p) returns the pair x plus/minus p%

This is useful for constructing fitting variables centered around a particular value. Note that the book values can vary due to e.g., density changes in the material from thermal expansion.

pm(x, v)

source code 

pm(x,v) returns the pair x plus/minus v

This is useful for constructing fitting variables centered around a particular value.

isscientific(v)

source code 

Return true if string v contains value(uncertainty).

This implementation does not check that value and uncertainty are indeed numbers.

clipboard(vectors, labels=None)

source code 

clipboard((v1,v2,...),labels=('label1','label2',...))

Put vectors v1,v2,... onto the clipboard with columns separated by tabs and rows separated by linefeed. If labels is specified, a label will be added to the head of each column.

readdata(filename)

source code 

Read data from file

readdata(filename) Read a multicolumn data file ignoring lines starting with '#'

savedata(data, filename)

source code 
Save data into file. Data is assumed to be five column reflectivity data Q,dQ,R,dR,wavelength.