Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: NetCDF file to SLF file

NetCDF file to SLF file 5 years 1 month ago #34768

  • greeshmaranjith1
  • greeshmaranjith1's Avatar
I have cyclone wind data in NetCDF format which is output from the WRF model and i want to use it in the Telemac2D model. I would like to know how to do the conversion of the Net CDF file to the Slf file. I am attaching my wind data here.
Since I am new to python, telemac etc.. pls help me.

we.tl/t-GkuaDNei3H - wind file
The administrator has disabled public write access.

NetCDF file to SLF file 5 years 4 weeks ago #34832

  • pprodano
  • pprodano's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 55
Hello,

As far as I can tell, there is no single script that can do the conversion between NetCDF to SELAFIN format. NetCDF is a common format where you can find wind data, but there are others (i.e., grib or grib2).

Whenever I had to do the similar task, I took a simple and a pragmatic approach. Take the NetCDF or grib file, probe it and see what is inside. There are many utilities that will allow you to carry out such probing and extractions. Next, I would extract a few grid points that have wind data, and write them as simple ascii text files. These could easily be inspected visually. Next, I would create the formatted ascii file to work with the spacio-temporal wind subroutines. The inputs are now good to try a simplified Telemac model.

If it all works for a few wind stations, you can easily modify the workflow above to work for hundreds of wind station via some scripting. Last time I did this, I had 400-500 artificial wind stations (i.e., places where I have extracted NetCDF/grib2 wind data).

I hope the above gives you some ideas on how to proceed.

Pat
The administrator has disabled public write access.

NetCDF file to SLF file 5 years 4 weeks ago #34833

  • josekdiaz
  • josekdiaz's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 48
Hello,

I've been in a similar situation before, and as Pat mentioned, there is no straightforward method to convert the structured NetCDF file to SLF directly, but a workaround would be, for a specific time (or date? or height?):

1.Read the nc file in a GIS software, E.g. QGIS
2.Convert to a ASCII-XYZ points or shapefile .
3. Read the XYZ file into Bluekenue and use a 2DInterpolator object to map the variable to your mesh. If I recall correctly, you can choose from Nearest Neighbor, Inverse distance weight and linear methods to interpolate.
4. Check the mapped variable into the mesh (range of data, min, max) just to be sure that the interpolation method chosen did its job properly.

Of course, you could code a script to perform all these steps taking advantage of both Python SLF reader shipped with telemac and any module that can process nc file (eg netCDF-4), taking into account that interpolation is needed at some point.

Hope it helps,

José Díaz.
The administrator has disabled public write access.
The following user(s) said Thank You: ah_sl

NetCDF file to SLF file 5 years 4 weeks ago #34835

  • greeshmaranjith1
  • greeshmaranjith1's Avatar
Hi Jose,
Your reply is very detailed and it's the first time I am getting a clear reply. For a beginner like me, detailed step-by-step instructions can help a lot. Special thanks to you.
The administrator has disabled public write access.

NetCDF file to SLF file 5 years 3 weeks ago #34837

  • greeshmaranjith1
  • greeshmaranjith1's Avatar
hello jose,
I ahve tried reading nc file in arcgis and qgis, but both is not responding. what should i do then
The administrator has disabled public write access.

NetCDF file to SLF file 5 years 3 weeks ago #34838

  • greeshmaranjith1
  • greeshmaranjith1's Avatar
hello Jose,
I have tried reading NC file in ArcGIS and qgis, but both are not responding. what should I do then?
The administrator has disabled public write access.

NetCDF file to SLF file 5 years 3 weeks ago #34839

  • josekdiaz
  • josekdiaz's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 48
Helllo,

Well, can't really know what's happening, but it seems you are probably getting out of memory or the file is corrupted.

You could try doing it with a better machine, or split the file into smaller ones using an different tool.

Regards,

José Díaz.
The administrator has disabled public write access.

NetCDF file to SLF file 5 years 4 weeks ago #34834

  • greeshmaranjith1
  • greeshmaranjith1's Avatar
Thank you very much. I will look into it and see how my simulation is responding.
The administrator has disabled public write access.

NetCDF file to SLF file 5 years 3 weeks ago #34840

  • amanj2013
  • amanj2013's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 211
  • Thank you received: 24
Hi, just a quick response on this,

I have a Matlab script that interpolated your wind data over your Serafin mesh, but unfortunately, I am not authorized to share the file, however, if you send me both the wind file and the mesh file I may try and help in conversion!Try either Dropbox of google drive.

AMANJ
The administrator has disabled public write access.

NetCDF file to SLF file 5 years 3 weeks ago #34841

  • greeshmaranjith1
  • greeshmaranjith1's Avatar
Hello sir,
This email address is being protected from spambots. You need JavaScript enabled to view it.
This is my email id. Can u pls contact through mail. It will be helpful. I will send my mesh and wind files
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.