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

CSIS URI variables in praxis 2 [HC-LE]: Local Effects for Heatwaves #45

Closed
DenoBeno opened this issue Sep 16, 2019 · 25 comments
Closed
Assignees
Labels
BB: Catalogue of ER & AO Catalogue of Elements at Risk and Adaptation Options Building Block specification Data Package Specification Issues

Comments

@DenoBeno
Copy link

DenoBeno commented Sep 16, 2019

Related to #42, #45, #46, #47, #49

I have implemented a "Local Effects or Heatwaves" resource following the instructions from the https://github.com/clarity-h2020/csis/wiki/Services-endpoints-(used-by-CSIS).

The result is https://csis.myclimateservice.eu/node/1272 and now I wonder if this is aright way to do it.

For a start, this is how URIs look: https://service.emikat.at/EmiKatTst/api/scenarios/${emikat_id}/feature/view.2974/table/data?rownum=1000&filter=PROJECT%3D${study_variant}&filter=PERIOD%3D${time_period}&filter=RCP%3D${emissions_scenario}&filter=FREQUENCE%3D${event_frequency}&filter=SZ_ID%3D$emikat_id

That is, this resource has following variables: ${emikat_id}, ${study_variant}, ${time_period}, ${emissions_scenario}, and ${event_frequency}

And this are the allowed values for the variables:

image

Study_variant can be either isn't known until the user decides on some adaptation options.

@DenoBeno
Copy link
Author

DenoBeno commented Sep 16, 2019

Potential Issues:

  1. Study_variant isn't known until the user decides on some adaptation options. Or we start with "baseline" and "adaptation-01" being the same?
  2. From the wiki, I understand that we also need a "baseline" time period. OK, this can be easily added.

Wiki also claims the need for the baseline RPC, but this makes no sense to me. At baseline time period all RPCs must deliver the same result and there is AFAIK no scenario claiming that the future climate will remain the same. Do we need this?

Question: is this the way to go?

@humerh
Copy link

humerh commented Sep 17, 2019

Please remark:
I have now adapted the name of the FILTER Column names:
STUDY_VARIANT
TIME_PERIOD
EMISSIONS_SCENARIO
EVENT_FREQUENCY

See also discussions in #42
and the definition in the wiki page: https://github.com/clarity-h2020/csis/wiki/Services-endpoints-(used-by-CSIS)

@p-a-s-c-a-l
Copy link
Member

p-a-s-c-a-l commented Sep 17, 2019

@p-a-s-c-a-l
Copy link
Member

Ignoring STUDY_VARIANT and EMISSION_SCENARIO (which is not needed for time period baselkine), I get an empty result for https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2974/table/data?rownum=1000&filter=TIME_PERIOD%3D%27Baseline%27&filter=EVENT_FREQUENCY%3D%27rare%27&filter=SZ_ID%3D2846

@humerh
Copy link

humerh commented Sep 18, 2019

You have to use the correct spelling:
https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2974/table/data?rownum=1000&filter=TIME_PERIOD%3D%27Baseline%27&filter=EVENT_FREQUENCY%3D%27Rare%27&filter=SZ_ID%3D2846

But this was not only your error, I had some errors to correct. I hope, it is now ok!

@p-a-s-c-a-l
Copy link
Member

@humerh OK, great. This works:

simple-table

Could you please rename Ocassional to Occasional?

@humerh
Copy link

humerh commented Sep 18, 2019

Could you please rename Ocassional to Occasional?
Done

@DenoBeno
Copy link
Author

Hehe, I'm soooo dyslexic. This time I managed to put a correct value in taxonomy (hail spellchecker!) without even noticing the issue....

image

@DenoBeno
Copy link
Author

DenoBeno commented Sep 19, 2019

You have to use the correct spelling:
https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2974/table/data?rownum=1000&filter=TIME_PERIOD%3D%27Baseline%27&filter=EVENT_FREQUENCY%3D%27Rare%27&filter=SZ_ID%3D2846

But this was not only your error, I had some errors to correct. I hope, it is now ok!

This returns empty set atm :-(

image

By the way: according to this discussion thread, single quotes should not be used in URIs. However, when I try removing them, the call fails completely. replacing %3D with = is OK, replacing %27 with single quotes causes the call to fail completely. It would be good if we could dispose with %27, to make the URIs more readable => less probable to make an error.

@DenoBeno
Copy link
Author

Ignoring STUDY_VARIANT and EMISSION_SCENARIO (which is not needed for time period baselkine), I get an empty result for https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2974/table/data?rownum=1000&filter=TIME_PERIOD%3D%27Baseline%27&filter=EVENT_FREQUENCY%3D%27rare%27&filter=SZ_ID%3D2846

One can indeed ignore some filters, but I would advise against it in production system.

  1. For the time period "baseline", all emission scenarios should indeed return the same, so ignoring this one may be safe, as long as EMIKAT isn't producing any unnecessary data... Ideal solution would be if EMIKAT would ignore this filter for baseline timeframe and always return the same data but I suppose this is overkill...
  2. For the time period baseline, the user could be interested to see what happens when adaptation options are applied and EMIKAT might be actually producing the data. Ignoring this parameter could therefore be dangerous.

It's IMO better to always explicitly set a filter and check if anything is returned than not to set it and risk getting double the amount of the data...

@DenoBeno
Copy link
Author

This works again now. Thanks, Heinrich.

@humerh
Copy link

humerh commented Sep 19, 2019

I fixed the problem.

@DenoBeno
Copy link
Author

DenoBeno commented Sep 19, 2019

Status:

  1. https://csis.myclimateservice.eu/node/1272 was updated with correct URIs.
  2. all three service paths (references) for the csv/json/geojson have the same type "@resource". We need a way to differentiate here.
  3. mapview and especially the geojson take too long to render.
  4. with time_period='Baseline', one has to use EMISSIONS_SCENARIO='baseline'
  5. replacing %3D with = in the URI works, but %27 can't be replaced by ´ (or by ` or by '). Ah wait: replacing it with ' does work, just can't be done in MS word.

