|
1 | 1 | #!/usr/bin/env python
|
2 | 2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
|
3 | 3 | """
|
4 |
| -Fetch values from the Ska engineering telemetry archive. |
| 4 | +Fetch values from the cheta telemetry archive. |
5 | 5 | """
|
6 | 6 |
|
7 | 7 | import collections
|
|
31 | 31 | )
|
32 | 32 | from .derived.comps import ComputedMsid
|
33 | 33 | from .lazy import LazyDict
|
34 |
| -from .remote_access import ENG_ARCHIVE |
35 | 34 | from .units import Units
|
36 | 35 |
|
| 36 | +__all__ = [ |
| 37 | + "data_source", |
| 38 | + "local_or_remote_function", |
| 39 | + "get_units", |
| 40 | + "set_units", |
| 41 | + "read_bad_times", |
| 42 | + "msid_glob", |
| 43 | + "MSID", |
| 44 | + "MSIDset", |
| 45 | + "Msid", |
| 46 | + "Msidset", |
| 47 | + "HrcSsMsid", |
| 48 | + "memoized", |
| 49 | + "get_time_range", |
| 50 | + "get_telem", |
| 51 | + "add_logging_handler", |
| 52 | + "get_data_gap_spec_parser", |
| 53 | + "msid_matches_data_gap_spec", |
| 54 | + "create_msid_data_gap", |
| 55 | +] |
| 56 | + |
37 | 57 | # Module-level units, defaults to CXC units (e.g. Kelvins etc)
|
38 | 58 | UNITS = Units(system="cxc")
|
39 | 59 |
|
@@ -109,7 +129,7 @@ def set(cls, *data_sources):
|
109 | 129 | """
|
110 | 130 | Set current data sources.
|
111 | 131 |
|
112 |
| - :param *data_sources: one or more sources (str) |
| 132 | + :param data_sources: one or more sources (str) |
113 | 133 | """
|
114 | 134 | if any(
|
115 | 135 | data_source.split()[0] not in cls._allowed for data_source in data_sources
|
@@ -268,14 +288,14 @@ def _get_start_stop_dates(times):
|
268 | 288 | ft = pyyaks.context.ContextDict("ft")
|
269 | 289 |
|
270 | 290 | # Global (eng_archive) definition of file names
|
271 |
| -msid_files = pyyaks.context.ContextDict("msid_files", basedir=ENG_ARCHIVE) |
| 291 | +msid_files = pyyaks.context.ContextDict("msid_files", basedir=remote_access.ENG_ARCHIVE) |
272 | 292 | msid_files.update(file_defs.msid_files)
|
273 | 293 |
|
274 | 294 | # Module-level values defining available content types and column (MSID) names.
|
275 | 295 | # Then convert from astropy Table to recarray for API stability.
|
276 | 296 | # Note that filetypes.as_array().view(np.recarray) does not quite work...
|
277 |
| -filetypes = ascii.read(os.path.join(DIR_PATH, "filetypes.dat")) |
278 |
| -filetypes_arr = filetypes.as_array() |
| 297 | +filetypes_tbl = ascii.read(os.path.join(DIR_PATH, "filetypes.dat")) |
| 298 | +filetypes_arr = filetypes_tbl.as_array() |
279 | 299 | filetypes = np.recarray(len(filetypes_arr), dtype=filetypes_arr.dtype)
|
280 | 300 | filetypes[()] = filetypes_arr
|
281 | 301 |
|
@@ -1830,6 +1850,7 @@ def write_zip(self, filename):
|
1830 | 1850 | class Msid(MSID):
|
1831 | 1851 | """
|
1832 | 1852 | Fetch data from the engineering telemetry archive into an MSID object.
|
| 1853 | +
|
1833 | 1854 | Same as MSID class but with filter_bad=True by default.
|
1834 | 1855 |
|
1835 | 1856 | :param msid: name of MSID (case-insensitive)
|
@@ -2003,16 +2024,16 @@ def get_telem(
|
2003 | 2024 | High-level routine to get telemetry for one or more MSIDs and perform
|
2004 | 2025 | common processing functions:
|
2005 | 2026 |
|
2006 |
| - - Fetch a set of MSIDs over a time range, specifying the sampling as |
2007 |
| - either full-resolution, 5-minute, or daily data. |
2008 |
| - - Filter out bad or missing data. |
2009 |
| - - Interpolate (resample) all MSID values to a common uniformly-spaced time sequence. |
2010 |
| - - Remove or select time intervals corresponding to specified Kadi event types. |
2011 |
| - - Change the time format from CXC seconds (seconds since 1998.0) to something more |
2012 |
| - convenient like GRETA time. |
2013 |
| - - Write the MSID telemetry data to a zipfile. |
| 2027 | + - Fetch a set of MSIDs over a time range, specifying the sampling as |
| 2028 | + either full-resolution, 5-minute, or daily data. |
| 2029 | + - Filter out bad or missing data. |
| 2030 | + - Interpolate (resample) all MSID values to a common uniformly-spaced time sequence. |
| 2031 | + - Remove or select time intervals corresponding to specified Kadi event types. |
| 2032 | + - Change the time format from CXC seconds (seconds since 1998.0) to something more |
| 2033 | + convenient like GRETA time. |
| 2034 | + - Write the MSID telemetry data to a zipfile. |
2014 | 2035 |
|
2015 |
| - :param msids: MSID(s) to fetch (string or list of strings)') |
| 2036 | + :param msids: MSID(s) to fetch (string or list of strings) |
2016 | 2037 | :param start: Start time for data fetch (default=<stop> - 30 days)
|
2017 | 2038 | :param stop: Stop time for data fetch (default=NOW)
|
2018 | 2039 | :param sampling: Data sampling (full | 5min | daily) (default=full)
|
|
0 commit comments