inverted Lat &Lon data
Added by PRADEEP ATTRI 7 months ago
I am processing the land surface temperature (L3) data. As shown in the image, the data is inverted.
what cdo command I can use to make the orientation correct? I need help regarding how I can fix it.
I am also attaching the file. please help me with this query.
Screenshot 2024-05-04 201037.png (163 KB) Screenshot 2024-05-04 201037.png | inverted image of the land_surface_temperature |
Replies (5)
RE: inverted Lat &Lon data - Added by Karin Meier-Fleischer 7 months ago
RE: inverted Lat &Lon data - Added by PRADEEP ATTRI 6 months ago
Hi
I have tried the commands cdo -r settaxis,2005-01-01,00:00:00,1month LST_daily_degC_lat-lon_2005-2020_2.nc LST_daily_degC_lat-lon_2005-2020_3.nc
and then I tried to use the invertlat
command but nothing really happened.
In both the cases the data did not rotate by 180 degree (anticlockwise or clockwise).
cdo invertlat LST_daily_degC_lat-lon_2005-2020_1.nc LST_daily_degC_lat-lon_2005-2020_2.nc
cdo invertlon LST_daily_degC_lat-lon_2005-2020_1.nc LST_daily_degC_lat-lon_2005-2020_2.nc
but i still see the similar issue with my data.
using grads, i used these commands and this is the description
LON set to 0 360 LAT set to -89.95 89.95 LEV set to 0 0 Time values set: 2005:1:1:0 2005:1:1:0 E set to 1 1 Descriptor: E:\PRADEEP\correlation_between_variables\LST_daily_degC_lat-lon_2005-2020_4.nc Binary: E:\PRADEEP\correlation_between_variables\LST_daily_degC_lat-lon_2005-2020_4.nc Type = Gridded Xsize = 3600 Ysize = 1800 Zsize = 1 Tsize = 192 Esize = 1 Number of Variables = 1 lst_day_cmg 0 t,y,x Monthly daytime 3min CMG Land-surface Temperature
Please help me with this i have i have to submit my PhD thesis soon and this error is not allowing me to finish the final analysis to be done.
RE: inverted Lat &Lon data - Added by Uwe Schulzweida 6 months ago
I assume that the grid information was already incorrect in the original data before the interpolation. The data is also shifted by 180 degrees in the longitudes. This can only be solved in CDO with the setgrid function and the correct grid description.
If you are using a GrADS descriptor file, this can also be easily corrected in this file with the yrev option and the correkt starting point of the longitudes:
DSET ^MODIS.nc DTYPE NetCDF OPTIONS yrev XDEF 7200 LINEAR -180.000000 0.050000 YDEF 3600 LINEAR -89.975000 0.050000 ...
RE: inverted Lat &Lon data - Added by PRADEEP ATTRI 6 months ago
Thank you for your suggestion I have generated a mygrid file
# # gridID 1 # gridtype = lonlat gridsize = 6480000 xsize = 3600 ysize = 1800 xname = lon xlongname = "longitude" xunits = "degrees_east" yname = lat ylongname = "latitude" yunits = "degrees_north" xfirst = 180 xinc = 0.1 yfirst = -89.95 yinc = 0.1 scanningMode = 64
cdo griddes ifile > mygrid
cdo setgrid,mygrid ifile ofile
At xfirst i did 180 so i could fix my longitude, i am still facing issue with my latitude.
For your reference, I am attaching how my data file looks, as mentioned in the image below.
I do not know how to write the descriptor file but i tried to write it.
dset ^E:\PRADEEP\correlation_between_variables\ofile.nc title test dtype netcdf UNDEF -9999. options yrev xdef 3600 linear -180 180 ydef 1800 linear -89.95 89.95 zdef 1 linear 1 1 tdef 12 linear 0z1jan2020 1mon edef 2 names sw lw vars 1 dF_lst=>lst_day_cmg 1 t,x,y,e Monthly daytime 3min CMG Land-surface Temperature endvars
May you please tell me what mistake i am making in the descriptor file? and if possible how can i fix the latitude using cdo. I have tried invertlat and it did not work.
Thank you for you kind response. It's really helpful.
Regards.
RE: inverted Lat &Lon data - Added by Uwe Schulzweida 6 months ago
The option yrev reverse the latitudes. If the latitude are still upside down, then you have to remove this option.