3. dataList

dataList contain a list of dataArray.

  • Subclass of list as lists of dataArrays (allowing variable sizes).
  • Basic list routines as read/save, appending, selection, filter, sort, prune, interpolate, spline…
  • Multidimensional least square fit that uses the attributes of the dataArray elements.
  • Read/Write in human readable ASCII text of multiple files in one run (gzip possible) or pickle.
  • A file may contain several datasets and several files can be read.

For Beginners:

  • Create a dataList and use the methods from this object in point notations.:

    data=js.dL('filename.dat').
    data.prune(number=100)
    data.attr
    data.save('newfilename.dat')
    
  • The dataList methods should not be used directly from this module.

See dataList for details.

Example:

p=js.grace()
dlist2=js.dL()
x=np.r_[0:10:0.5]
D,A,q=0.45,0.99,1.2
for q in np.r_[0.1:2:0.2]:
   dlist2.append(js.dA(np.vstack([x,np.exp(-q**2*D*x),np.random.rand(len(x))*0.05])) )
   dlist2[-1].q=q
p.clear()
p.plot(dlist2,legend='Q=$q')
p.legend()
dlist2.save('test.dat.gz')

The dataarray module can be run standalone in a new project.

3.1. dataList Class

dataList
  • dataList creating by dataL=js.dL(‘filename.dat’) or from numpy arrays.
  • List columns can be accessed as automatic generated attributes like .X,.Y,.eY (see protectedNames). or by indexing as *dataL[:,0] -> .X * for all list elements.
  • Corresponding column indices are set by setColumnIndex() (default X,Y,eY = 0,1,2).
  • Multidimensional fitting of 1D,2D,3D (.X,.Z,.W) data including additional attributes. .Y (scalar) are used as function values at coordinates.
  • Attributes can be set like: dataL.aName= 1.2345 or dataL[2].aName= 1.2345
  • Individual elements and dataArray methods can be accessed by indexing data[2].bName
  • Methods are used as dataL.methodname(arguments)

3.2. Attribute Methods

dataList.attr
dataList.commonAttr
dataList.dtype
dataList.names
dataList.whoHasAttributes
dataList.showattr

3.3. Fit Methods

dataList.fit
dataList.modelValues
dataList.setLimit
dataList.hasLimit
dataList.setConstrain
dataList.hasConstrain
dataList.makeErrPlot
dataList.makeNewErrPlot
dataList.detachErrPlot
dataList.killErrPlot
dataList.showlastErrPlot
dataList.errPlot
dataList.savelastErrPlot
dataList.interpolate
dataList.polyfit
dataList.extrapolate
dataList.bispline

3.4. Housekeeping Methods

dataList.setColumnIndex
dataList.append
dataList.extend
dataList.insert
dataList.prune
dataList.savetxt
dataList.sort
dataList.reverse
dataList.delete
dataList.extractAttribut
dataList.filter
dataList.index
dataList.merge
dataList.mergeAttribut
dataList.pop
dataList.copyattr2elements
dataList.getfromcomment
dataList.transposeAttribute