emxlib.utils module¶
MODIFICATION ADVICE:
Please, do not generate or distribute a modified version of this file under its original name.
- class emxlib.utils.EmxData[source]¶
Bases:
object
Class to group EMX objects
- getFirstObject(className)[source]¶
Return the first object of a given className. This function should be called after read.
- class emxlib.utils.EmxImage(fileName=None, index=None)[source]¶
Bases:
emxlib.utils.EmxObject
Base class for EmxMicrograph and EmxParticle. Both share that have FILENAME and INDEX as primary keys.
- class emxlib.utils.EmxLabel(type, unit=None)[source]¶
Bases:
object
Auxiliary class to assign data type (i.e.: int, str, etc) and unit to each attribute/label pair.
- class emxlib.utils.EmxMicrograph(fileName=None, index=None)[source]¶
Bases:
emxlib.utils.EmxImage
Class for Micrographs
- class emxlib.utils.EmxObject[source]¶
Bases:
object
Base class for all EMX objects/classes name is the class type so far micrograph or particles
- get(key, default=None)[source]¶
Given a key (attribute name) returns the value assigned to it. If not present, the default will be returned.
- iterAttributes()[source]¶
Returns list with valid keys (attribute names) and values for this class. Primary keys are ignored
- iterForeignKeys()[source]¶
Returns list with valid primary keys (attribute names) and values for this class
- class emxlib.utils.EmxParticle(fileName=None, index=None)[source]¶
Bases:
emxlib.utils.EmxImage
Class for Particles
- class emxlib.utils.EmxXmlMapper(emxData)[source]¶
Bases:
object
Mapper for XML
- firstObject(classname, fileName)[source]¶
Iterate over the tags elements and find the first one of type ‘classname’, build the object and return it. The foreing keys will be not updated.
- objectToXML(object)[source]¶
Given an object persist it in XML dataBase. Each object goes to a different element. Much much faster…
- readEMXFile(fileName, classElement=None)[source]¶
create tree from xml file If classElement is not None, the first element of this class will be returned
- emxlib.utils.validateSchema(filename, schema_file=None)[source]¶
Code from astropy project released under BSD licence Validates an XML file against a schema or DTD.
Functions to do XML schema and DTD validation. At the moment, this makes a subprocess call first to xerces then to xmllint. This could use a Python-based library at some point in the future, if something appropriate could be found. lxml is a possibility but has too many dependences if anyone knows about a pure python validator let my know