ua-snap / ardac-explorer

ARDAC GUI Explorer
0 stars 0 forks source link

Disable invalid model/scenario combos and update CMIP6 model options #104

Closed cstephen closed 3 months ago

cstephen commented 3 months ago

Closes #93.

Not all scenarios (SSPs) are available for every model from our CMIP6 Indicators Data API endpoint. Invalid model + SSP combinations are set to null in the API output. This PR prevents users from accidentally selecting an invalid model + SSP combination from the CMIP6 Indicator chart dropdown menus by graying out SSPs that are unavailable for the selected model.

If a user first selects an SSP, then selects a model that does not support that SSP, I've added some code to revert back to the default SSP (SSP5-8.5) since this scenario is present for all models.

I've also updated the available model choices to reflect our current API output since these seem to have changed somewhere along the way.

To test, enter a location to load a chart for any of the CMIP6 Indicators ARDAC items:

http://arcticdatascience.org/item/indicator-ftc-cmip6 http://arcticdatascience.org/item/indicator-su-cmip6 http://arcticdatascience.org/item/indicator-dw-cmip6 http://arcticdatascience.org/item/indicator-rx1day-cmip6

Experiment with selecting various models from the "Model" dropdown menu and observe that, depending on what model you chose, some SSP options are grayed out in the "Scenario" dropdown. A new chart should load no matter what model + SSP combo you select.