caom2 2.5__tar.gz → 2.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {caom2-2.5/caom2.egg-info → caom2-2.6.1}/PKG-INFO +10 -10
- {caom2-2.5 → caom2-2.6.1}/README.rst +0 -3
- {caom2-2.5 → caom2-2.6.1}/caom2/artifact.py +2 -7
- {caom2-2.5 → caom2-2.6.1}/caom2/caom_util.py +4 -10
- {caom2-2.5 → caom2-2.6.1}/caom2/checksum.py +1 -4
- {caom2-2.5 → caom2-2.6.1}/caom2/chunk.py +52 -30
- {caom2-2.5 → caom2-2.6.1}/caom2/common.py +5 -16
- {caom2-2.5 → caom2-2.6.1}/caom2/diff.py +2 -6
- {caom2-2.5 → caom2-2.6.1}/caom2/obs_reader_writer.py +5 -11
- {caom2-2.5 → caom2-2.6.1}/caom2/observation.py +3 -10
- {caom2-2.5 → caom2-2.6.1}/caom2/part.py +1 -5
- {caom2-2.5 → caom2-2.6.1}/caom2/plane.py +3 -11
- {caom2-2.5 → caom2-2.6.1}/caom2/shape.py +1 -5
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/caom_test_instances.py +3 -8
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/diff-expected-CAOM-2.3.xml +2 -2
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_artifact.py +2 -6
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_caom_util.py +1 -5
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_checksum.py +3 -7
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_chunk.py +6 -7
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_common.py +1 -5
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_diffs.py +1 -4
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_obs_reader_writer.py +2 -10
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_observation.py +1 -5
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_part.py +1 -5
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_plane.py +1 -5
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_shape.py +1 -5
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/test_wcs.py +1 -5
- caom2-2.6.1/caom2/version.py +1 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/wcs.py +1 -5
- {caom2-2.5 → caom2-2.6.1/caom2.egg-info}/PKG-INFO +10 -10
- {caom2-2.5 → caom2-2.6.1}/caom2.egg-info/entry_points.txt +0 -1
- caom2-2.6.1/caom2.egg-info/requires.txt +9 -0
- {caom2-2.5 → caom2-2.6.1}/setup.cfg +3 -7
- {caom2-2.5 → caom2-2.6.1}/setup.py +3 -9
- caom2-2.5/caom2/version.py +0 -1
- caom2-2.5/caom2.egg-info/requires.txt +0 -17
- {caom2-2.5 → caom2-2.6.1}/LICENSE +0 -0
- {caom2-2.5 → caom2-2.6.1}/MANIFEST.in +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/__init__.py +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/data/CAOM-2.2.xsd +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/data/CAOM-2.3.xsd +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/data/CAOM-2.4.xsd +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/__init__.py +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/CompleteCompositeCircle-CAOM-2.2.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/CompleteCompositeCircle-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/CompleteCompositePolygon-CAOM-2.2.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/CompleteCompositePolygon-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/CompleteSimpleCircle-CAOM-2.2.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/CompleteSimpleCircle-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/CompleteSimplePolygon-CAOM-2.2.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/CompleteSimplePolygon-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/MinimalCompositeCircle-CAOM-2.2.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/MinimalCompositeCircle-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/MinimalCompositePolygon-CAOM-2.2.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/MinimalCompositePolygon-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/MinimalSimpleCircle-CAOM-2.2.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/MinimalSimpleCircle-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/MinimalSimplePolygon-CAOM-2.2.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/MinimalSimplePolygon-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/SampleComposite-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/SampleDerived-CAOM-2.4.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/SampleSimple-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/diff-actual-CAOM-2.3.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/diff-actual-CAOM-2.4.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/data/diff-expected-CAOM-2.4.xml +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2/tests/xml_compare.py +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2.egg-info/SOURCES.txt +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2.egg-info/dependency_links.txt +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2.egg-info/not-zip-safe +0 -0
- {caom2-2.5 → caom2-2.6.1}/caom2.egg-info/top_level.txt +0 -0
- {caom2-2.5 → caom2-2.6.1}/docs/Makefile +0 -0
- {caom2-2.5 → caom2-2.6.1}/docs/_templates/autosummary/base.rst +0 -0
- {caom2-2.5 → caom2-2.6.1}/docs/_templates/autosummary/class.rst +0 -0
- {caom2-2.5 → caom2-2.6.1}/docs/_templates/autosummary/module.rst +0 -0
- {caom2-2.5 → caom2-2.6.1}/docs/conf.py +0 -0
- {caom2-2.5 → caom2-2.6.1}/docs/index.rst +0 -0
- {caom2-2.5 → caom2-2.6.1}/docs/make.bat +0 -0
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: caom2
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.6.1
|
|
4
4
|
Summary: CAOM-2.4 library
|
|
5
5
|
Home-page: http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2
|
|
6
6
|
Author: Canadian Astronomy Data Centre
|
|
7
7
|
Author-email: cadc@nrc-cnrc.gc.ca
|
|
8
8
|
License: AGPLv3
|
|
9
|
-
Platform: UNKNOWN
|
|
10
9
|
Classifier: Natural Language :: English
|
|
11
10
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
12
11
|
Classifier: Programming Language :: Python
|
|
13
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
14
12
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Requires-Python: >=
|
|
16
|
-
Provides-Extra: test
|
|
13
|
+
Requires-Python: >=3.8, <4
|
|
17
14
|
License-File: LICENSE
|
|
15
|
+
Requires-Dist: aenum
|
|
16
|
+
Requires-Dist: deprecated
|
|
17
|
+
Requires-Dist: lxml>=3.7.0
|
|
18
|
+
Provides-Extra: test
|
|
19
|
+
Requires-Dist: pytest>=4.6; extra == "test"
|
|
20
|
+
Requires-Dist: pytest-cov>=2.5.1; extra == "test"
|
|
21
|
+
Requires-Dist: flake8>=3.4.1; extra == "test"
|
|
22
|
+
Requires-Dist: funcsigs>=1.0.2; extra == "test"
|
|
18
23
|
|
|
19
24
|
caom2
|
|
20
25
|
=====
|
|
@@ -37,9 +42,6 @@ To create a minimal Simple Observation
|
|
|
37
42
|
|
|
38
43
|
.. code:: python
|
|
39
44
|
|
|
40
|
-
# make it compatible with Python 2 and 3
|
|
41
|
-
from __future__ import (absolute_import, division, print_function,
|
|
42
|
-
unicode_literals)
|
|
43
45
|
import sys
|
|
44
46
|
from caom2 import SimpleObservation, TypedOrderedDict, Plane, Artifact,\
|
|
45
47
|
Part, Chunk, ObservationWriter, ProductType,\
|
|
@@ -418,5 +420,3 @@ The output:
|
|
|
418
420
|
</caom2:plane>
|
|
419
421
|
</caom2:planes>
|
|
420
422
|
</caom2:Observation>
|
|
421
|
-
|
|
422
|
-
|
|
@@ -19,9 +19,6 @@ To create a minimal Simple Observation
|
|
|
19
19
|
|
|
20
20
|
.. code:: python
|
|
21
21
|
|
|
22
|
-
# make it compatible with Python 2 and 3
|
|
23
|
-
from __future__ import (absolute_import, division, print_function,
|
|
24
|
-
unicode_literals)
|
|
25
22
|
import sys
|
|
26
23
|
from caom2 import SimpleObservation, TypedOrderedDict, Plane, Artifact,\
|
|
27
24
|
Part, Chunk, ObservationWriter, ProductType,\
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -71,12 +70,8 @@
|
|
|
71
70
|
|
|
72
71
|
"""
|
|
73
72
|
|
|
74
|
-
from __future__ import (absolute_import, division, print_function,
|
|
75
|
-
unicode_literals)
|
|
76
|
-
|
|
77
|
-
|
|
78
73
|
from builtins import str, int
|
|
79
|
-
from
|
|
74
|
+
from urllib.parse import urlparse
|
|
80
75
|
|
|
81
76
|
from . import caom_util
|
|
82
77
|
from .chunk import ProductType
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
@@ -76,16 +75,11 @@ the first point of use could be implemented. This helps the data
|
|
|
76
75
|
engineer get the correct meta data more quickly.
|
|
77
76
|
"""
|
|
78
77
|
|
|
79
|
-
from __future__ import (absolute_import, division, print_function,
|
|
80
|
-
unicode_literals)
|
|
81
|
-
|
|
82
78
|
import sys
|
|
83
79
|
import collections
|
|
84
80
|
from datetime import datetime
|
|
85
81
|
|
|
86
|
-
import
|
|
87
|
-
from six.moves import collections_abc
|
|
88
|
-
from six.moves.urllib.parse import urlsplit
|
|
82
|
+
from urllib.parse import urlsplit
|
|
89
83
|
from builtins import int, str as newstr
|
|
90
84
|
|
|
91
85
|
|
|
@@ -267,7 +261,7 @@ class TypedList(collections.abc.MutableSequence):
|
|
|
267
261
|
return self._oktypes
|
|
268
262
|
|
|
269
263
|
|
|
270
|
-
class TypedSet(
|
|
264
|
+
class TypedSet(collections.abc.MutableSet):
|
|
271
265
|
"""
|
|
272
266
|
Class that implements a typed set in Python. Supported types
|
|
273
267
|
are specified when instance is created. Example:
|
|
@@ -402,12 +396,12 @@ class TypedOrderedDict(collections.OrderedDict):
|
|
|
402
396
|
|
|
403
397
|
def __str__(self):
|
|
404
398
|
return "\n".join(["{} => {}".format(k, v)
|
|
405
|
-
for k, v in
|
|
399
|
+
for k, v in self.items()])
|
|
406
400
|
|
|
407
401
|
def __repr__(self):
|
|
408
402
|
return "TypedOrderedDict((%r))," % self._oktypes + (
|
|
409
403
|
"(".join(
|
|
410
|
-
["(%r,%r)" % (k, v) for k, v in
|
|
404
|
+
["(%r,%r)" % (k, v) for k, v in self.items()]) + ")")
|
|
411
405
|
|
|
412
406
|
def check(self, key, value):
|
|
413
407
|
"""
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -66,8 +65,6 @@
|
|
|
66
65
|
#
|
|
67
66
|
# ***********************************************************************
|
|
68
67
|
#
|
|
69
|
-
from __future__ import (absolute_import, division, print_function,
|
|
70
|
-
unicode_literals)
|
|
71
68
|
|
|
72
69
|
import hashlib
|
|
73
70
|
import logging
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2024. (c) 2024.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -71,8 +70,6 @@
|
|
|
71
70
|
|
|
72
71
|
"""
|
|
73
72
|
|
|
74
|
-
from __future__ import (absolute_import, division, print_function,
|
|
75
|
-
unicode_literals)
|
|
76
73
|
|
|
77
74
|
from builtins import str
|
|
78
75
|
|
|
@@ -85,34 +82,59 @@ from .common import CaomObject, OrderedEnum
|
|
|
85
82
|
|
|
86
83
|
class ProductType(OrderedEnum):
|
|
87
84
|
"""
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
85
|
+
Subset of IVOA DataLink terms at:
|
|
86
|
+
https://www.ivoa.net/rdf/datalink/core/2022-01-27/datalink.html
|
|
87
|
+
|
|
88
|
+
THIS = "this"
|
|
89
|
+
AUXILIARY = "auxiliary"
|
|
90
|
+
BIAS = 'bias'
|
|
91
|
+
CALIBRATION = 'calibration'
|
|
92
|
+
CODERIVED = 'coderived'
|
|
93
|
+
DARK = 'dark'
|
|
94
|
+
DOCUMENTATION = 'documentation'
|
|
95
|
+
ERROR = 'error'
|
|
96
|
+
FLAT = 'flat'
|
|
97
|
+
NOISE = 'noise'
|
|
98
|
+
PREVIEW = 'preview'
|
|
99
|
+
PREVIEW_IMAGE = 'preview-image'
|
|
100
|
+
PREVIEW_PLOT = 'preview-plot'
|
|
101
|
+
THUMBNAIL = 'thumbnail'
|
|
102
|
+
WEIGHT = 'weight'
|
|
103
|
+
|
|
100
104
|
"""
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
SCIENCE = "science"
|
|
105
|
-
CALIBRATION = "calibration"
|
|
106
|
-
PREVIEW = "preview"
|
|
107
|
-
INFO = "info"
|
|
108
|
-
NOISE = "noise"
|
|
109
|
-
WEIGHT = "weight"
|
|
105
|
+
|
|
106
|
+
THIS = "this"
|
|
107
|
+
|
|
110
108
|
AUXILIARY = "auxiliary"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
BIAS = 'bias'
|
|
110
|
+
CALIBRATION = 'calibration'
|
|
111
|
+
CODERIVED = 'coderived'
|
|
112
|
+
DARK = 'dark'
|
|
113
|
+
DOCUMENTATION = 'documentation'
|
|
114
|
+
ERROR = 'error'
|
|
115
|
+
FLAT = 'flat'
|
|
116
|
+
NOISE = 'noise'
|
|
117
|
+
PREVIEW = 'preview'
|
|
118
|
+
PREVIEW_IMAGE = 'preview-image'
|
|
119
|
+
PREVIEW_PLOT = 'preview-plot'
|
|
120
|
+
THUMBNAIL = 'thumbnail'
|
|
121
|
+
WEIGHT = 'weight'
|
|
122
|
+
|
|
123
|
+
# DataLink terms explicitly not included
|
|
124
|
+
# counterpart
|
|
125
|
+
# cutout
|
|
126
|
+
# derivation
|
|
127
|
+
# detached - header
|
|
128
|
+
# package
|
|
129
|
+
# proc
|
|
130
|
+
# progenitor
|
|
131
|
+
|
|
132
|
+
# CAOM specific terms public
|
|
133
|
+
SCIENCE = 'science' # this
|
|
134
|
+
|
|
135
|
+
# deprecated
|
|
136
|
+
# INFO = 'info'
|
|
137
|
+
# CATALOG = 'catalog'
|
|
116
138
|
|
|
117
139
|
|
|
118
140
|
__all__ = ['ProductType', 'Chunk', 'ObservableAxis', 'SpatialWCS',
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -67,17 +66,13 @@
|
|
|
67
66
|
# ***********************************************************************
|
|
68
67
|
#
|
|
69
68
|
|
|
70
|
-
from __future__ import (absolute_import, division, print_function,
|
|
71
|
-
unicode_literals)
|
|
72
|
-
|
|
73
69
|
import inspect
|
|
74
70
|
import uuid
|
|
75
71
|
from datetime import datetime
|
|
76
72
|
|
|
77
73
|
from builtins import int, str
|
|
78
|
-
from
|
|
74
|
+
from urllib.parse import SplitResult, urlparse, urlsplit
|
|
79
75
|
import logging
|
|
80
|
-
import six
|
|
81
76
|
|
|
82
77
|
from . import caom_util
|
|
83
78
|
import warnings
|
|
@@ -110,7 +105,7 @@ class OrderedEnum(Enum):
|
|
|
110
105
|
"""
|
|
111
106
|
Enums are in the order of their definition.
|
|
112
107
|
|
|
113
|
-
|
|
108
|
+
TODO: not sure this is required in Python 3
|
|
114
109
|
enum.Enum is supposed to support this.
|
|
115
110
|
"""
|
|
116
111
|
|
|
@@ -148,10 +143,7 @@ class CaomObject(object):
|
|
|
148
143
|
pass
|
|
149
144
|
|
|
150
145
|
def __str__(self):
|
|
151
|
-
|
|
152
|
-
args = inspect.getfullargspec(self.__init__).args[1:]
|
|
153
|
-
else:
|
|
154
|
-
args = inspect.getargspec(self.__init__).args[1:]
|
|
146
|
+
args = inspect.getfullargspec(self.__init__).args[1:]
|
|
155
147
|
class_name = self.__class__.__name__
|
|
156
148
|
return "\n".join(["{}.{} : {}".
|
|
157
149
|
format(class_name, arg, getattr(self, arg, None))
|
|
@@ -164,10 +156,7 @@ class CaomObject(object):
|
|
|
164
156
|
return False
|
|
165
157
|
|
|
166
158
|
def __repr__(self):
|
|
167
|
-
|
|
168
|
-
args = inspect.getfullargspec(self.__init__).args[1:]
|
|
169
|
-
else:
|
|
170
|
-
args = inspect.getargspec(self.__init__).args[1:]
|
|
159
|
+
args = inspect.getfullargspec(self.__init__).args[1:]
|
|
171
160
|
class_name = ""
|
|
172
161
|
if self.__class__.__module__ != '__main__':
|
|
173
162
|
class_name += self.__class__.__module__ + "."
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -72,9 +71,6 @@ A difference method for CAOM2 entities.
|
|
|
72
71
|
|
|
73
72
|
"""
|
|
74
73
|
|
|
75
|
-
from __future__ import (absolute_import, division, print_function,
|
|
76
|
-
unicode_literals)
|
|
77
|
-
|
|
78
74
|
import math
|
|
79
75
|
|
|
80
76
|
from caom2.common import CaomObject
|
|
@@ -413,7 +409,7 @@ def _not_equal(rhs, lhs):
|
|
|
413
409
|
else:
|
|
414
410
|
# if only using python 3.5+, use math.isclose, instead of this
|
|
415
411
|
# description of math.isclose from the python documentation
|
|
416
|
-
result = abs(rhs-lhs) <= max(1e-
|
|
412
|
+
result = abs(rhs-lhs) <= max(1e-12 * max(abs(rhs), abs(lhs)), 1e-11)
|
|
417
413
|
else:
|
|
418
414
|
result = rhs == lhs
|
|
419
415
|
return not result
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
4
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
5
|
#
|
|
6
|
-
# (c)
|
|
6
|
+
# (c) 2022. (c) 2022.
|
|
7
7
|
# Government of Canada Gouvernement du Canada
|
|
8
8
|
# National Research Council Conseil national de recherches
|
|
9
9
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -70,14 +70,10 @@
|
|
|
70
70
|
|
|
71
71
|
""" Defines ObservationReader class """
|
|
72
72
|
|
|
73
|
-
from __future__ import (absolute_import, division, print_function,
|
|
74
|
-
unicode_literals)
|
|
75
|
-
|
|
76
73
|
import os
|
|
77
74
|
import uuid
|
|
78
75
|
from builtins import str, int
|
|
79
|
-
import
|
|
80
|
-
from six.moves.urllib.parse import urlparse
|
|
76
|
+
from urllib.parse import urlparse
|
|
81
77
|
|
|
82
78
|
from lxml import etree
|
|
83
79
|
|
|
@@ -2039,7 +2035,7 @@ class ObservationWriter(object):
|
|
|
2039
2035
|
return
|
|
2040
2036
|
|
|
2041
2037
|
element = self._get_caom_element("planes", parent)
|
|
2042
|
-
for _plane in
|
|
2038
|
+
for _plane in planes.values():
|
|
2043
2039
|
plane_element = self._get_caom_element("plane", element)
|
|
2044
2040
|
self._add_entity_attributes(_plane, plane_element)
|
|
2045
2041
|
self._add_element("productID", _plane.product_id, plane_element)
|
|
@@ -2297,7 +2293,7 @@ class ObservationWriter(object):
|
|
|
2297
2293
|
return
|
|
2298
2294
|
|
|
2299
2295
|
element = self._get_caom_element("artifacts", parent)
|
|
2300
|
-
for _artifact in
|
|
2296
|
+
for _artifact in artifacts.values():
|
|
2301
2297
|
artifact_element = self._get_caom_element("artifact", element)
|
|
2302
2298
|
self._add_entity_attributes(_artifact, artifact_element)
|
|
2303
2299
|
self._add_element("uri", _artifact.uri, artifact_element)
|
|
@@ -2335,7 +2331,7 @@ class ObservationWriter(object):
|
|
|
2335
2331
|
return
|
|
2336
2332
|
|
|
2337
2333
|
element = self._get_caom_element("parts", parent)
|
|
2338
|
-
for _part in
|
|
2334
|
+
for _part in parts.values():
|
|
2339
2335
|
part_element = self._get_caom_element("part", element)
|
|
2340
2336
|
self._add_entity_attributes(_part, part_element)
|
|
2341
2337
|
self._add_element("name", _part.name, part_element)
|
|
@@ -2680,8 +2676,6 @@ class ObservationWriter(object):
|
|
|
2680
2676
|
element.text = value
|
|
2681
2677
|
else:
|
|
2682
2678
|
if isinstance(value, float):
|
|
2683
|
-
# in Python 2.7 str(float) might alter precision of float
|
|
2684
|
-
# therefore call repr instead
|
|
2685
2679
|
element.text = repr(value)
|
|
2686
2680
|
else:
|
|
2687
2681
|
element.text = str(value)
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -69,12 +68,8 @@
|
|
|
69
68
|
|
|
70
69
|
"""definition of the caom2.Observation object."""
|
|
71
70
|
|
|
72
|
-
from __future__ import (absolute_import, division, print_function,
|
|
73
|
-
unicode_literals)
|
|
74
|
-
|
|
75
71
|
from datetime import datetime
|
|
76
72
|
|
|
77
|
-
import six
|
|
78
73
|
from builtins import str
|
|
79
74
|
import warnings
|
|
80
75
|
from deprecated import deprecated
|
|
@@ -86,7 +81,7 @@ from .common import AbstractCaomEntity, CaomObject, ObservationURI, \
|
|
|
86
81
|
from .common import _CAOM_VOCAB_NS
|
|
87
82
|
from .plane import Plane
|
|
88
83
|
from .shape import Point
|
|
89
|
-
from
|
|
84
|
+
from urllib.parse import urlsplit
|
|
90
85
|
with warnings.catch_warnings():
|
|
91
86
|
warnings.simplefilter('ignore')
|
|
92
87
|
from aenum import Enum
|
|
@@ -103,8 +98,6 @@ class ObservationIntentType(OrderedEnum):
|
|
|
103
98
|
CALIBRATION: "calibration"
|
|
104
99
|
SCIENCE: "science"
|
|
105
100
|
"""
|
|
106
|
-
# __order__ required for Python2.7
|
|
107
|
-
__order__ = "SCIENCE CALIBRATION"
|
|
108
101
|
SCIENCE = "science"
|
|
109
102
|
CALIBRATION = "calibration"
|
|
110
103
|
|
|
@@ -506,7 +499,7 @@ class Algorithm(CaomObject):
|
|
|
506
499
|
simple observation, otherwise name of algorithm that selected
|
|
507
500
|
composite members or just 'composite' works too.
|
|
508
501
|
"""
|
|
509
|
-
caom_util.type_check(name,
|
|
502
|
+
caom_util.type_check(name, str, 'name', override=False)
|
|
510
503
|
self._name = str(name)
|
|
511
504
|
|
|
512
505
|
def _key(self):
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -70,9 +69,6 @@
|
|
|
70
69
|
"""Defines the caom2.Part class which describes
|
|
71
70
|
the caom2_Observation_Plane_Artifact_Part object."""
|
|
72
71
|
|
|
73
|
-
from __future__ import (absolute_import, division, print_function,
|
|
74
|
-
unicode_literals)
|
|
75
|
-
|
|
76
72
|
from builtins import str
|
|
77
73
|
|
|
78
74
|
from . import caom_util
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -69,13 +68,10 @@
|
|
|
69
68
|
|
|
70
69
|
"""defines the caom2.Plane class"""
|
|
71
70
|
|
|
72
|
-
from __future__ import (absolute_import, division, print_function,
|
|
73
|
-
unicode_literals)
|
|
74
|
-
|
|
75
71
|
from datetime import datetime
|
|
76
72
|
|
|
77
73
|
from builtins import str, int
|
|
78
|
-
from
|
|
74
|
+
from urllib.parse import SplitResult, urlsplit
|
|
79
75
|
from deprecated import deprecated
|
|
80
76
|
|
|
81
77
|
from caom2.caom_util import int_32
|
|
@@ -87,6 +83,7 @@ from .common import AbstractCaomEntity, CaomObject, ObservationURI,\
|
|
|
87
83
|
VocabularyTerm, OrderedEnum
|
|
88
84
|
from .common import _CAOM_VOCAB_NS, _OBSCORE_VOCAB_NS
|
|
89
85
|
import warnings
|
|
86
|
+
from enum import Enum
|
|
90
87
|
with warnings.catch_warnings():
|
|
91
88
|
warnings.simplefilter('ignore')
|
|
92
89
|
from aenum import Enum, extend_enum
|
|
@@ -153,8 +150,6 @@ class EnergyBand(OrderedEnum):
|
|
|
153
150
|
XRAY: "X-ray"
|
|
154
151
|
GAMMARAY: "Gamma-ray"
|
|
155
152
|
"""
|
|
156
|
-
# __order__ required for Python2.7
|
|
157
|
-
__order__ = "RADIO MILLIMETER INFRARED OPTICAL UV EUV XRAY GAMMARAY"
|
|
158
153
|
RADIO = "Radio"
|
|
159
154
|
MILLIMETER = "Millimeter"
|
|
160
155
|
INFRARED = "Infrared"
|
|
@@ -186,9 +181,6 @@ class PolarizationState(OrderedEnum):
|
|
|
186
181
|
XY: "XY"
|
|
187
182
|
YX: "YX"
|
|
188
183
|
"""
|
|
189
|
-
# __order__ required for Python2.7
|
|
190
|
-
__order__ = "I Q U V RR LL RL LR XX YY XY YX POLI FPOLI POLA EPOLI " \
|
|
191
|
-
"CPOLI NPOLI"
|
|
192
184
|
I = "I" # noqa
|
|
193
185
|
Q = "Q"
|
|
194
186
|
U = "U"
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -67,9 +66,6 @@
|
|
|
67
66
|
# ***********************************************************************
|
|
68
67
|
#
|
|
69
68
|
|
|
70
|
-
from __future__ import (absolute_import, division, print_function,
|
|
71
|
-
unicode_literals)
|
|
72
|
-
|
|
73
69
|
import math
|
|
74
70
|
from caom2.caom_util import int_32
|
|
75
71
|
from . import caom_util
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -69,13 +68,9 @@
|
|
|
69
68
|
|
|
70
69
|
""" Defines Caom2TestInstances class """
|
|
71
70
|
|
|
72
|
-
from __future__ import (absolute_import, division, print_function,
|
|
73
|
-
unicode_literals)
|
|
74
|
-
|
|
75
71
|
import collections
|
|
76
72
|
from datetime import datetime
|
|
77
73
|
import uuid
|
|
78
|
-
import six
|
|
79
74
|
from builtins import int
|
|
80
75
|
|
|
81
76
|
from caom2 import artifact
|
|
@@ -361,7 +356,7 @@ class Caom2TestInstances(object):
|
|
|
361
356
|
_plane.data_read_groups.add('ivo://cadc.nrc.ca/groups?C')
|
|
362
357
|
|
|
363
358
|
if self.depth > 2:
|
|
364
|
-
for k, v in
|
|
359
|
+
for k, v in self.get_artifacts().items():
|
|
365
360
|
_plane.artifacts[k] = v
|
|
366
361
|
planes[prod_id] = _plane
|
|
367
362
|
return planes
|
|
@@ -522,7 +517,7 @@ class Caom2TestInstances(object):
|
|
|
522
517
|
_artifact.acc_meta_checksum = common.ChecksumURI(
|
|
523
518
|
"md5:844ce247db0844ad9f721430c80e7a21")
|
|
524
519
|
if self.depth > 3:
|
|
525
|
-
for k, v in
|
|
520
|
+
for k, v in self.get_parts().items():
|
|
526
521
|
_artifact.parts[k] = v
|
|
527
522
|
artifacts["ad:foo/bar1"] = _artifact
|
|
528
523
|
if self.caom_version >= 24:
|
|
@@ -119,11 +119,11 @@
|
|
|
119
119
|
<caom2:time>
|
|
120
120
|
<caom2:bounds>
|
|
121
121
|
<caom2:lower>58979.5015625</caom2:lower>
|
|
122
|
-
<caom2:upper>58979.
|
|
122
|
+
<caom2:upper>58979.50173611111</caom2:upper>
|
|
123
123
|
<caom2:samples>
|
|
124
124
|
<caom2:sample>
|
|
125
125
|
<caom2:lower>58979.5015625</caom2:lower>
|
|
126
|
-
<caom2:upper>58979.
|
|
126
|
+
<caom2:upper>58979.50173611111</caom2:upper>
|
|
127
127
|
</caom2:sample>
|
|
128
128
|
</caom2:samples>
|
|
129
129
|
</caom2:bounds>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -69,12 +68,9 @@
|
|
|
69
68
|
|
|
70
69
|
""" Defines TestArtifact class """
|
|
71
70
|
|
|
72
|
-
from __future__ import (absolute_import, division, print_function,
|
|
73
|
-
unicode_literals)
|
|
74
|
-
|
|
75
71
|
import unittest
|
|
76
72
|
|
|
77
|
-
from
|
|
73
|
+
from urllib.parse import urlparse
|
|
78
74
|
|
|
79
75
|
from .. import artifact
|
|
80
76
|
from .. import common
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
# ***********************************************************************
|
|
3
2
|
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
|
|
4
3
|
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
|
|
5
4
|
#
|
|
6
|
-
# (c)
|
|
5
|
+
# (c) 2022. (c) 2022.
|
|
7
6
|
# Government of Canada Gouvernement du Canada
|
|
8
7
|
# National Research Council Conseil national de recherches
|
|
9
8
|
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
|
|
@@ -67,9 +66,6 @@
|
|
|
67
66
|
# ***********************************************************************
|
|
68
67
|
#
|
|
69
68
|
|
|
70
|
-
from __future__ import (absolute_import, division, print_function,
|
|
71
|
-
unicode_literals)
|
|
72
|
-
|
|
73
69
|
import unittest
|
|
74
70
|
import pytest
|
|
75
71
|
|