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

Bioclim variables mis-identified in worldclim_tile() output #38

Open
jbyoder opened this issue Jan 11, 2023 · 3 comments
Open

Bioclim variables mis-identified in worldclim_tile() output #38

jbyoder opened this issue Jan 11, 2023 · 3 comments

Comments

@jbyoder
Copy link

jbyoder commented Jan 11, 2023

I'm using worldclim_tile() to obtain Bioclim layers at 0.5-min resolution for the first time, and I've run into what seems to be incorrect labeling of the layers. Running

BClim <- worldclim_tile(var="bio", res=0.5, lat=33.75, lon=-118, path="data/")

Returns a RasterStack with layers labeled in order from 1 to 19. However, the values in those layers don't align with anything like what they should be, given the identity of the variables. I first noticed it in comparing bio12 (annual precipitation) and bio13 (precip in the wettest month) — the former should, arithmetically, always be larger than the latter. However, the range of values for the bio12 layer in the stack downloaded above is about 5 to 25, and the range for the bio13 layer is about 26 to 66. (Squinting at hist() outputs to get those.) Subtracting the bio13 layer values from bio12 layer values gets me between about -54 and -8.

Looking across the 19 layers with plot() shows ranges of values that look like they should correspond to Bioclim variables, but not the ones labeled.

plot(BClim)

Screen Shot 2023-01-11 at 15 36 31

As one final check, I went back to getData() from raster, which pulls down WoldClim 1.4 instead of 2.1, and obtained values that make much more sense for the labeled variables.

BClim2 <- getData(name="worldclim", var="bio", res=0.5, lat=33.75, lon=-118, path="data/")
plot(BClim2)

Screen Shot 2023-01-11 at 15 40 06

@cjcarlson
Copy link

Just a note that I've independently reproduced this issue and agree that the output of worldclim_tile doesn't look right. Watching to see what the answer is! Thanks so much Robert!

@Maerien42
Copy link

Maerien42 commented May 12, 2023

Hey everybody, I am quite late with my comment and I am not sur if this was already solved. I observed the same issue when dowloading the data in R. I correlated the data from version 1.4 to 2.1 and it seems that the order of bioclim variables is like the following: 1, 10, 11,12, 13, 14, 15, 16, 17, 18, 19, 2, 3 etc. I guess this comes from the fact that when creating the multband raster the layers where ordered reading the numbers as characters and not as numbers.
version2 1vs1 4
(version 2.1 = rows, version 1.4 = columns

@rjaffe-ramboll
Copy link

I just opened a new issue about the same problem: #56

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

No branches or pull requests

4 participants