-
Notifications
You must be signed in to change notification settings - Fork 96
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
match climatic layers with their temporal dimension #713
Comments
Since you closed the issue, did you solve it? |
Good evening.
To add the temporal dimension (the same date for each attribute, which are 4) I followed the following steps, which are probably a bit 'rough' but work
I apologize if I improperly opened an issue on GitHub with this problem! |
Thanks for the clarification! |
Good evening, I'm reopening the issue because, although the method I wrote above seems to work formally, when I try to select a date, I cannot retrieve the corresponding image. So, I think I might have incorrectly set the temporal dimension. I'll start from the beginning: I used this function to download three climatic variables (precipitation, temperature, and maximum temperature): for each of these variables, I downloaded the first 4 months of the year.
As a result, I have 4 .tif files for each variable, each representing a month. This is, for example, the precipitation variable imported as a stack:
I have 4 layers, each corresponding to a month. I would like to create a These are the steps I followed
Already at this point, I can see that the problem is that it only considers the first month of precipitation (wc2.1_30s_prec_01) as an 'attribute' and does not include all 4 of them. To add the temporal dimension, I tried the following, based on an answer here on Stack Overflow.
I set the temporal dimension, but the attribute still only includes the precipitation values for the first month.
Each month becomes a separate attribute! |
I can look into this if you provide a reproducible example. |
Hello from Bologna, Italy! This is the first Issue I open on GitHub :)
I've been trying to solve a problem for days. I downloaded and imported 4 bioclimatic variables from CHELSA for 3 different months: January, February, and March. I created three stacks, one for each month, containing the variables. Here is how the files look:
My goal is to create data cubes, so I need to add the temporal dimension. In this case, since these are climate series, each layer represents a monthly average over a 30-year period. Therefore, I thought of simply assigning a representative date of the month to each stack.
But if I proceed to create a 'stars' object, I get an object with a single attribute and three dimensions.
'split' option
At this point, I tried to convert the 'attributes' dimension into separate attributes using 'split', but I lost one dimension and couldn't find any way to add it back while keeping the four attributes in place.
manually add date
However, if I manually add the date, I'm left with only one attribute and I can no longer recover the other three. I need to keep this information as it will be needed for creating an SDM.
I have the impression that the solution is simple, but I just can't seem to find it. I really hope for some help. Thank you so much in advance!
The text was updated successfully, but these errors were encountered: