Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileout_covjson module can return invalid JSON reponse #650

Open
lewismc opened this issue Jun 23, 2022 · 3 comments
Open

fileout_covjson module can return invalid JSON reponse #650

lewismc opened this issue Jun 23, 2022 · 3 comments

Comments

@lewismc
Copy link
Contributor

lewismc commented Jun 23, 2022

The fileout_covjson can/does return invalid JSON in OPeNDAP Hyrax (1.16.0). Specifically, if we take SPURS_wg_ASL2.nc.covjson as an example

  • -nan is present in the domain/axes/x/values which is not permitted in JSON syntax
  • no comma is present after the domain/axes object
{
  "type": "Coverage",
  "domain": {
    "type" : "Domain",
    "domainType": "Grid",
    "axes": {
      "x": {
        "values": [...]
      },
      "y": {
        "values": [...]
      },
      "t": {
        "values": ["2018-01-01T00:12:20Z"]
      }
    }    <<<<<<<<<<<<<<<<<< COMMA MISSING HERE
    "referencing": [{
      "coordinates": ["t"],
      "system": {
        "type": "TemporalRS",
        "calendar": "Gregorian"
      }
    },
  • additional commas are present in parameter descriptions
...
    "parameters": {
      "lon_std": {
        "type": "Parameter",
        "description": {
          "en": "Standard deviation for longitude",  <<<<<<<< UNNECESSARY COMMA
        },
        "unit": {
          "label": {
            "en": "degrees_east"
          }
        },
...
  • An additional parameter is present at the end of the parameters block
...
        },
        "observedProperty": {
          "label": {
            "en": "Number of surface current direction measurements used"
          }
        }
      }
    }, <<<<<<<<<<< UNNECESSARY COMMA
  },
  "ranges": {
    "lon_std": {
      "type": "NdArray",
  • the JSON closing syntax is invalid
...
    "cur_dir_ndata": {
      "type": "NdArray",
      "dataType": "float", 
      "axisNames": ["t", "y", "x"],
      "shape": [1],
      "values": [...]
    }
    }
  }] <<<<<<<<<<< CLOSING SQUARE BRACKET AND ADDITIONAL CURLY BRACE RESULT IN INVALID JSON SYNTAX
}

There appear to both other issues as well but I will address them in a separate ticket.

@kyang2014
Copy link
Collaborator

Could you provide a link for the original netCDF file?

@lewismc
Copy link
Contributor Author

lewismc commented Oct 13, 2022

Yes @kyang2014 all you do is remove the .covjson file suffix. Here you go

https://opendap.jpl.nasa.gov/opendap/OceanCirculation/insitu/L2/spurs1/waveglider/SPURS_wg_ASL2.nc

Apologies for delayed response.

@kyang2014
Copy link
Collaborator

kyang2014 commented Oct 13, 2022

Thanks @lewismc . I just checked the file. It is listed as a CF trajectoryprofile DSG file, which Coverage json cannot support. See https://covjson.org/. The Hyrax version at the above URL is 1.16.0. The current release version is 1.16.8. See https://github.com/OPENDAP/bes/releases/tag/3.20.13. We've improved the fileout coverage json module a lot since 1.16.0. For supported domain types, all the issues you pointed out in this ticket are fixed except handling the NaN. I need to check if coverage json allows NaN inside. Will do this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants