-
Notifications
You must be signed in to change notification settings - Fork 59
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
How can I change the units 'm' to 'mm' for ERA5 precipitation dataset. #1543
Comments
Hi @CGL5230 ! In your case, the data you have seems to be a total thickness of liquid water for the current timestep, which seems to be a day. If you confirm that the dataset is daily then an explicit and easy way out would be to patch the units like this: pre_ERA5['tp'].attrs['units'] = 'm / day' Xclim will convert to "kg m-2 s-1" under the hood. But in this precise case, pr = xclim.core.units.convert_units_to(pre_ERA5.tp, 'kg m-2 s-1') Be aware however, that this works because the input has all needed metadata for xclim to understand how to handle the conversion! Xclim will read the |
Thanks for quickly reply. I use the command as
|
I want to clarify this command Notice my comand:
But I still got the waring like before.
|
The warnings are indeed simply because the metadata of your dataset is not exactly what xclim expected, especially the If you use I don't have access to the first link you gave, but from the metadata you showed, it seems that
Which is why simply changing the units from "m" to "m/day" should work. I'm not sure I understand why you wanted to multiply by 24 ? That would mean the value is the mean hourly precipitation accumulation, which is not what I infer from the attributes. Footnotes
|
Thanks for your quick reply. I offer the document link to show the precipitation dataset actually is daily mean dataset which would mean the value is the mean hourly precipitation accumulation. Because I want to get a daily-sum precipitation but hourly precipitation. The daily-sum precipitation can be used to calculate the annual precipitation.
|
Generic Issue
Description
I download a ERA5 daily_mean precipitation dataset. I want to use this dataset to calculate the
AnnualPrecipitation
. I use the command as below. Here is the information of precipitation dataset after I revise the units. Before the changing activity, the units is 'm'.What I Did
What I Received
What I found
I don't konw why I got this error, even I changed the units to 'mm'. I want to know how can I fix this problem.
Then I search the xclim user guide and find the function
xclim.core.units.convert_units_to(source, target, context=None)
Can I change the units of precipitation like:
Code of Conduct
The text was updated successfully, but these errors were encountered: