Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
587 changes: 455 additions & 132 deletions DMI_Open_Data_dialog.py

Large diffs are not rendered by default.

802 changes: 697 additions & 105 deletions DMI_Open_Data_dialog_base.ui

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,33 @@ The output is also the same as Meteorological Observations and the fields includ

![Oceanographic Observations](guide%20image/ocean.png)

## Forecast Data
## Forecast Data (Vector)

- About

Forecast data allows the user to import data from DMIs Forecast models. 4 models will be made available: Weather Model (Harmonie), Wave Model (WAM), Storm Surge Model (DKSS) and Arctic Sea Ice Model (HYCOM-CICE). In version 0.1 of the plugin, only WAM and DKSS is available. When the two remaining models are released, they will also be included in the plugin.
Forecast data allows the user to import data from DMIs 3 Forecast models: HARMONIE (weather model), WAM (Wave model) and DKSS (Strom Surge model).
- Usage

To choose between the different models, use the radio button. Each page has different parameters, areas and specifications. You can specify an area of interest, either by getting the closest point to a specified coordinate, or by defining a bounding box. Read more about forecast data [here](https://confluence.govcloud.dk/pages/viewpage.action?pageId=76155038).
- Output
The output is one or more points that contains the parameters chosen and a timestamp.


![Forecast Data](guide%20image/forecast_vector.png)

## Forecast Data (Raster)

- About

Forecast data allows the user to import data from DMIs Forecast models. 2 models are available: Wave Model (WAM) and Storm Surge Model (DKSS). In version 0.1 of the plugin, only WAM and DKSS is available. When the two remaining models are released, they will also be included in the plugin.
- Usage

To choose between the different models, use the radio button. Each page has different parameters, areas and specifications. It is not possible to choose more than one parameter, as the output is all parameters in one layer. Read more about forecast data [here](https://confluence.govcloud.dk/display/FDAPI/Forecast+Data).
- Output

The output is one layer with all parameters, where the chosen parameter is displayed. In the layer symbology, you can choose between all parameters and depths (depths is only available for DKSS) by clicking on another band. Each band thereby represent a parameter and a depth, that can be visualized by clicking on it.

![Forecast Data](guide%20image/forecast.png)
![Forecast Data](guide%20image/forecast_raster.png)

## Stations and Parameters

Expand Down
37 changes: 37 additions & 0 deletions api/edr_parameters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from typing import Tuple, Dict, List

import requests
from enum import Enum

ParameterId = str
ParameterDescription = str
ParameterInfo = Tuple[ParameterId, ParameterDescription]

class EDRForecastCollection(Enum):
collection: str

HARMONIE_NEA_SF = 'harmonie_nea_sf'
HARMONIE_NEA_PL = 'harmonie_nea_pl'
HARMONIE_IGB_SF = 'harmonie_igb_sf'
HARMONIE_IGB_PL = 'harmonie_igb_pl'
DKSS_NSBS = 'dkss_nsbs'
DKSS_IDW = 'dkss_idw'
DKSS_IF = 'dkss_if'
DKSS_WS = 'dkss_ws'
DKSS_LF = 'dkss_lf'
DKSS_LB = 'dkss_lb'
WAM_DW = 'wam_dw'
WAM_NSB = 'wam_nsb'
WAM_NATLANT = 'wam_natlant'

def get_forecast_parameters(forecast_collection: EDRForecastCollection, api_key: str) -> List[ParameterInfo]:
edr_params = {'api-key': api_key}
forecast_para_request = requests.get(
f'https://dmigw.govcloud.dk/v1/forecastedr/collections/{forecast_collection.value}',
params=edr_params
)
forecast_metadata = forecast_para_request.json()
parameters = []
for parameter_id, parameter_metadata in forecast_metadata['parameter_names'].items():
parameters.append((parameter_id, parameter_metadata['description']))
return parameters
File renamed without changes
Binary file added guide image/forecast_vector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
898 changes: 1 addition & 897 deletions para_munic_grid.py

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions settings/settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>511</width>
<height>334</height>
<y>-95</y>
<width>491</width>
<height>480</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -155,13 +155,25 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>API Key forecastData</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLineEdit" name="DMI_apiKey_forecastData_GRIB"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>API Key forecastEDRData</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QLineEdit" name="DMI_apiKey_forecastData"/>
<widget class="QLineEdit" name="DMI_apiKey_forecastEDRData"/>
</item>
</layout>
</widget>
Expand Down
14 changes: 9 additions & 5 deletions settings/settings_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@

class DMISettingKeys(Enum):
"""
Holds the keys for this plugin settings retrievable by the DMISettingsManager. Note that these should match the
Holds the keys for this pluging settings retrievable by the DMISettingsManaer. Note that these should match the
object names of the settings input widgets in settings.ui file.
"""
METOBS_API_KEY = 'DMI_apiKey_metObs'
OCEANOBS_API_KEY = 'DMI_apiKey_oceanObs'
CLIMATEDATA_API_KEY = 'DMI_apiKey_climateData'
LIGHTNINGDATA_API_KEY = 'DMI_apiKey_lightningData'
RADARDATA_API_KEY = 'DMI_apiKey_radarData'
FORECASTDATA_API_KEY = 'DMI_apiKey_forecastData'
FORECASTDATA_GRIB_API_KEY = 'DMI_apiKey_forecastData_GRIB'
FORECASTDATA_EDR_API_KEY = 'DMI_apiKey_forecastEDRData'

def get_api_name(self) -> str:
if self is DMISettingKeys.METOBS_API_KEY:
Expand All @@ -28,8 +29,10 @@ def get_api_name(self) -> str:
return 'Lightning Data'
if self is DMISettingKeys.RADARDATA_API_KEY:
return 'Radar Data'
if self is DMISettingKeys.RADARDATA_API_KEY:
return 'Forecast Data'
if self is DMISettingKeys.FORECASTDATA_GRIB_API_KEY:
return 'Forecast GRIB Data'
if self is DMISettingKeys.FORECASTDATA_EDR_API_KEY:
return 'ForecastEDR Data'


class DMISettingsManager(SettingManager, QObject):
Expand All @@ -43,7 +46,8 @@ def __init__(self):
self.add_setting(String(DMISettingKeys.CLIMATEDATA_API_KEY.value, Scope.Global, ''))
self.add_setting(String(DMISettingKeys.LIGHTNINGDATA_API_KEY.value, Scope.Global, ''))
self.add_setting(String(DMISettingKeys.RADARDATA_API_KEY.value, Scope.Global, ''))
self.add_setting(String(DMISettingKeys.FORECASTDATA_API_KEY.value, Scope.Global, ''))
self.add_setting(String(DMISettingKeys.FORECASTDATA_GRIB_API_KEY.value, Scope.Global, ''))
self.add_setting(String(DMISettingKeys.FORECASTDATA_EDR_API_KEY.value, Scope.Global, ''))

def emit_updated(self):
self.settings_updated.emit()