You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>All of the code in this tutorial is available in <code>examples/tutorial.py</code>, except
112
+
the parallel IO example, which is in <code>examples/mpi_example.py</code>.
113
+
Unit tests are in the <code>test</code> directory.</p>
110
114
<h2id="creatingopeningclosing-a-netcdf-file">Creating/Opening/Closing a netCDF file</h2>
111
115
<p>To create a netCDF file from python, you simply call the <code><atitle="netCDF4.Dataset" href="#netCDF4.Dataset">Dataset</a></code>
112
116
constructor. This is also the method used to open an existing netCDF
@@ -671,9 +675,9 @@ <h2 id="beyond-homogeneous-arrays-of-a-fixed-type-compound-data-types">Beyond ho
671
675
Compound data types
672
676
are created from the corresponding numpy data type using the
673
677
<code><atitle="netCDF4.Dataset.createCompoundType" href="#netCDF4.Dataset.createCompoundType">Dataset.createCompoundType()</a></code> method of a <code><atitle="netCDF4.Dataset" href="#netCDF4.Dataset">Dataset</a></code> or <code><atitle="netCDF4.Group" href="#netCDF4.Group">Group</a></code> instance.
674
-
Since there is no native complex data type in netcdf, compound types are handy
675
-
for storing numpy complex arrays.
676
-
Here's an example:</p>
678
+
Since there is no native complex data type in netcdf (but see
679
+
<ahref="#support-for-complex-numbers">Support for complex numbers</a>), compound
680
+
types are handy for storing numpy complex arrays. Here's an example:</p>
677
681
<pre><codeclass="language-python">>>> f = Dataset("complex.nc","w")
678
682
>>> size = 3 # length of 1-d complex array
<p><strong>copyright</strong>: 2008 by Jeffrey Whitaker.</p>
1104
1142
<p><strong>license</strong>: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
@@ -1553,7 +1591,8 @@ <h3>Instance variables</h3>
1553
1591
Ignored if <code>parallel=False</code>.</p>
1554
1592
<p><strong><code>info</code></strong>: MPI_Info object for parallel access. Default <code>None</code>, which
1555
1593
means MPI_INFO_NULL will be used.
1556
-
Ignored if <code>parallel=False</code>.</p></div>
1594
+
Ignored if <code>parallel=False</code>.</p>
1595
+
<p><strong><code>auto_complex</code></strong>: if <code>True</code>, then automatically convert complex number types</p></div>
0 commit comments