libera_utils 1.0.0__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.
Files changed (30) hide show
  1. libera_utils-1.0.0/LICENSE +0 -0
  2. libera_utils-1.0.0/PKG-INFO +23 -0
  3. libera_utils-1.0.0/libera_utils/__init__.py +5 -0
  4. libera_utils-1.0.0/libera_utils/cli.py +93 -0
  5. libera_utils-1.0.0/libera_utils/config.py +139 -0
  6. libera_utils-1.0.0/libera_utils/data/config.json +48 -0
  7. libera_utils-1.0.0/libera_utils/data/hdf5/attributes.json +9 -0
  8. libera_utils-1.0.0/libera_utils/data/jpss1_geolocation_xtce_v1.xml +217 -0
  9. libera_utils-1.0.0/libera_utils/data/spice/earth_assoc_itrf93.tf +236 -0
  10. libera_utils-1.0.0/libera_utils/data/spice/jpss_sclk_v01.tsc +41 -0
  11. libera_utils-1.0.0/libera_utils/data/spice/libera_fk_v01.tf +191 -0
  12. libera_utils-1.0.0/libera_utils/db/__init__.py +44 -0
  13. libera_utils-1.0.0/libera_utils/db/database.py +172 -0
  14. libera_utils-1.0.0/libera_utils/db/mixins.py +129 -0
  15. libera_utils-1.0.0/libera_utils/db/models.py +82 -0
  16. libera_utils-1.0.0/libera_utils/geolocation.py +449 -0
  17. libera_utils-1.0.0/libera_utils/io/__init__.py +0 -0
  18. libera_utils-1.0.0/libera_utils/io/caching.py +52 -0
  19. libera_utils-1.0.0/libera_utils/io/filenaming.py +162 -0
  20. libera_utils-1.0.0/libera_utils/io/hdf.py +259 -0
  21. libera_utils-1.0.0/libera_utils/io/manifest.py +86 -0
  22. libera_utils-1.0.0/libera_utils/io/smart_open.py +97 -0
  23. libera_utils-1.0.0/libera_utils/kernel_maker.py +293 -0
  24. libera_utils-1.0.0/libera_utils/logutil.py +181 -0
  25. libera_utils-1.0.0/libera_utils/packets.py +79 -0
  26. libera_utils-1.0.0/libera_utils/spice_utils.py +458 -0
  27. libera_utils-1.0.0/libera_utils/time.py +183 -0
  28. libera_utils-1.0.0/libera_utils/version.py +8 -0
  29. libera_utils-1.0.0/pyproject.toml +52 -0
  30. libera_utils-1.0.0/setup.py +54 -0
