You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by sk...@apache.org on 2024/03/06 21:01:01 UTC

(incubator-sdap-nexus) branch develop updated: SDAP-505: Support DOMS insitu API (#299)

This is an automated email from the ASF dual-hosted git repository.

skperez pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2c92cff  SDAP-505: Support DOMS insitu API (#299)
2c92cff is described below

commit 2c92cff0dbd5d9acf8df8b029e6c5300e27cec2f
Author: Stepheny Perez <sk...@users.noreply.github.com>
AuthorDate: Wed Mar 6 13:00:55 2024 -0800

    SDAP-505: Support DOMS insitu API (#299)
    
    * support DOMS insitu API
    
    * update NCAR insitu url
    
    * add endpoint for getting insitu units
---
 CHANGELOG.md                                    |  1 +
 analysis/webservice/algorithms/doms/config.py   | 22 ++++++----------------
 analysis/webservice/algorithms/doms/insitu.py   |  3 +++
 analysis/webservice/algorithms_spark/Matchup.py |  6 +++---
 4 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8db48ef..e0f873d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - SDAP-506:
   - Added STAC Catalog endpoint for matchup outputs
 - SDAP-508: Added spatial extents to the satellite dataset entries in `/list` and `/cdmslist`
+- SDAP-505: Added support for DOMS insitu api 
 ### Changed
 - SDAP-493: 
   - Updated /job endpoint to use `executionId` terminology for consistency with existing `/cdmsresults` endpoint
diff --git a/analysis/webservice/algorithms/doms/config.py b/analysis/webservice/algorithms/doms/config.py
index 8ccc748..e3e5cf3 100644
--- a/analysis/webservice/algorithms/doms/config.py
+++ b/analysis/webservice/algorithms/doms/config.py
@@ -14,39 +14,29 @@
 # limitations under the License.
 
 INSITU_API_ENDPOINT = 'https://doms.jpl.nasa.gov/insitu/1.0/query_data_doms_custom_pagination'
-INSITU_API_SCHEMA_ENDPOINT = 'https://doms.jpl.nasa.gov/insitu/1.0/cdms_schema'
+INSITU_API_SCHEMA_ENDPOINT = 'https://doms.jpl.nasa.gov/in_situ_schema.json'
 
 INSITU_PROVIDER_MAP = [
     {
-        'name': 'NCAR',
-        'endpoint': 'https://cdms.ucar.edu/insitu/1.0/query_data_doms_custom_pagination',
+        'name': 'Florida State University, COAPS',
+        'endpoint': 'https://doms.coaps.fsu.edu/ws/search/samos_cdms',
         'projects': [
             {
-                'short_name': 'ICOADS_NCAR',
-                'name': 'ICOADS Release 3.0',
-                'platforms': ['0', '16', '17', '30', '41', '42']
+                'name': 'SAMOS',
+                'platforms': ['30']
             }
         ]
     },
     {
         'name': 'NCAR',
+        'endpoint': 'https://rda-work.ucar.edu/ws/search/icoads',
         'projects': [
             {
-                'short_name': 'ICOADS_JPL',
                 'name': 'ICOADS Release 3.0',
                 'platforms': ['0', '16', '17', '30', '41', '42']
             }
         ]
     },
-    {
-        'name': 'Florida State University, COAPS',
-        'projects': [
-            {
-                'name': 'SAMOS',
-                'platforms': ['30']
-            }
-        ]
-    },
     {
         'name': 'Saildrone',
         'endpoint': 'https://nasa-cdms.saildrone.com/insitu/1.0/query_data_doms_custom_pagination',
diff --git a/analysis/webservice/algorithms/doms/insitu.py b/analysis/webservice/algorithms/doms/insitu.py
index ae35b4a..8eca25b 100644
--- a/analysis/webservice/algorithms/doms/insitu.py
+++ b/analysis/webservice/algorithms/doms/insitu.py
@@ -29,6 +29,9 @@ def query_insitu_schema():
     metadata
     """
     schema_endpoint = insitu_endpoints.getSchemaEndpoint()
+    if schema_endpoint is None:
+        logging.warning('No insitu schema endpoint defined. Skipping.')
+        return {}
     logging.info("Querying schema")
     response = requests.get(schema_endpoint)
     response.raise_for_status()
diff --git a/analysis/webservice/algorithms_spark/Matchup.py b/analysis/webservice/algorithms_spark/Matchup.py
index 7c7f551..ee43624 100644
--- a/analysis/webservice/algorithms_spark/Matchup.py
+++ b/analysis/webservice/algorithms_spark/Matchup.py
@@ -548,11 +548,11 @@ class DomsPoint(object):
             return key in d and d[key] is not None and d[key] != ''
 
         if is_defined('id', point.platform):
-            point.platform = edge_point.get('platform')['id']
+            point.platform = str(edge_point.get('platform')['id'])
         elif is_defined('code', point.platform):
-            point.platform = edge_point.get('platform')['code']
+            point.platform = str(edge_point.get('platform')['code'])
         elif is_defined('type', point.platform):
-            point.platform = edge_point.get('platform')['type']
+            point.platform = str(edge_point.get('platform')['type'])
 
         data_fields = [
             'air_pressure',