Skip to content

Commit

Permalink
Updating Branch
Browse files Browse the repository at this point in the history
Merge branch 'dev' of github.com:IMAP-Science-Operations-Center/imap_processing into glows_cdf_attrs_update
  • Loading branch information
anamanica committed Aug 7, 2024
2 parents e65e4e2 + c71368e commit 0483be4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
18 changes: 16 additions & 2 deletions docs/source/data-access-api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://imap-processing.readthedocs.io/en/latest/data-access-api/calibration-files.html>`_

**Example Usage:**

.. code-block:: bash
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/source/data-access-api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ paths:
items:
type: string


'/download/{filepath}':
get:
tags:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions imap_processing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0483be4

Please sign in to comment.