1 """
2 Building STC-X documents, xmlstan-style.
3 """
4
5
6
7
8
9
10
11 from gavo.stc import common
12 from gavo.utils.stanxml import Element
13
14
16 """is a metaclass for xmlstan namespaces that contain substitution
17 groups.
18
19 You get a _addSubsGroup class method on these.
20 """
22 """adds baseClass under all of validNames into namespace.
23 """
24 for n in validNames:
25 class dynamicallyDefined(baseClass):
26 name_ = n
27 setattr(cls, n, dynamicallyDefined)
28
29
31 """is a container for classes modelling STC elements.
32 """
33 __metaclass__ = NamespaceWithSubsGroup
34
47
50
53
56
57 - class Name(OptionalSTCElement): pass
61
70
76
78
83
88
89 - class T_matrix(OptionalSTCElement): pass
90
93
94
95 - class Epoch(OptionalSTCElement):
97
106 - class Vector(STCElement): pass
107 - class Offset(T_double1): pass
108
118
120 - class Union(T_Region): pass
124
126
136
139
144 - class Box(T_Region): pass
146
147 - class Pole(STCElement):
148 _a_unit = None
149 _a_vel_time_unit = None
150
151 - class Area(STCElement):
154
155 - class Vertex(STCElement): pass
157
159
161 _childSequence = ["CoordFrame", "TimeFrame", "SpaceFrame",
162 "SpectralFrame", "RedshiftFrame"]
163
164 - class Equinox(OptionalSTCElement): pass
165
167 _childSequence = ["CoordFrame", "PixelCoordFrame"]
168
171
173
175
178
184
187
189
191
197
200
206
208 _a_ref_frame_id = None
209
211
215
218
220
222
225
226 - class Pixel(Coordinate): pass
227
231
234
236 _a_unit = None
237
238 - class Time(OptionalSTCElement):
243
245 _childSequence = ["Timescale", "TimeOffset", "MJDTime", "JDTime", "ISOTime"]
246
250 - class T(T_astronTime): pass
251
254
256
261
264
267
268
271
274
275 - class ISOTime(OptionalSTCElement): pass
276 - class JDTime(OptionalSTCElement): pass
277 - class MJDTime(OptionalSTCElement): pass
279
285
287
290
294
298
302
303 - class Center(OptionalSTCElement):
305
308
309
310 STC._addSubsGroup(STC.T_double1, ["C1", "C2", "C3", "e",
311 "Error", "Size", "Resolution", "PixSize",
312 "Error2Radius", "Error3Radius",
313 "Size2Radius", "Size3Radius",
314 "PixSize2Radius", "PixSize3Radius",
315 "Resolution2Radius", "Resolution3Radius",
316 "M11", "M12", "M13", "M21", "M22", "M23", "M31", "M32", "M33",
317 "HiLimit", "LoLimit", "Radius",
318 "Scale", "SemiMajorAxis", "SemiMinorAxis",
319 "Value"])
320
321 STC._addSubsGroup(STC.T_double2, ["HiLimit2Vec", "LoLimit2Vec",
322 "Pole", "Position", "Value2"])
323
324 STC._addSubsGroup(STC.T_double3, ["HiLimit3Vec", "LoLimit3Vec",
325 "Point", "Value3", "Vector"])
326
327 STC._addSubsGroup(STC.T_size2, ["Error2", "PixSize2", "Resolution2",
328 "Size2", "Transform2", "CValue2"])
329
330 STC._addSubsGroup(STC.T_size3, ["Error3", "PixSize3", "Resolution3",
331 "Size3", "Transform3", "CValue3"])
332
333 STC._addSubsGroup(STC.T_matrix,["Error2Matrix", "Error3Matrix",
334 "Size2Matrix", "Size3Matrix", "PixSize2Matrix", "PixSize3Matrix",
335 "Resolution2Matrix", "Resolution3Matrix",])
336
337 STC._addSubsGroup(STC.T_SpaceRefFrame, common.stcSpaceRefFrames)
338 STC._addSubsGroup(STC.T_ReferencePosition, common.stcRefPositions)
339 STC._addSubsGroup(STC.T_CoordFlavor, common.stcCoordFlavors)
340