pwem.protocols.protocol_metadata_editor module

class pwem.protocols.protocol_metadata_editor.ProtMetadataEditor(**kwargs)[source]

Bases: pwem.protocols.protocol.EMProtocol

Protocol to edit attributes of all the items of a set using a formula. This could be useful for corrupting your data for testing purposes or editing some values in the set that make sense to do it. Use this with extreme care, you can easily ruin your processing.


Goes through all items in the input set and applies the formula to each of them using exec. Complex python code could be run separating lines with ; To use numpy you could do import numpy; item._resolution.set(numpy.random.randint(10))