<p>I have the CORDEX netcdf data and I would like to convert them to raw text file that can be used for importing data to DHI Mike.</p>
<p>To give more context, I have previously converted the ECMWF netcdf (historical) data into the the raw text compatible for DHI Mike, using a Python script. In <a href="https://github.com/mahdisamieenia/sample-files" rel="nofollow noreferrer">this Github repository</a>, I have these files:</p>
<ul>
<li>&quot;2020.nc&quot; is the ECMWF netcdf data</li>
<li>&quot;2020 (2).txt&quot; the converted text file</li>
<li>&quot;py_ecmwf_gridseries_convertor.ipynb&quot; the python script for the required conversion.</li>
</ul>
<p>Now what I am trying to achieve is to do a similar conversion, but this time on the CORDEX (projected) data. In the same repository I have a sample CORDEX file named &quot;out1.nc&quot;.</p>
<p>I would appreciate it if the community can point me toward the right direction.</p>
<p>P.S.</p>
<p>If it helps, the metadata in the raw text file is as follows:</p>
<p>&quot;Title&quot; &quot;caspian-sea&quot;</p>
<p>&quot;Dim&quot; 2</p>
<p>&quot;Geo&quot; &quot;LONG/LAT&quot; 47 31 0</p>
<p>&quot;Time&quot; &quot;EqudistantTimeAxis&quot; &quot;1970-01-11&quot; &quot;04:06:00&quot; 4 3600</p>
<p>&quot;NoGridPoints&quot; 45 33</p>
<p>&quot;Spacing&quot; 0.25 0.25</p>
<p>&quot;NoStaticItems&quot; 0</p>
<p>&quot;NoDynamicItems&quot; 1</p>
<p>&quot;Item&quot; &quot;2 metre temperature&quot; &quot;t2m&quot; &quot;K&quot;</p>
<p>NoCustomBlocks 1</p>
<p>&quot;M21_Misc&quot; 1 7 0 -1E-030 -900 -999 -1E-030 -1E-030 -1E-030</p>
<p>&quot;Delete&quot; -1E-030</p>
<p>&quot;DataType&quot; 0</p>

CC BY-SA 4.0
2022-02-01T10:11:36.503Z
Welcome at EarthScience.SE. You mention "ECMWF" in the title but "CORDEX" in the text body. Which of both do you mean? CORDEX netCDF data should be CF compliant. There are many different data products offered by ECMWF. How exactly should this "raw text" file look like? How should values be separated: comma, newline, semicolon, space, ...? Do you need time series at certain locations or gridded data? Does the data need to be interpolated?
daniel.heydebreck
CC BY-SA 4.0
2022-02-01T10:43:49.450Z
What might help people answering the question: Which variables do you need (precipitation)? Why is the CF-compliance important, when you need the convert the netCDF into text? Is there a conversion tool existing to create the DHI Mike input files from specifically named netCDF files?
daniel.heydebreck
CC BY-SA 4.0
2022-02-01T10:44:31.947Z
Once, I set up a R package that converts EURO-CORDEX data into SWAT input data. Maybe, the would be a good starting point for you: https://github.com/neumannd/eurocordex2swatTools .
daniel.heydebreck
CC BY-SA 4.0
2022-03-13T16:43:00.030Z
@daniel.heydebreck Thanks for the elaborate comment. I have edited the question to clarify the issue. I'd appreciate your input.
Fati
<climate><netcdf>
How to convert CORDEX netcdf data to be used for importing data to DHI Mike?
Fati
# How to convert CORDEX netcdf data to be used for importing data to DHI Mike?

(Asked by: username_0 on 2022-01-31)

I have the CORDEX netcdf data and I would like to convert them to raw text file that can be used for importing data to DHI Mike.

To give more context, I have previously converted the ECMWF netcdf (historical) data into the the raw text compatible for DHI Mike, using a Python script. In [this Github repository](https://github.com/mahdisamieenia/sample-files), I have these files:

* "2020.nc" is the ECMWF netcdf data
* "2020 (2).txt" the converted text file
* "py\_ecmwf\_gridseries\_convertor.ipynb" the python script for the required conversion.

Now what I am trying to achieve is to do a similar conversion, but this time on the CORDEX (projected) data. In the same repository I have a sample CORDEX file named "out1.nc".

I would appreciate it if the community can point me toward the right direction.

P.S.

If it helps, the metadata in the raw text file is as follows:

"Title" "caspian-sea"

"Dim" 2

"Geo" "LONG/LAT" 47 31 0

"Time" "EqudistantTimeAxis" "1970-01-11" "04:06:00" 4 3600

"NoGridPoints" 45 33

"Spacing" 0.25 0.25

"NoStaticItems" 0

"NoDynamicItems" 1

"Item" "2 metre temperature" "t2m" "K"

NoCustomBlocks 1

"M21\_Misc" 1 7 0 -1E-030 -900 -999 -1E-030 -1E-030 -1E-030

"Delete" -1E-030

"DataType" 0

**Tags:** climate, netcdf

> **Comments:**
> **username_1**: Welcome at EarthScience.SE. You mention "ECMWF" in the title but "CORDEX" in the text body. Which of both do you mean? CORDEX netCDF data should be CF compliant. There are many different data products offered by ECMWF. How exactly should this "raw text" file look like? How should values be separated: comma, newline, semicolon, space, ...? Do you need time series at certain locations or gridded data? Does the data need to be interpolated?  
> **username_1**: What might help people answering the question: Which variables do you need (precipitation)? Why is the CF-compliance important, when you need the convert the netCDF into text? Is there a conversion tool existing to create the DHI Mike input files from specifically named netCDF files?  
> **username_1**: Once, I set up a R package that converts EURO-CORDEX data into SWAT input data. Maybe, the would be a good starting point for you: https://github.com/neumannd/eurocordex2swatTools .  
> **username_0**: @username_1 Thanks for the elaborate comment. I have edited the question to clarify the issue. I'd appreciate your input.  

---

## 0 answers

