Particle File List
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: the particle files still need to be stored somewhere. They can be stored in any Dynamo storage folder (as classical Dynamo folders or 'dBoxes folders ), but this restriction is not necessary. Any
Contents
When to use it
Converting old data folders
Converting one single data folder
You can get a file representing a ParticleFileList object simply with the command:
dpkdata.containers.ParticleListFile.data2starFile(,<star file>);
This file can be used as input for average or an alignment project. You can use a table flag in order to pass a table. With this format, the tags of the particles are not changed.
Merging several data folders
The command for this functionality is:
dpkdata.containers.ParticleListFile.mergeDataFolders which is be fed with a cell array of names of data folders. Here, you can pass along a cell array of tables (one per data folder) using the flag table
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. All particles of all files are indexed into a single new object that keeps track of data folders and tables, renaming the tags coherently. Note that initial particle files are not moved or copied; the new object just references them. In this example, it is fed into average, but if can be input into a project (after saving the object into a star file).
<nowiki>% 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); </nowki>