Menu

#702 HapiServer and client to support multiple resolutions and join

open
nobody
None
5
2019-12-06
2019-12-06
No

Autoplot's HAPI server support should support multi-time-resolution and joins by using metadata to recover this feature that the Das2Servers have always used. For example, in the info response, the dataset could identify a group of dataset ids covering courser resolutions:

wget -O - 'https://jfaden.net/HapiServerDemo/hapi/info?id=8500080044259C10'
{
    "HAPI": "2.0",
    "cadence": "PT1M",
    "modificationDate": "2019-12-06T00:00:00.000Z",
    "x_timeReduction.avg" {
                "8500080044259C10": "",
                "8500080044259C10.1hr": "PT1H"
                "8500080044259C10.4d": "P4D" }
    }
    ...
}

Autoplot would then see this in the info response, and would then request an alternate resolution based on the time axis. One problem I can see right away is the info response now has a reference to itself (making it difficult to use templates, for example), so it might be nice to allow for the macro "${ID}", do you would have ${ID}.1hr instead of "8500080044259C10.1hr".

For rank 1 data, it is nice to be able to see the min and max of each data reduction bin (the extent), and there should be a mechanism to identify this as well. By default, if just a cadence string is specified, then the values are assumed to be linear means of the data. Maybe:

wget -O - 'https://jfaden.net/HapiServerDemo/hapi/info?id=8500080044259C10'
{
    "HAPI": "2.0",
    "cadence": "PT1M",
    "modificationDate": "2019-12-06T00:00:00.000Z",
    "x_timeReduction.min" {
                "8500080044259C10": "",
                "8500080044259C10.1hr": { "cadence":"PT1H",  "parameter":"Temperature.min" },
                "8500080044259C10.4d": { "cadence":"P4D", "parameter":"Temperature.min" }
    }
    ...
}

Also it would be good to recover the "join" functionality of the das2server, for example to represent an instrument having two sampling modes. Here we would simply indicate that the data is part of a group:

wget -O - 'https://jfaden.net/HapiServerDemo/hapi/info?id=SpectrumJoin.LFR'
{
    "HAPI": "2.0",
    "cadence": "PT1M",
    "modificationDate": "2019-12-06T00:00:00.000Z",
    "x_group": [ "SpectrogramJoin.LFR", "SpectrogramJoin.HFR" ]
    ...
}

This would assert that it is appropriate to display both on the same axes, and that the two ids share the same parameters.

Discussion

  • Jeremy Faden

    Jeremy Faden - 2019-12-06

    The other thing I don't like about this is that it requires modifying existing responses. While it's convenient to jam a little extra metadata in an info response it might be better to have a whole other area, for example:

    wget -O - 'https://jfaden.net/HapiServerDemo/hapi/x_group?id=SpectrumJoin'
    {
        "HAPI": "99.0",
        "title": "Spectrogram with two sampling modes",
        "group": [ "SpectrogramJoin.LFR", "SpectrogramJoin.HFR" ]
    }
    

    and then the catalog response would have a response like:

    ~~~~~
    wget -O - https://jfaden.net/HapiServerDemo/hapi/catalog
    {
    "HAPI": "2.0",
    ...
    "x_join": [
    "id": "SpectrogramJoin"
    ]
    }
    ~~~~~

     

    Last edit: Jeremy Faden 2019-12-06
  • Jeremy Faden

    Jeremy Faden - 2019-12-06
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -9,7 +9,7 @@
         "x_timeReduction.avg" {
                     "8500080044259C10": "",
                     "8500080044259C10.1hr": "PT1H"
    
    -                "8500080044259C10.7d": "P7D" }
    +                "8500080044259C10.4d": "P4D" }
         }
         ...
     }
    @@ -28,7 +28,7 @@
         "x_timeReduction.min" {
                     "8500080044259C10": "",
                     "8500080044259C10.1hr": { "cadence":"PT1H",  "parameter":"Temperature.min" },
    -                "8500080044259C10.7d": { "cadence":"P1D", "parameter":"Temperature.min" }
    +                "8500080044259C10.4d": { "cadence":"P4D", "parameter":"Temperature.min" }
         }
         ...
     }
    
     
MongoDB Logo MongoDB