Skip to content

Commit

Permalink
detect grib wind dateset metadata capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
enricofer committed Oct 21, 2021
1 parent bea90d2 commit 2f4d3c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions wind_forecast_routing_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def __init__(self, gribLayer, wind_idx, destinationCrs=None):
destinationCrs = QgsCoordinateReferenceSystem(4326)
transform = QgsCoordinateTransform(self.grib.crs(), destinationCrs, QgsProject.instance().transformContext())
self.grib.updateTriangularMesh(transform)
metadata = self.grib.datasetGroupMetadata(self.grib.datasetIndexAtRelativeTime(QgsInterval(1),wind_idx))
print ("GRIB-METADATA",metadata.dataType(),metadata.isScalar(),metadata.isTemporal(),metadata.isVector())
self.wind_idx = wind_idx

def getWindAt(self, t, lat, lon):
Expand Down
17 changes: 9 additions & 8 deletions wind_forecast_routing_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@
"limits": None,
"resolution": 0.5
},
{
"service": 'icon_eu_p06_',
"context": "Europe - ICON_EU",
"interval": '1',
"days": '5',
"limits": [-23.5, 29.5, 45.0, 70.5],
"resolution": 0.06
},
{
"service": 'arpege_eu_p10_',
"context": "Europe - ARPEGE_EU",
Expand All @@ -112,6 +104,14 @@
"limits": [-32.0, 20.0, 42.0, 72.0],
"resolution": 0.1
},
{
"service": 'icon_eu_p06_',
"context": "Europe - ICON_EU",
"interval": '1',
"days": '5',
"limits": [-23.5, 29.5, 45.0, 70.5],
"resolution": 0.06
},
{
"service": 'nam_conus_12km_',
"context": "North America - NAM_CONUS",
Expand Down Expand Up @@ -306,6 +306,7 @@ def processAlgorithm(self, parameters, context, feedback):
rawReplyObject = manager.blockingGet(request)
j = QJsonDocument.fromJson(rawReplyObject.content())
replyObject = j.toVariant()
print("replyObject", replyObject)
if replyObject["status"]:

download_params = {
Expand Down

0 comments on commit 2f4d3c8

Please sign in to comment.