Particle File List

From Dynamo
Revision as of 17:06, 30 September 2019 by Daniel Castaño (talk | contribs)
Jump to navigation Jump to search

The Particle File List is a generic data container that can be used an alternative for Data folder. This object contains a list of tags and a list of particle files, both lists having equal length.Thus, the tag of. a file is defined by the value of tag property inside the object, not by the name of particle file (unlike in a classic Dynamo folder). The ParticleListFile object is just a wrapper on a list of files,

When to use it

Converting old data folders

dpkdata.containers.ParticleListFile.data2starFile(,<star file>);

Example of use

The script below is In your Dynamo distribution under

dpkdata.examples.setOfDataFoldersIntoParticleListFile.

It creates three classical data folders, each with its own 8 particles, and a table to refer them. This table contains the actual alignment parameters of the particles in the respective data folder.


% create three different data folders

N = 3; testNameRoot = 'testFolder'; for i=1:N

  testName{i} = sprintf('%s%03d',testNameRoot,i)
  
  % each folder has the same particle tags (1 to 8), but the same 
  % tag on each folder is a different particle
  dynamo_tutorial(testName{i},'real_random',1,'linear_tags',1); 

end

%% % keeps the positions of data and tables for i=1:N

  dataname{i}  = mbparse.files.absolutePath.getAbsolutePath([testName{i},filesep,'/data']);
  tableName{i} = mbparse.files.absolutePath.getAbsolutePath([testName{i},filesep,'/real.tbl']);

end

% % merges all data folders into one single ParticleListFile object %

% we can pass a table attached to each data folder plf = dpkdata.containers.ParticleListFile.mergeDataFolders(dataname,'tables',tablename);

% The storage object keeps track of the accumulated metadata

% gets a table of the old Dynamo style (just a matrix of numbers) tMerged = plf.metadata.table.getClassicalTable();

% computes the average in the classical way ws = daverage(plf,'t',tMerged);