From 8222c1b9ebf850b139baf8d8847abeea33310345 Mon Sep 17 00:00:00 2001 From: anamanica Date: Wed, 7 Aug 2024 15:44:47 -0600 Subject: [PATCH 1/2] Data access api (#720) * Making the Data Access API documentation clearer, and updating information. --- docs/source/data-access-api/index.rst | 18 ++++++++++++++++-- docs/source/data-access-api/openapi.yml | 4 +++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/source/data-access-api/index.rst b/docs/source/data-access-api/index.rst index 3daf1d246..57cbc6bed 100644 --- a/docs/source/data-access-api/index.rst +++ b/docs/source/data-access-api/index.rst @@ -11,14 +11,21 @@ The SDC provides a REST API that allows users to upload and download files, as well as query for file metadata. The following documentation describes the various endpoints that are supported and how to use them. -The API can be accessed from the following URL: https://api.dev.imap-mission.com - +*Note: Several sections and links begin with* [WIP]. *As development on the API is ongoing, this indicates +that the full implementation of the functionality is yet to be completed.* +The API can be accessed from the following URL [WIP]: https://api.dev.imap-mission.com .. openapi:: openapi.yml :group: :include: /upload +When uploading files to the API, ensure these files are stored properly in a ``data`` directory. Then, +ensure your working directory is one level above the ``data`` directory in order to properly upload files. + +[WIP] Certain ancillary files can also be uploaded to the API. For more specific information regarding these files, visit +`Ancillary Files `_ + **Example Usage:** .. code-block:: bash @@ -45,6 +52,13 @@ The API can be accessed from the following URL: https://api.dev.imap-mission.com :group: :include: /download +It is important to note that your working directory will be established as the default directory. I.e, the ``data`` +directory--which files are downloaded to--will automatically be placed in this file path. Choose your working directory +accordingly to suit your desires. + +When downloading a file from the API, different folders within the ``data`` directory will be made to better +organize the files. See the example file path: ``data/imap/swe/l0/2024/01/imap_swe_l0_sci_20240105_20240105_v00-01.pkts`` + **Example Usage:** .. code-block:: bash diff --git a/docs/source/data-access-api/openapi.yml b/docs/source/data-access-api/openapi.yml index bc2ba78be..18952ed46 100644 --- a/docs/source/data-access-api/openapi.yml +++ b/docs/source/data-access-api/openapi.yml @@ -52,6 +52,7 @@ paths: items: type: string + '/download/{filepath}': get: tags: @@ -143,7 +144,8 @@ paths: type: string - in: query name: version - description: The version of data product in the format ``vXX-YY`` (e.g. ``v01-01``). + description: The version of data product in the format ``vNNN`` (e.g. ``v001``). You can also choose to + query ``--version latest`` in order to receive the most recent version of a file. required: false schema: type: string From c71368e38116d8475642d697694e36906afd7ab3 Mon Sep 17 00:00:00 2001 From: anamanica Date: Wed, 7 Aug 2024 15:49:26 -0600 Subject: [PATCH 2/2] packet_file_to_datasets *NOT* in IDEX (#743) * Adding notes in docstring to establish it won't work for IDEX. --- imap_processing/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/imap_processing/utils.py b/imap_processing/utils.py index 12cac4920..01abd6c3b 100644 --- a/imap_processing/utils.py +++ b/imap_processing/utils.py @@ -332,6 +332,12 @@ def packet_file_to_datasets( ------- datasets : dict Mapping from apid to xarray dataset, one dataset per apid. + + Notes + ----- + This function only handles packet definitions with the same variable structure + across all packets with the same ApId. For example, this cannot be used for IDEX + due to the conditional XML structure defined for their science packet. """ # Set up containers to store our data # We are getting a packet file that may contain multiple apids