Skip to content

Commit

Permalink
doc: add URLs to CDF-1,2,5 format specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
wkliao committed Sep 11, 2024
1 parent 8f0061a commit 675724a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
10 changes: 7 additions & 3 deletions docs/nc4_vs_pnetcdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ operational modes.
+ Classic file format (CDF-1) -- The ESDS Community Standard defined the file format
to be used in the NetCDF user community in 1989. The file header bears a
signature of character string 'CDF-1' and now is commonly referred to as
'CDF-1' file format.
[CDF-1](https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d1-file-format-specification.html)
file format.
* 'CDF-2' format -- The CDF-1 format was later extended to support large
file size (i.e. larger than 2GB) in 2004. See its specification in
[ESDS-RFC-011v2.0](https://cdn.earthdata.nasa.gov/conduit/upload/496/ESDS-RFC-011v2.00.pdf).
Because its file header bears a signature of 'CDF-2' and the format is
also commonly referred to as 'CDF-2' format.
* 'CDF-5' format -- The CDF-2 format was extended by PnetCDF developer team
also commonly referred to as
[CDF-2](https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d2-file-format-specification.html)
format.
* [CDF-5](https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d5-file-format-specification.html)
format -- The CDF-2 format was extended by PnetCDF developer team
in 2009 to support large variables and additional large data types, such
as 64-bit integer.
+ HDF5-based file format -- Starting from its version 4.0.0, NetCDF includes
Expand Down
8 changes: 6 additions & 2 deletions docs/source/tutorial/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ Creating/Opening/Closing a netCDF file
This is also the method used to open an existing netCDF file. If the file is
open for write access (mode='w', 'r+' or 'a'), you may write any type of data
including new dimensions, variables and attributes. Currently, netCDF files
can be created in classic formats, specifically the formats of CDF-1, 2, and
5. When creating a new file, the format may be specified using the format
can be created in classic formats, specifically the formats of
`CDF-1 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d1-file-format-specification.html>`_,
`CDF-2 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d2-file-format-specification.html>`_,
and
`CDF-5 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d5-file-format-specification.html>`_.
When creating a new file, the format may be specified using the format
keyword in the ``File`` constructor. The default format is CDF-1. To see how a
given file is formatted, you can examine the ``file_format`` attribute.
Closing the netCDF file is accomplished via the :meth:`File.close` method of
Expand Down
11 changes: 9 additions & 2 deletions docs/source/tutorial/datatypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Data type

NetCDF Variable Data Types
The following table gives the netCDF external data types defined in CDF-1 and
CDF-2 and the corresponding type constants for defining variables in the
`CDF-1 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d1-file-format-specification.html>`_
and
`CDF-2 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d2-file-format-specification.html>`_
and the corresponding type constants for defining variables in the
python interface. All these data types have direct numpy quivalent.


Expand All @@ -26,7 +29,10 @@ NetCDF Variable Data Types
+-------+----------------+-------+----------------------------------------+---------------------+


Additional data types supported in CDF-5 format:
Additional data types supported in
`CDF-5 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d5-file-format-specification.html>`_.
format:


+---------------------+----------------+-------+----------------------------------------+---------------------+
| Type | C #define | Bits | Intent of use | Numpy Equivalent |
Expand All @@ -41,3 +47,4 @@ NetCDF Variable Data Types
+---------------------+----------------+-------+----------------------------------------+---------------------+
| unsigned long long | NC_UINT64 | 64 | unsigned 8-byte integer | np.uint64 or 'u8' |
+---------------------+----------------+-------+----------------------------------------+---------------------+

11 changes: 8 additions & 3 deletions src/pnetcdf/_File.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ cdef class File:
:param str format: [Optional] underlying file format. Only relevant
when creating a new file.
- ``NETCDF3_64BIT_OFFSET`` or ``NC_64BIT_OFFSET``: CDF-2 format
- ``NETCDF3_64BIT_DATA`` or ``NC_64BIT_DATA``: CDF-5 format
- ``NETCDF3_64BIT_OFFSET`` or ``NC_64BIT_OFFSET``:
`CDF-2 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d2-file-format-specification.html>`_
format
- ``NETCDF3_64BIT_DATA`` or ``NC_64BIT_DATA``:
`CDF-5 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d5-file-format-specification.html>`_
format
- ``NETCDF3_CLASSIC`` or `None` defaults to default file format
(CDF-1 format)
(`CDF-1 <https://parallel-netcdf.github.io/doc/c-reference/pnetcdf-c/CDF_002d1-file-format-specification.html>`_
format)
:param comm: [Optional]
MPI communicator to use for file access. `None` defaults to
Expand Down

0 comments on commit 675724a

Please sign in to comment.