Pirate-Weather/pirateweather

`elevation` should report forecast point elevation

carloshwa opened this issue · 10 comments

Describe the bug

The elevation property seems to returns the elevation for the point that was requested, not the elevation for the point forecasted.

For example:
https://api.pirateweather.net/forecast/[API_KEY]/42.874874,140.658892
returns:
"elevation": 3159
"currently": { "temperature": 29.94 }`

and
https://api.pirateweather.net/forecast/[API_KEY]/42.859359,140.705712
returns:
"elevation": 1237
"currently": { "temperature": 29.32 }

The elevation for the first point is much higher than the 2nd, but the temperature is nearly identical which should definitely not be the case.

Expected behavior

Response should report the elevation for the forecasted location.

Actual behavior

Response includes elevation for the coordinates requested.

API Endpoint

Production

Location

42.874874,140.658892

Other details

This field was originally added as a result of Feature Request #2.

Troubleshooting steps

  • I have searched this repository and Home Assistant Repository to see if the issue has already been reported.
  • I have read through the API documentation before opening this issue.
  • I have written an informative title.

This one is sort of an interesting question- my overall mental model for this API is that "point requested = point returned" from a data standpoint, but obviously that's not quite true. I use ETOPO for elevation data, which will isn't the highest resolution provider, and I suspect that's the root cause of the inaccuracy you're seeing.

As a possible solution, would it help if I returned the lat/lon of the ETOPO point that's being referenced? One of the features in V2 is that it'll return the model grid index for the forecast models that's being extracted, so would be easy to add ETOPO to the list

Sorry that the terminology I am using is probably incorrect. I think what I'm asking for is the model elevation? For example, if you pull up the GFS forecast for the first point I included above:
https://www.spotwx.com/products/grib_index.php?model=gfs_pgrb2_0p25_f&lat=42.874874&lon=140.658892&tz=Asia/Tokyo&label=Hirafu,%20Kutchan,%20Abuta,%20Hokkaido

It reports model elevation of 319 m / 1047 ft, which sounds right for the forecast returned.

So are you saying V2 would be easy to return the ETOPO elevation for the model grid used? If so, that would be great :)

Just wanted to say I haven't forgotten about this! V2 is up for testing on the dev endpoint, but I missed this particular issue for it- you should see the lat/lon I'm extracting from ETOPO as a flag in the next couple days. Also hoping to switch it over to ETOPO1, which should improve the accuracy as well.

One potential hiccup is that this isn't the value the GFS model is using, but rather a different elevation data set. I've never actually seen a source for GFS, although it must be out there somewhere...

Quick update- this is live in version 2.0l, which should go to production API tomorrow! It's still relying on ETOPO, so may have some inaccuracies from there; however, at least now the lat/lon of the elevation model is returned so you can see what it's up to

Thanks! I'm trying out the new 2.0 endpoint & I see that it now returns the model coordinates used. Would it possible to also include the elevation for that point? For example, requesting 42.874874, 140.658892 returns:

"sourceIDX": {
  "gfs": {
    "x": 563,
    "y": 531,
    "lat": 42.75,
    "lon": 140.75
  },
  "etopo": {
    "x": 19240,
    "y": 7972,
    "lat": 42.8667,
    "lon": 140.6667
  }
}

The elevation returned is 3159, which does match the etopo coordinates but I would also like to see the elevation for the gfs coordinates, since that is the point that the forecast is actually generated for. Thank you!

I would love to include it, but despite a fair bit of sleuthing, I can't seem to find the GFS elevation data anywhere! I know exactly what you're asking for here, and I know it must exist, but for whatever reason I can't seem to find it online. If you manage to track it down, let me know and I'll drop it in

@alexander0042 Would it be possible to look up the elevation for the model coordinates from ETOPO too? Apologies if I'm not understanding how this all works together!

What's currently being returned is the elevation from ETOPO, which is a separate elevation data set maintained by NOAA. GFS (the model) would have its own internal elevation database, but the issue is that I don't know where to find it

There has been no activity on this issue in the last ninety days and it will automatically close in seven days. Leave a comment on this issue to prevent it from closing automatically.

This issue has been automatically closed as there has been no further activity in seven days. Feel free to re-open this issue or you can create a follow-up issue.