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

Access more Climate Normals #88

Closed
cgquick opened this issue Oct 11, 2019 · 3 comments
Closed

Access more Climate Normals #88

cgquick opened this issue Oct 11, 2019 · 3 comments
Labels

Comments

@cgquick
Copy link

cgquick commented Oct 11, 2019

I was trying to pull down the normals for Vancouver Airport, but I keep getting "Error: No stations had climate normals available". It also doesn't show up when I run stations_search("Vancouver", normals_only = TRUE). The climate_id is 1108447. I can go to climate.weather.gc.ca and download the normals without issue. Am I doing something wrong or misunderstanding something? Thank you! I love this package. I'm running 0.3.1.

https://climate.weather.gc.ca/climate_normals/results_1981_2010_e.html?searchType=stnName&txtStationName=vancouver&searchMethod=contains&txtCentralLatMin=0&txtCentralLatSec=0&txtCentralLongMin=0&txtCentralLongSec=0&stnID=889&dispBack=0

@cgquick cgquick changed the title Climate Normals Not Available Via normals_dl() Some Climate Normals Not Available Via normals_dl() Oct 11, 2019
@steffilazerte
Copy link
Member

That's interesting. It looks like there are two ways of getting climate normals from ECCC. There is a site where the normals are available to download via csv (what weathercan currently uses) and there is an interactive site where normals can be downloaded by hand. And they don't have the same data!

I will have to look into accessing this second set of data. It should be doable, but may take some time to re-jig the functions.

Thanks for bringing this to my attention!

@steffilazerte steffilazerte changed the title Some Climate Normals Not Available Via normals_dl() Access more Climate Normals Oct 11, 2019
@urbaingeo4455
Copy link

Hello WeatherCan Team,

First off, thank you for all the hard work you put into WeatherCan. It was the package that got me started in R and I am loving it!

Unfortunately I am also having an error when trying to download climate normals from a specific station:

n <- normals_dl(climate_ids = "6046767")
Error: Problem with mutate() input normals.
x Not Found (HTTP 404). Failed to access climate normals for this station (climate id: 6046767).
i Input normals is purrr::map(.data$loc, normals_raw).
Run rlang::last_error() to see where the error occurred.

I've tried to do some digging to help with debugging

Behaviour in R:

  • When looking for the station with stations_search, it has "Normals = True"
  • When searching "Normals_measurement" both stations climate ID's (6046770 and 6046767) appear to have normals data

On Climate Weather.gc.ca portal:

  • Climate ID does not appear in Canadian Climate Normal CSV's (1981-2010, 1971-2000, 1961-1990)
  • Searching by Name, Province, and Proximity does not yield any results
  • Oddly, I can search a distance from Pukaskwa National Park (where the station is located), but it still generates no results
  • There was an update to the climate.weather.gc.ca page on April 7th, 2021 (yesterday) which appeared to update the station inventory list

Basically, I'm trying to figure out
Is the R library incorrect (should normals = FALSE)?
Have I made a technical mistake (dependencies)?
Is it an error related to the recent Climate Weather update?

Thanks!

@steffilazerte
Copy link
Member

@cgquick I've finally gotten around to changing the climate normals source to https://climate.weather.gc.ca/ which has more stations (and now normals to 1971-2000. 1961-1990 too but they're missing climate ids so are tricky).

If you're interested and willing, could you test it out?

To install/test the dev version:

install.packages('remotes')
remotes::install_github("ropensci/weathercan", ref = "normals")

library(weathercan)
stations_search("Vancouver", normals_years = "current")
normals_dl(climate_id = "1108447")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants