Closed akankshabalha closed 1 year ago
Hi @akankshabalha,
I created a template for your use case to show you how to use the various functions we have developed so far. At the end, there's a plot of both original and interpolated temperature.
As usual, keep working on a small subset. We'll fix the details (e.g., chunking) and run the notebook on the whole dataset when you are done developing your analysis.
Here is the template: https://github.com/bopen/c3s-eqc-toolbox-template/blob/main/notebooks/wp5/WIP_satellite_albedo.ipynb Here is the notebook executed: https://gist.github.com/malmans2/0f720911280cc49a96175117f9ce1e50
Please let me know if everything is OK.
Hi @malmans2 Thanks but it is not the desired output. I want the pixel size of t2m to be of the same size as albedo. Plotting subset albedo and new t2m together would be helpful for comparison purpose (as you did for original and regridded t2m).
Sorry but I don't understand the request?
You just need to plot albedo and t2m side by side? I've only interpolated the subset because in the code you shared you only download the subset of t2m. Doing it for the larger area is exactly the same.
My request is - if the t2m pixel size is 0.1 0.1 degree and albedo pixel size is 0.01 0.01 degree, then I need t2m pixel to be divided into 100 small pixels (0.1/0.01) to obtain 0.01 degree spatial resolution - same as that of albedo.
These links might be helpful to understand what I want.
https://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/resample-function.htm
I'm still confused.
Do you want to interpolate from t2m grid to albedo grid?
If yes, isn't that what is done at the end of the notebook?
da_t2m_regrid
has the exact same coordinates as da_albedo_subset
I used nearest neighbour interpolation as in your code, are you looking for another interpolation?
What you did till end of the notebook is fine. But I want further processing on da_t2m_regrid. Please see and compare the pixel size of da_albedo_subset and da_t2m_regrid, they are not same. da_t2m_regrid has much bigger pixel size. For example, in da_t2m_regrid, between 77.4 - 77.5 longitudes, there are only two pixels whereas da_albedo_subset has almost 10 pixels. I want da_t2m_regrid to contain same number of pixels between 77.4-77.5 as da_albedo_subset has. (To obtain this, yes you need to do interpolation at some point but before that resampling function needs to be run. I do not know what is equivalent to the desired resampling function in Jupyter)
In simplest terms, I need the spatial resolution of da_t2m_regrid same as da_albedo_subset.
Sorry, but I don't understand what you are looking for.
What you did till end of the notebook is fine. But I want further processing on da_t2m_regrid. Please see and compare the pixel size of da_albedo_subset and da_t2m_regrid, they are not same. da_t2m_regrid has much bigger pixel size. For example, in da_t2m_regrid, between 77.4 - 77.5 longitudes, there are only two pixels whereas da_albedo_subset has almost 10 pixels.
If with number of pixel you mean the number of grid cells, they are identical. As you are interpolating from low res to high res using a nearest neighbour interpolation, there are blocks of 10x10 with identical grid cells. If that's not what you are looking for, then probably you want to apply some different interpolation (for example, bilinear
).
(To obtain this, yes you need to do interpolation at some point but before that resampling function needs to be run. I do not know what is equivalent to the desired resampling function in Jupyter)
If you need to apply some kind of resampling before interpolating, I need to know exactly what you need to do. Ideally, you can show me the python code to do it. If you don't know how to do it with python, you can send me the equation/algorithm and we will code it in python. (Jupyter is just the computing platform, the language we are using for EQC is python)
In simplest terms, I need the spatial resolution of da_t2m_regrid same as da_albedo_subset.
That's exactly what is done in the notebook. da_t2m_regrid
has the same spatial resolution as da_albedo_subset
.
Notebook description
SpatiaResol.txt
Notebook link or upload
No response
Anything else we need to know?
I am using two datasets - surface albedo and ERA5 t2m. Both the datasets have different spatial resolution. As I need both the datasets at same spatial resolution, I have resampled t2m (ds_t2m_resampled) according to the spatial resolution of albedo (i.e 0.01 degree )but I am not able to plot time-weighted raster nor a spatial-weighted time-series of resampled t2m dataset. Could you please help me with it.
Environment