I want to know how extract of precipitation data for specific coordinates (longitude/latitude) from the netCDF file that I downloaded. Or how to convert the file from netCDF extension to CSV file. I'll be Thankful for any help.
here I am extracting variables 'u10max' and 'v10max' from the point (145.7292,-40.9972) from the file 'infile.nc' and writing them to the file 'outfile.nc' (for a list of all the commands in NCO see: http://nco.sourceforge.net/#Definition)
You can convert any netCDF file to plain text (*.txt) using the command:
here I am extracting variables 'u10max' and 'v10max' from the point (145.7292,-40.9972) from the file 'infile.nc' and writing them to the file 'outfile.nc' (for a list of all the commands in NCO see: http://nco.sourceforge.net/#Definition)
You can convert any netCDF file to plain text (*.txt) using the command:
NCO is an open source project and widely used in the US. It has a collection of about a dozen packages, which can be used for different operations incl. cutting .nc files.
http://nco.sourceforge.net/
You may look at both and decide, which one works best for you.
It's depend on your model. What is your model? What is domain and scale of your model?
You can read data from netcdf file by using Netcdf Extractor in https://agrimetsoft.com/netcdf-extractor.aspx
It's a windows software for extract time series from netcdf files.
But about calculate your grid number, it's depend on your model. If you have domain of your netcdf file you can use 'Grid Number Calculator' Api that there is in Netcdf-Extractor V1.1 or higher.
Besides that, you can watch many video about calculation of grid number(origin and shape) in my Chanel in YouTube
The best tool to extract data from netCDF is python programming. You can extract the data from many netCDF files using for loop in python but I think the simple tools are GIS softwares like QGIS and ARCGIS.
As other researchers have mentioned above, you can use different programming codes and software tools, namely Matlab coding, NCL, ArcGIS, R, and GRADS.
But the most important tips that you should consider is:
If you want to extract your data model in monthly scale and in a continuous file, it is not any easy process. I want to present an example, as you know CMIP5 has around 60 models which every of them has a especial format for downloading data. One of them in 10 years continuous file but other not.
I mean that if you want to write a unique code which can apply for every format of file (in NC) it is not possible to do. If you want to overcome to this critical issue you should have enough knowledge about programming languages with different aspects.
However, I want to tell you that it was a big problem for my and my colleagues since we are working on various projects that the input files are in nc, nc4, and etc.
So, we decided to solve it and progress a complete tool which can extract any format of nc files, such ac CMIP5 models, CORDEX data outputs, and different outputs in nc. Please see the bellow link for better clarifications:
With this tool, you can easily enter your lists of stations and extract them in a while without any concern, and reduce your time. See the link for better understanding.