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

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


The following commit(s) were added to refs/heads/master by this push:
     new cec3b3e  Fix CSV/NetCDF bug (#175)
cec3b3e is described below

commit cec3b3ec945aa8a433a3b9cb0c251cdc7d5472f5
Author: Stepheny Perez <[email protected]>
AuthorDate: Wed Jul 20 11:47:08 2022 -0700

    Fix CSV/NetCDF bug (#175)
    
    * Fix bug where metadata links fail for AWS insitu datasets
    
    * Fix NetCDF endpoint
    
    * Updated matchup to ensure both time and space are account for when 
'matchOnce' is true
    
    * Update changelog
---
 CHANGELOG.md                                           |  1 +
 analysis/webservice/algorithms/doms/BaseDomsHandler.py | 13 ++++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 77bb0b9..1c639b6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,4 +25,5 @@ and this project adheres to [Semantic 
Versioning](https://semver.org/spec/v2.0.0
 - Fixed issue where satellite satellite matchups failed
 - Fixed issue where null results were returned if more than "resultSizeLimit" 
matches are found
 - Fixed issue where satellite to satellite matchups with the same dataset 
don't return the expected result
+- Fixed CSV and NetCDF matchup output bug
 ### Security
\ No newline at end of file
diff --git a/analysis/webservice/algorithms/doms/BaseDomsHandler.py 
b/analysis/webservice/algorithms/doms/BaseDomsHandler.py
index bb32146..aec291a 100644
--- a/analysis/webservice/algorithms/doms/BaseDomsHandler.py
+++ b/analysis/webservice/algorithms/doms/BaseDomsHandler.py
@@ -200,11 +200,11 @@ class DomsCSVFormatter:
             for match in primaryValue['matches']:
                 platforms.add(match['platform'])
 
-        # insituDatasets = params["matchup"].split(",")
         insituDatasets = params["matchup"]
         insituLinks = set()
         for insitu in insituDatasets:
-            insituLinks.add(config.METADATA_LINKS[insitu])
+            if insitu in config.METADATA_LINKS:
+                insituLinks.add(config.METADATA_LINKS[insitu])
 
 
         global_attrs = [
@@ -292,7 +292,8 @@ class DomsNetCDFFormatter:
         dataset.CDMS_SearchRadius = float(params["radiusTolerance"])
         dataset.CDMS_SearchRadius_Units = "m"
         dataset.URI_Matchup = "https://doms.jpl.nasa.gov/domsresults?id="; + 
executionId + "&output=NETCDF"
-        dataset.CDMS_ParameterPrimary = params["parameter"] if "parameter" in 
params else ""
+
+        dataset.CDMS_ParameterPrimary = params["parameter"] if ("parameter" in 
params and params['parameter'] is not None) else ""
         dataset.CDMS_platforms = params["platforms"]
         dataset.CDMS_primary = params["primary"]
         dataset.CDMS_time_to_complete = details["timeToComplete"]
@@ -301,8 +302,10 @@ class DomsNetCDFFormatter:
         insituDatasets = params["matchup"]
         insituLinks = set()
         for insitu in insituDatasets:
-            insituLinks.add(config.METADATA_LINKS[insitu])
-        dataset.CDMS_DatasetMetadata = ', '.join(insituLinks)
+            if insitu in config.METADATA_LINKS:
+                insituLinks.add(config.METADATA_LINKS[insitu])
+        if insituLinks:
+            dataset.CDMS_DatasetMetadata = ', '.join(insituLinks)
 
         platforms = set()
         for primaryValue in results:

Reply via email to