File without changes
@@ -0,0 +1,23 @@
1
+ Metadata-Version: 2.1
2
+ Name: libera-utils
3
+ Version: 1.0.0
4
+ Summary: Utility package for Libera Science Data Processing and the Libera Science Data Center.
5
+ Author: Stephane Beland
6
+ Author-email: stephane.beland@lasp.colorado.edu
7
+ Requires-Python: >=3.9,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Provides-Extra: plotting
12
+ Requires-Dist: SQLAlchemy (>=1.4,<2.0)
13
+ Requires-Dist: astropy (>=5.1,<6.0)
14
+ Requires-Dist: bitstring (>=3.1,<4.0)
15
+ Requires-Dist: cloudpathlib[s3] (>=0.9,<0.10)
16
+ Requires-Dist: h5py (>=3.3,<4.0)
17
+ Requires-Dist: lasp-packets (>=2.0,<3.0)
18
+ Requires-Dist: matplotlib (>=3.4,<4.0); extra == "plotting"
19
+ Requires-Dist: numpy (>=1.21,<2.0)
20
+ Requires-Dist: psycopg2 (>=2.9,<3.0)
21
+ Requires-Dist: requests (>=2.26,<3.0)
22
+ Requires-Dist: spiceypy (>=5.0,<6.0)
23
+ Requires-Dist: watchtower (>=3.0,<4.0)
@@ -0,0 +1,5 @@
1
+ """
2
+ libera_utils
3
+ """
4
+ # Local
5
+ from .db.models import *
@@ -0,0 +1,93 @@
1
+ """Module for the Libera SDC utilities CLI
2
+
3
+ libera-utils
4
+ make-kernel
5
+ jpss-spk
6
+ jpss-ck
7
+ azel-ck
8
+ """
9
+ # Standard
10
+ import argparse
11
+ # Local
12
+ from libera_utils import kernel_maker
13
+ from libera_utils.version import version as libera_utils_version
14
+
15
+
16
+ def main(cli_args: list = None):
17
+ """Main CLI entrypoint that runs the function inferred from the specified subcommand"""
18
+ args = parse_cli_args(cli_args)
19
+ args.func(args)
20
+
21
+
22
+ def print_version_info(*args):
23
+ """Print CLI version information"""
24
+ print(f"Libera SDC utilities CLI\n\tVersion {libera_utils_version()}")
25
+
26
+
27
+ def parse_cli_args(cli_args: list):
28
+ """Parse CLI arguments
29
+
30
+ Parameters
31
+ ----------
32
+ cli_args : list
33
+ List of CLI arguments to parse
34
+
35
+ Returns
36
+ -------
37
+ Namespace
38
+ Parsed arguments in a Namespace object
39
+ """
40
+ parser = argparse.ArgumentParser(prog="libera-utils", description="Libera SDC utilities CLI")
41
+ parser.add_argument("--version",
42
+ action='store_const', dest='func', const=print_version_info,
43
+ help="print current version of the CLI")
44
+
45
+ subparsers = parser.add_subparsers(description="sub-commands for libera-utils CLI")
46
+
47
+ # make-kernel
48
+ make_kernel_parser = subparsers.add_parser('make-kernel',
49
+ help='generate SPICE kernel from telemetry data')
50
+
51
+ make_kernel_subparsers = make_kernel_parser.add_subparsers(description="sub-commands for make-kernel sub-command")
52
+
53
+ # make-kernel jpss-spk
54
+ jpss_spk_parser = make_kernel_subparsers.add_parser('jpss-spk', help="generate JPSS SPK kernel from telemetry")
55
+ jpss_spk_parser.set_defaults(func=kernel_maker.make_jpss_spk)
56
+ jpss_spk_parser.add_argument('packet_data_filepaths', nargs='+', type=str,
57
+ help="paths to L0 packet files")
58
+ jpss_spk_parser.add_argument('--outdir', '-o', type=str,
59
+ required=True,
60
+ help="output directory for generated SPK")
61
+ jpss_spk_parser.add_argument('--overwrite', action='store_true',
62
+ help="force overwriting an existing kernel if it exists")
63
+ jpss_spk_parser.add_argument('-v', '--verbose', action='store_true',
64
+ help="set DEBUG level logging output (otherwise set by LIBSDP_STREAM_LOG_LEVEL)")
65
+
66
+ # make-kernel jpss-ck
67
+ jpss_ck_parser = make_kernel_subparsers.add_parser('jpss-ck', help="generate JPSS CK kernel from telemetry")
68
+ jpss_ck_parser.set_defaults(func=kernel_maker.make_jpss_ck)
69
+ jpss_ck_parser.add_argument('packet_data_filepaths', nargs='+', type=str,
70
+ help="paths to L0 packet files")
71
+ jpss_ck_parser.add_argument('--outdir', '-o', type=str,
72
+ required=True,
73
+ help="output directory for generated CK")
74
+ jpss_ck_parser.add_argument('--overwrite', action='store_true',
75
+ help="force overwriting an existing kernel if it exists")
76
+ jpss_ck_parser.add_argument('-v', '--verbose', action='store_true',
77
+ help="set DEBUG level logging output (otherwise set by LIBSDP_STREAM_LOG_LEVEL)")
78
+
79
+ # make-kernel azel-ck
80
+ azel_ck_parser = make_kernel_subparsers.add_parser('azel-ck', help="generate Libera Az-El CK kernel from telemetry")
81
+ azel_ck_parser.set_defaults(func=kernel_maker.make_azel_ck)
82
+ azel_ck_parser.add_argument('packet_data_filepaths', nargs='+', type=str,
83
+ help="paths to L0 packet files")
84
+ azel_ck_parser.add_argument('--outdir', '-o', type=str,
85
+ required=True,
86
+ help="output directory for generated CK")
87
+ azel_ck_parser.add_argument('--overwrite', action='store_true',
88
+ help="force overwriting an existing kernel if it exists")
89
+ azel_ck_parser.add_argument('-v', '--verbose', action='store_true',
90
+ help="set DEBUG level logging output (otherwise set by LIBSDP_STREAM_LOG_LEVEL)")
91
+
92
+ parsed_args = parser.parse_args(cli_args)
93
+ return parsed_args
@@ -0,0 +1,139 @@
1
+ """Configuration reader. To modify the configuration, see file: emus_config.json"""
2
+ # Standard
3
+ import json
4
+ import logging
5
+ import os
6
+ from pathlib import Path
7
+ import re
8
+ import string
9
+ import sys
10
+ import warnings
11
+
12
+ logger = logging.getLogger(__name__)
13
+
14
+
15
+ class ConfigurationFormatter(string.Formatter):
16
+ """Customize the string formatter to replace fields in a config string
17
+ with values from the configuration dictionary. This will allow configuration
18
+ parameters in the emus_config.json file to be based off of other configuration
19
+ parameters by wrapping the configuration key in curly braces."""
20
+
21
+ def get_value(self, key: str, *args, **kwargs):
22
+ """Overrides the default get_value method in the python formatter. This will
23
+ return the value from the emus configuration with the specified key."""
24
+ return config.get(key)
25
+
26
+
27
+ class _ConfigurationCache:
28
+ """Class that stores the JSON configuration and provides methods for accessing configuration information"""
29
+
30
+ _json_config_filepath = Path(__file__).parent / 'data/config.json'
31
+
32
+ # Should handle all floats
33
+ FLOAT_REGEXP = re.compile(r'^[-+]?([0-9]+|[0-9]*\.[0-9]+)([eE][-+]?[0-9]+)?$')
34
+ # Example "-12.34E+56" # sign (-)
35
+ # integer (12)
36
+ # OR
37
+ # int/mantissa (12.34)
38
+ # exponent (E+56)
39
+
40
+ def __init__(self):
41
+ logger.debug("Initializing configuration cache from config.json.")
42
+ with open(self._json_config_filepath, encoding='utf_8') as config_file:
43
+ self._cached_json_config = json.load(config_file)
44
+ self._known_config_variables = set(self._cached_json_config)
45
+
46
+ def _format_return_value(self, value: str):
47
+ """Recursively formats the returned value, looking for config keys to substitute.
48
+
49
+ Parameters
50
+ ----------
51
+ value : str
52
+ String to format
53
+
54
+ Returns
55
+ -------
56
+ str
57
+ """
58
+ if isinstance(value, str):
59
+ formatter = ConfigurationFormatter()
60
+ # if the string contains only a curly bracket keyword, return the value of get_config(keyword)
61
+ key_iter = formatter.parse(value)
62
+ text_and_key = next(key_iter)
63
+ if text_and_key[0] == '' and not any(key_iter):
64
+ return config.get(text_and_key[1])
65
+
66
+ return formatter.format(value)
67
+
68
+ if isinstance(value, list):
69
+ return [self._format_return_value(x) for x in value]
70
+
71
+ if isinstance(value, dict):
72
+ return {k: self._format_return_value(v) for k, v in value.items()}
73
+
74
+ return value
75
+
76
+ def _parse_numeric_types(self, value: str):
77
+ """Checks the final result of a config retrieval. If it is a string that can be interpreted as a float or int,
78
+ parse it and return that.
79
+
80
+ Parameters
81
+ ----------
82
+ value : any
83
+ Final formatted value.
84
+
85
+ Returns
86
+ -------
87
+ : str or float or int
88
+ """
89
+ if not isinstance(value, str): # Indicates a non-string type came from the JSON config. Leave it as is.
90
+ return value
91
+
92
+ if self.FLOAT_REGEXP.match(value):
93
+ f = float(value)
94
+ if f.is_integer():
95
+ return int(f)
96
+ return f
97
+ return value
98
+
99
+ def force_reload(self):
100
+ """Force reloading of the JSON config"""
101
+ self.__init__() # pylint: disable=C2801
102
+
103
+ def get(self, key):
104
+ """Retrieves a configuration value from either the cached JSON or from the environment
105
+
106
+ Parameters
107
+ ----------
108
+ key : str
109
+ Key for which to retrieve the configured value.
110
+
111
+ Returns
112
+ -------
113
+ : any
114
+ Resulting value
115
+ """
116
+ if (key != 'PKG_ROOT') and (key not in self._known_config_variables):
117
+ warnings.warn(f"Configuration key {key} is not known to the config module. "
118
+ f"We will try to find it in the environment anyway but a default should be added to "
119
+ f"the config.json file.")
120
+
121
+ if key is None:
122
+ return self._cached_json_config
123
+
124
+ if key == 'PKG_ROOT': # Special case for root of installed package
125
+ return str(Path(sys.modules[__name__.split('.', maxsplit=1)[0]].__file__).parent)
126
+
127
+ # Checking the environment first allows easy override of any json config variable
128
+ if os.getenv(key):
129
+ result = os.getenv(key)
130
+ return self._parse_numeric_types(self._format_return_value(result))
131
+
132
+ if key in self._cached_json_config:
133
+ result = self._cached_json_config[key]
134
+ return self._parse_numeric_types(self._format_return_value(result))
135
+
136
+ raise KeyError(f'Configuration variable {key} not found.')
137
+
138
+
139
+ config = _ConfigurationCache()
@@ -0,0 +1,48 @@
1
+ {
2
+ "LIBSDP_LOG_DIR": null,
3
+ "LIBSDP_STREAM_LOG_LEVEL": "INFO",
4
+ "LIBSDP_CLOUDWATCH_GROUP": null,
5
+ "LIBSDP_DATA_DIR": "{PKG_ROOT}/data",
6
+ "LIBSDP_ATTR": "{LIBSDP_DATA_DIR}/hdf5/attributes.json",
7
+ "LIBERA_DB_NAME": null,
8
+ "LIBERA_DB_USER": null,
9
+ "LIBERA_DB_HOST": null,
10
+ "JPSS_SCLK": "{LIBSDP_DATA_DIR}/spice/jpss_sclk_v01.tsc",
11
+ "LIBERA_FK": "{LIBSDP_DATA_DIR}/spice/libera_fk_v01.tf",
12
+ "EARTH_ASSOC_ITRF93_FK": "{LIBSDP_DATA_DIR}/spice/earth_assoc_itrf93.tf",
13
+ "JPSS_NORAD_ID": 43013,
14
+ "JPSS_SC_ID": -143013,
15
+ "JPSS_GEOLOCATION_PACKET_DEFINITION": "{LIBSDP_DATA_DIR}/jpss1_geolocation_xtce_v1.xml",
16
+ "MKSPK_SETUPFILE_CONTENTS": {
17
+ "INPUT_DATA_TYPE": "STATES",
18
+ "OUTPUT_SPK_TYPE": 13,
19
+ "OBJECT_ID": -143013,
20
+ "CENTER_ID": 399,
21
+ "REF_FRAME_NAME": "ITRF93",
22
+ "PRODUCER_ID": "Gavin Medley (for Libera SDC)",
23
+ "DATA_ORDER": ["epoch", "x", "y", "z", "vx", "vy", "vz"],
24
+ "DATA_DELIMITER": " ",
25
+ "LEAPSECONDS_FILE": "auto-populated",
26
+ "INPUT_DATA_UNITS": { "ANGLES": "DEGREES", "DISTANCES": "METERS" },
27
+ "IGNORE_FIRST_LINE": 0,
28
+ "LINES_PER_RECORD": 1,
29
+ "TIME_WRAPPER": "# ETSECONDS",
30
+ "POLYNOM_DEGREE": 7,
31
+ "APPEND_TO_OUTPUT": "NO",
32
+ "FRAME_DEF_FILE": "{LIBERA_FK}"
33
+ },
34
+ "MSOPCK_SETUPFILE_CONTENTS": {
35
+ "LSK_FILE_NAME": "auto-populated",
36
+ "SCLK_FILE_NAME": "{JPSS_SCLK}",
37
+ "REFERENCE_FRAME_NAME": "J2000",
38
+ "INPUT_DATA_TYPE": "SPICE QUATERNIONS",
39
+ "INPUT_TIME_TYPE": "SCLK",
40
+ "ANGULAR_RATE_PRESENT": "MAKE UP/NO AVERAGING",
41
+ "CHECK_TIME_ORDER": "YES",
42
+ "CK_TYPE": 3,
43
+ "INSTRUMENT_ID": -143013000,
44
+ "INCLUDE_INTERVAL_TABLE": "YES",
45
+ "PRODUCER_ID": "Gavin Medley (for Libera SDC)"
46
+ },
47
+ "TEST_KEY": -999
48
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "title": "Level 2 Libera Data",
3
+ "version": "0.0.0",
4
+ "doi": "doi: doi",
5
+ "institution": "NASA's EVC1 Science Investigator-led Processing System",
6
+ "source": "satellite observation",
7
+ "pi": "Peter Pilewskie",
8
+ "institute": "Laboratory for Atmospheric and Space Physics. Boulder, Colorado, USA."
9
+ }
@@ -0,0 +1,217 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <xtce:SpaceSystem xmlns:xtce="http://www.omg.org/space/xtce" name="Libera">
3
+ <xtce:Header date="2021-06-08T14:11:00MST" version="1.0" author="Gavin Medley"/>
4
+ <xtce:TelemetryMetaData>
5
+ <xtce:ParameterTypeSet>
6
+ <xtce:IntegerParameterType name="VERSION_Type" signed="false">
7
+ <xtce:UnitSet/>
8
+ <xtce:IntegerDataEncoding sizeInBits="3" encoding="unsigned"/>
9
+ </xtce:IntegerParameterType>
10
+ <xtce:IntegerParameterType name="TYPE_Type" signed="false">
11
+ <xtce:UnitSet/>
12
+ <xtce:IntegerDataEncoding sizeInBits="1" encoding="unsigned"/>
13
+ </xtce:IntegerParameterType>
14
+ <xtce:IntegerParameterType name="SEC_HDR_FLG_Type" signed="false">
15
+ <xtce:UnitSet/>
16
+ <xtce:IntegerDataEncoding sizeInBits="1" encoding="unsigned"/>
17
+ </xtce:IntegerParameterType>
18
+ <xtce:IntegerParameterType name="PKT_APID_Type" signed="false">
19
+ <xtce:UnitSet/>
20
+ <xtce:IntegerDataEncoding sizeInBits="11" encoding="unsigned"/>
21
+ </xtce:IntegerParameterType>
22
+ <xtce:IntegerParameterType name="SEQ_FLGS_Type" signed="false">
23
+ <xtce:UnitSet/>
24
+ <xtce:IntegerDataEncoding sizeInBits="2" encoding="unsigned"/>
25
+ </xtce:IntegerParameterType>
26
+ <xtce:IntegerParameterType name="SRC_SEQ_CTR_Type" signed="false">
27
+ <xtce:UnitSet/>
28
+ <xtce:IntegerDataEncoding sizeInBits="14" encoding="unsigned"/>
29
+ </xtce:IntegerParameterType>
30
+ <xtce:IntegerParameterType name="PKT_LEN_Type" signed="false">
31
+ <xtce:UnitSet/>
32
+ <xtce:IntegerDataEncoding sizeInBits="16" encoding="unsigned"/>
33
+ </xtce:IntegerParameterType>
34
+ <xtce:FloatParameterType name="DOY_Type">
35
+ <xtce:UnitSet>
36
+ <xtce:Unit>day</xtce:Unit>
37
+ </xtce:UnitSet>
38
+ <xtce:IntegerDataEncoding sizeInBits="16" encoding="unsigned"/>
39
+ </xtce:FloatParameterType>
40
+ <xtce:FloatParameterType name="MSEC_Type">
41
+ <xtce:UnitSet>
42
+ <xtce:Unit>ms</xtce:Unit>
43
+ </xtce:UnitSet>
44
+ <xtce:IntegerDataEncoding sizeInBits="32" encoding="unsigned"/>
45
+ </xtce:FloatParameterType>
46
+ <xtce:FloatParameterType name="USEC_Type">
47
+ <xtce:UnitSet>
48
+ <xtce:Unit>us</xtce:Unit>
49
+ </xtce:UnitSet>
50
+ <xtce:IntegerDataEncoding sizeInBits="16" encoding="unsigned"/>
51
+ </xtce:FloatParameterType>
52
+ <xtce:IntegerParameterType name="ADASCID_Type" signed="false">
53
+ <xtce:UnitSet/>
54
+ <xtce:IntegerDataEncoding sizeInBits="8" encoding="unsigned"/>
55
+ </xtce:IntegerParameterType>
56
+ <xtce:IntegerParameterType name="ADAETDAY_Type" signed="false">
57
+ <xtce:UnitSet>
58
+ <xtce:Unit>day</xtce:Unit>
59
+ </xtce:UnitSet>
60
+ <xtce:IntegerDataEncoding sizeInBits="16" encoding="unsigned"/>
61
+ </xtce:IntegerParameterType>
62
+ <xtce:IntegerParameterType name="ADAETMS_Type" signed="false">
63
+ <xtce:UnitSet>
64
+ <xtce:Unit>ms</xtce:Unit>
65
+ </xtce:UnitSet>
66
+ <xtce:IntegerDataEncoding sizeInBits="32" encoding="unsigned"/>
67
+ </xtce:IntegerParameterType>
68
+ <xtce:IntegerParameterType name="ADAETUS_Type" signed="false">
69
+ <xtce:UnitSet>
70
+ <xtce:Unit>us</xtce:Unit>
71
+ </xtce:UnitSet>
72
+ <xtce:IntegerDataEncoding sizeInBits="16" encoding="unsigned"/>
73
+ </xtce:IntegerParameterType>
74
+ <xtce:FloatParameterType name="ADGPSPOS_Type">
75
+ <xtce:UnitSet>
76
+ <xtce:Unit>m</xtce:Unit>
77
+ </xtce:UnitSet>
78
+ <xtce:FloatDataEncoding sizeInBits="32" encoding="IEEE-754"/>
79
+ </xtce:FloatParameterType>
80
+ <xtce:FloatParameterType name="ADGPSVEL_Type">
81
+ <xtce:UnitSet>
82
+ <xtce:Unit>m/s</xtce:Unit>
83
+ </xtce:UnitSet>
84
+ <xtce:FloatDataEncoding sizeInBits="32" encoding="IEEE-754"/>
85
+ </xtce:FloatParameterType>
86
+ <xtce:FloatParameterType name="ADCFAQ_Type">
87
+ <xtce:UnitSet/>
88
+ <xtce:FloatDataEncoding sizeInBits="32" encoding="IEEE-754"/>
89
+ </xtce:FloatParameterType>
90
+ </xtce:ParameterTypeSet>
91
+ <xtce:ParameterSet>
92
+ <xtce:Parameter name="VERSION" parameterTypeRef="VERSION_Type">
93
+ <xtce:LongDescription>Not really used. We aren't changing the version of CCSDS that we use.</xtce:LongDescription>
94
+ </xtce:Parameter>
95
+ <xtce:Parameter name="TYPE" parameterTypeRef="TYPE_Type">
96
+ <xtce:LongDescription>Indicates whether this packet is CMD or TLM. TLM is 0.</xtce:LongDescription>
97
+ </xtce:Parameter>
98
+ <xtce:Parameter name="SEC_HDR_FLG" parameterTypeRef="SEC_HDR_FLG_Type">
99
+ <xtce:LongDescription>Always 1 - indicates that there is a secondary header.</xtce:LongDescription>
100
+ </xtce:Parameter>
101
+ <xtce:Parameter name="PKT_APID" parameterTypeRef="PKT_APID_Type">
102
+ <xtce:LongDescription>Unique to each packet type.</xtce:LongDescription>
103
+ </xtce:Parameter>
104
+ <xtce:Parameter name="SEQ_FLGS" parameterTypeRef="SEQ_FLGS_Type">
105
+ <xtce:LongDescription>Always set to 1.</xtce:LongDescription>
106
+ </xtce:Parameter>
107
+ <xtce:Parameter name="SRC_SEQ_CTR" parameterTypeRef="SRC_SEQ_CTR_Type">
108
+ <xtce:LongDescription>Increments from 0 at reset for each packet issued of that APID. Rolls over at 14b.</xtce:LongDescription>
109
+ </xtce:Parameter>
110
+ <xtce:Parameter name="PKT_LEN" parameterTypeRef="PKT_LEN_Type">
111
+ <xtce:LongDescription>Number of bytes of the data field following the primary header -1. (To get the length of the whole packet, add 7)</xtce:LongDescription>
112
+ </xtce:Parameter>
113
+ <xtce:Parameter name="DOY" parameterTypeRef="DOY_Type" shortDescription="Secondary Header Day of Year">
114
+ <xtce:LongDescription>CCSDS Packet 2nd Header Day of Year in days.</xtce:LongDescription>
115
+ </xtce:Parameter>
116
+ <xtce:Parameter name="MSEC" parameterTypeRef="MSEC_Type" shortDescription="Secondary Header Coarse Time (millisecond)">
117
+ <xtce:LongDescription>CCSDS Packet 2nd Header Coarse Time in milliseconds.</xtce:LongDescription>
118
+ </xtce:Parameter>
119
+ <xtce:Parameter name="USEC" parameterTypeRef="USEC_Type" shortDescription="Secondary Header Fine Time (microsecond)">
120
+ <xtce:LongDescription>CCSDS Packet 2nd Header Fine Time in microseconds.</xtce:LongDescription>
121
+ </xtce:Parameter>
122
+ <xtce:Parameter name="ADAESCID" parameterTypeRef="ADASCID_Type" shortDescription="Spacecraft ID"/>
123
+ <xtce:Parameter name="ADAET1DAY" parameterTypeRef="ADAETDAY_Type" shortDescription="Ephemeris Valid Time, Days Since 1/1/1958"/>
124
+ <xtce:Parameter name="ADAET1MS" parameterTypeRef="ADAETMS_Type" shortDescription="Ephemeris Valid Time, Milliseconds of Day"/>
125
+ <xtce:Parameter name="ADAET1US" parameterTypeRef="ADAETUS_Type" shortDescription="Ephemeris Valid Time, Microseconds of Milliseconds"/>
126
+ <xtce:Parameter name="ADGPSPOSX" parameterTypeRef="ADGPSPOS_Type" shortDescription="Ephemeris Position (ECEF) X"/>
127
+ <xtce:Parameter name="ADGPSPOSY" parameterTypeRef="ADGPSPOS_Type" shortDescription="Ephemeris Position (ECEF) Y"/>
128
+ <xtce:Parameter name="ADGPSPOSZ" parameterTypeRef="ADGPSPOS_Type" shortDescription="Ephemeris Position (ECEF) Z"/>
129
+ <xtce:Parameter name="ADGPSVELX" parameterTypeRef="ADGPSVEL_Type" shortDescription="Ephemeris Velocity (ECEF) X"/>
130
+ <xtce:Parameter name="ADGPSVELY" parameterTypeRef="ADGPSVEL_Type" shortDescription="Ephemeris Velocity (ECEF) Y"/>
131
+ <xtce:Parameter name="ADGPSVELZ" parameterTypeRef="ADGPSVEL_Type" shortDescription="Ephemeris Velocity (ECEF) Z"/>
132
+ <xtce:Parameter name="ADAET2DAY" parameterTypeRef="ADAETDAY_Type" shortDescription="Attitude Valid Time, Days Since 1/1/1958"/>
133
+ <xtce:Parameter name="ADAET2MS" parameterTypeRef="ADAETMS_Type" shortDescription="Attitude Valid Time, Milliseconds of Day"/>
134
+ <xtce:Parameter name="ADAET2US" parameterTypeRef="ADAETUS_Type" shortDescription="Attitude Valid Time, Microseconds of Milliseconds"/>
135
+ <xtce:Parameter name="ADCFAQ1" parameterTypeRef="ADCFAQ_Type" shortDescription="Control Frame Attitude Q1 (i)"/>
136
+ <xtce:Parameter name="ADCFAQ2" parameterTypeRef="ADCFAQ_Type" shortDescription="Control Frame Attitude Q2 (j)"/>
137
+ <xtce:Parameter name="ADCFAQ3" parameterTypeRef="ADCFAQ_Type" shortDescription="Control Frame Attitude Q3 (k)"/>
138
+ <xtce:Parameter name="ADCFAQ4" parameterTypeRef="ADCFAQ_Type" shortDescription="Control Frame Attitude Q4 (scalar)"/>
139
+ </xtce:ParameterSet>
140
+ <xtce:ContainerSet>
141
+ <xtce:SequenceContainer name="CCSDSPacket" abstract="true">
142
+ <xtce:LongDescription>Super-container for telemetry and command packets</xtce:LongDescription>
143
+ <xtce:AncillaryDataSet>
144
+ <xtce:AncillaryData name="topLevelPacket">false</xtce:AncillaryData>
145
+ </xtce:AncillaryDataSet>
146
+ <xtce:EntryList>
147
+ <xtce:ParameterRefEntry parameterRef="VERSION"/>
148
+ <xtce:ParameterRefEntry parameterRef="TYPE"/>
149
+ <xtce:ParameterRefEntry parameterRef="SEC_HDR_FLG"/>
150
+ <xtce:ParameterRefEntry parameterRef="PKT_APID"/>
151
+ <xtce:ParameterRefEntry parameterRef="SEQ_FLGS"/>
152
+ <xtce:ParameterRefEntry parameterRef="SRC_SEQ_CTR"/>
153
+ <xtce:ParameterRefEntry parameterRef="PKT_LEN"/>
154
+ </xtce:EntryList>
155
+ </xtce:SequenceContainer>
156
+ <xtce:SequenceContainer name="CCSDSTelemetryPacket" abstract="true">
157
+ <xtce:LongDescription>Super-container for all telemetry packets</xtce:LongDescription>
158
+ <xtce:AncillaryDataSet>
159
+ <xtce:AncillaryData name="topLevelPacket">false</xtce:AncillaryData>
160
+ </xtce:AncillaryDataSet>
161
+ <xtce:EntryList/>
162
+ <xtce:BaseContainer containerRef="CCSDSPacket">
163
+ <xtce:RestrictionCriteria>
164
+ <xtce:ComparisonList>
165
+ <xtce:Comparison parameterRef="VERSION" value="0" useCalibratedValue="false"/>
166
+ <xtce:Comparison parameterRef="TYPE" value="0" useCalibratedValue="false"/>
167
+ </xtce:ComparisonList>
168
+ </xtce:RestrictionCriteria>
169
+ </xtce:BaseContainer>
170
+ </xtce:SequenceContainer>
171
+ <xtce:SequenceContainer name="SecondaryHeaderContainer" abstract="true">
172
+ <xtce:LongDescription>Container for telemetry secondary header items</xtce:LongDescription>
173
+ <xtce:AncillaryDataSet>
174
+ <xtce:AncillaryData name="topLevelPacket">false</xtce:AncillaryData>
175
+ </xtce:AncillaryDataSet>
176
+ <xtce:EntryList>
177
+ <xtce:ParameterRefEntry parameterRef="DOY"/>
178
+ <xtce:ParameterRefEntry parameterRef="MSEC"/>
179
+ <xtce:ParameterRefEntry parameterRef="USEC"/>
180
+ </xtce:EntryList>
181
+ </xtce:SequenceContainer>
182
+ <xtce:SequenceContainer name="JPSS_ATT_EPHEM" shortDescription="Spacecraft Attitude and Ephemeris">
183
+ <xtce:LongDescription>Spacecraft Attitude and Ephemeris packet used to geolocate mission data</xtce:LongDescription>
184
+ <xtce:AncillaryDataSet>
185
+ <xtce:AncillaryData name="topLevelPacket">true</xtce:AncillaryData>
186
+ </xtce:AncillaryDataSet>
187
+ <xtce:EntryList>
188
+ <xtce:ContainerRefEntry containerRef="SecondaryHeaderContainer"/>
189
+ <xtce:ParameterRefEntry parameterRef="ADAESCID"/>
190
+ <xtce:ParameterRefEntry parameterRef="ADAET1DAY"/>
191
+ <xtce:ParameterRefEntry parameterRef="ADAET1MS"/>
192
+ <xtce:ParameterRefEntry parameterRef="ADAET1US"/>
193
+ <xtce:ParameterRefEntry parameterRef="ADGPSPOSX"/>
194
+ <xtce:ParameterRefEntry parameterRef="ADGPSPOSY"/>
195
+ <xtce:ParameterRefEntry parameterRef="ADGPSPOSZ"/>
196
+ <xtce:ParameterRefEntry parameterRef="ADGPSVELX"/>
197
+ <xtce:ParameterRefEntry parameterRef="ADGPSVELY"/>
198
+ <xtce:ParameterRefEntry parameterRef="ADGPSVELZ"/>
199
+ <xtce:ParameterRefEntry parameterRef="ADAET2DAY"/>
200
+ <xtce:ParameterRefEntry parameterRef="ADAET2MS"/>
201
+ <xtce:ParameterRefEntry parameterRef="ADAET2US"/>
202
+ <xtce:ParameterRefEntry parameterRef="ADCFAQ1"/>
203
+ <xtce:ParameterRefEntry parameterRef="ADCFAQ2"/>
204
+ <xtce:ParameterRefEntry parameterRef="ADCFAQ3"/>
205
+ <xtce:ParameterRefEntry parameterRef="ADCFAQ4"/>
206
+ </xtce:EntryList>
207
+ <xtce:BaseContainer containerRef="CCSDSTelemetryPacket">
208
+ <xtce:RestrictionCriteria>
209
+ <xtce:ComparisonList>
210
+ <xtce:Comparison parameterRef="PKT_APID" value="11" useCalibratedValue="false"/>
211
+ </xtce:ComparisonList>
212
+ </xtce:RestrictionCriteria>
213
+ </xtce:BaseContainer>
214
+ </xtce:SequenceContainer>
215
+ </xtce:ContainerSet>
216
+ </xtce:TelemetryMetaData>
217
+ </xtce:SpaceSystem>