KHAN1
October 11, 2022, 11:58am
1
Continuing the discussion from How can extrapolate data from 10 to 50 meters using the NetCDF file in R software? :
HI @KHAN1
Since you also wanted to be able to write out back to a netcdf file, I found that the terra package did a better job without creating bands in the wrong order when I saved to a netcdf file (at least when I looked at the file in the panoply app.)
library("terra")
u10 <- rast("~/Downloads/ERA5_monthlyWindSpeed.nc", drivers = "NETCDF")
#https://en.wikipedia.org/wiki/Wind_profile_power_law
u_calc <- function(ur, zr, z, a = 0.143) {
ur * ((z / zr) ^ a)
}
# Calculate windspeed at height z = 50
u50 <- u_calc(u10, zr = 10, z = 50)
writeCDF(u50, filename = "~/Downloads/u50.nc", varname = "sfcWind",
unit = "m/s", zname = "time", prec = "float")
Hello dear scientist @jrmuirhead
I am facing a problem after my data converted to 100m from 10m that is "Time coordinate"
The time coordinate is disappeared from the file.
Could you please help how to fix it
based on my understanding I tried it but could not succeed
Both files are attached in the following link (the original file is 10m and after extrapolating file is 100m)
https://drive.google.com/drive/folders/1FHfw0btsQRuQjHVUJxxcRjm7kj8c23ZS?usp=sharing
Could you please show me the directions?
Thank you, dear scientist
system
Closed
November 22, 2022, 11:59am
2
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.