So this works:
https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2974/table/data?rownum=1000&filter=STUDY_VARIANT='BASELINE'&filter=TIME_PERIOD='20110101-20401231'&filter=EMISSIONS_SCENARIO='rcp26'&filter=EVENT_FREQUENCY='Rare'&filter=SZ_ID=2846

I'll change it all in the https://csis.myclimateservice.eu/node/1272 so that the URIS are easier to read.

@DenoBeno
Copy link
Author

DenoBeno commented Sep 19, 2019

The "Baseline" emission scenario has been missing. I have added it now and gave it a good explanation, but this means that our software will need to know that baseline scenario can only be combined with baseline time. Hard-coded in the logic. :-(

https://csis.myclimateservice.eu/taxonomy/term/2256


I have also removed all %XX signs from the links used. E.g. the one used for the map now is:

https://service.emikat.at/geoserver/clarity/wms?

plus:

service=WMS&version=1.1.0&request=GetMap&layers=clarity:view.2974&bbox=4672000.0,1979500.0,4687500.0,1988000.0&width=768&height=421&srs=EPSG:3035&format=image/gif&CQL_FILTER=STUDY_VARIANT='${study_variant}' and TIME_PERIOD='${time_period}' AND EMISSIONS_SCENARIO='${emissions_scenario}' AND EVENT_FREQUENCY='${event_frequency}' AND SZ_ID=${emikat_id}&styles=T_A

(formatting breaks here, so I took it apart)
If this works - great, it's easier to read. It does work when I use such URIs in a browser, but browser automatically translates URIs as necessary...

@p-a-s-c-a-l
Copy link
Member

There are even more pitfalls: ${emikat_id} in the URL is sometimes replaced to $%7Bemikat_id%7D(by the browser?).

@DenoBeno
Copy link
Author

That looks really promising now. I looked at maximal damage and damage probability and it changes with period and scenario as one would expect. :-)

@DenoBeno
Copy link
Author

DenoBeno commented Sep 21, 2019 via email

@DenoBeno
Copy link
Author

I just tried the test table introduced by @p-a-s-c-a-l in #46 (comment) on local effects of heatwaves. It's very easy, just do this:

  1. Log in on the EMIKAT on the browser.
  2. follow the link https://csis.myclimateservice.eu/apps/simple-table-component/build/?emikat_id=2846
  3. change the "view.2975" to "view.2974" in the uri at the top of the table and the result is:

image

@p-a-s-c-a-l p-a-s-c-a-l changed the title CSIS URI variables in praxis 1: Local Effects or Heatwaves CSIS URI variables in praxis 1: Local Effects for Heatwaves Sep 26, 2019
@p-a-s-c-a-l p-a-s-c-a-l changed the title CSIS URI variables in praxis 1: Local Effects for Heatwaves CSIS URI variables in praxis 2 [HC-LE]: Local Effects for Heatwaves Sep 26, 2019
@DenoBeno DenoBeno removed help wanted Extra attention is needed question Further information is requested labels Oct 4, 2019
@DenoBeno
Copy link
Author

DenoBeno commented Oct 4, 2019

Heinrik has removed the "&filter=SZ_ID=${emikat_id}" part from the table URIs - I'll rewrite the resource now. (Someone already did this, except or the "download path")

Less good news is that we need to define a way to handle three different temperatures that are returned by this view: T_A, T_MRT, T_UTCI

styles=T_A for Apparent temperature
styles=T_TMRT for Mean Radiant Temperature
styles=T_UTCI for UTCI Temperature

In fact, this is also delivering the "discomfort level"...

For now, it is only possible to differentiate between these three cases (and discomfort?) in the maps, so I will add two more resources. But beware: the table data is exactly the same for al three at the moment, this needs fixing.

@DenoBeno
Copy link
Author

DenoBeno commented Oct 4, 2019

OK, done. I have also removed the surplus hazards tags from all three, to avoid duplication in the data tab.

Beware: since the tables are the same for all three atm., I haven't duplicated the related yet. This needs to be done once these references can be split.

Oh jee. Map component is not showing this properly. Opening a new issue report: :-(

@p-a-s-c-a-l
Copy link
Member

Implemented and working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BB: Catalogue of ER & AO Catalogue of Elements at Risk and Adaptation Options Building Block specification Data Package Specification Issues
Projects
None yet
Development

No branches or pull requests

5 participants