As a computational user with data from Smoldyn or MEDYAN, I want to be able to center my spatial data as a part of the conversion process so that I don't have to filter it in a separate step after converting.
Acceptance Criteria
SmoldynData and MedyanData have a new center bool member that defaults to True and if True, the spatial values of the data are centered around the origin (0, 0, 0) during conversion.
Details
The examples notebooks for Smoldyn and MEDYAN include an extra step for filtering with the TranslateFilter after conversion. We want to elimate the need for this step.
The implementation of TranslateFilter shows basically how we want to do this, except there will be one translation value that is used for every agent, instead of different translations for different agent IDs.
In order to get the translation amount, after we parse through the data, we can get the min and max values for X, Y, and Z using numpy slicing, and then offset all the positions by -0.5 * (max - min).
Use Case
As a computational user with data from Smoldyn or MEDYAN, I want to be able to center my spatial data as a part of the conversion process so that I don't have to filter it in a separate step after converting.
Acceptance Criteria
SmoldynData
andMedyanData
have a newcenter
bool member that defaults toTrue
and ifTrue
, the spatial values of the data are centered around the origin (0, 0, 0) during conversion.Details
The examples notebooks for Smoldyn and MEDYAN include an extra step for filtering with the
TranslateFilter
after conversion. We want to elimate the need for this step.The implementation of
TranslateFilter
shows basically how we want to do this, except there will be onetranslation
value that is used for every agent, instead of different translations for different agent IDs.In order to get the translation amount, after we parse through the data, we can get the min and max values for X, Y, and Z using numpy slicing, and then offset all the positions by
-0.5 * (max - min)
.