Commit Graph

30 Commits

Author SHA1 Message Date
Dennis Heimbigner
29281a2f89 nccopy must use defaulting when there are no -c parameters
re: issue https://github.com/Unidata/netcdf-c/issues/1436

It used to be that when no -c parameters were specified
(and the input was some variant of netcdf-3) that nccopy
let the netcdf-c library decide on any default chunking.
Now, it attempts to do it itself and is not doing it
correctly when unlimited dimensions are involved.

So fix is to revert to previous behavior.

Note: The chunking rules are getting too complicated; consider revising.
2019-07-14 15:18:03 -06:00
Dennis Heimbigner
a6b04c0c66 Extend nccopy -F option syntax.
A user suggested that the nccopy -F option
syntax should be extended to support specification
of multiple (or all) variables in a single -F option.

The new syntax allows:

1. '*' as the name of the variable; this means apply the
   filter to all variables in the data set.
2. *var1|var2|...* as the variable name to indicate that the filter
   should be applied to the multiple specified variables.
2019-02-08 18:48:17 -07:00
Dennis Heimbigner
3ad02fe94f Fix failure in the nccopy -c option
re: https://github.com/Unidata/netcdf-c/issues/1183

Changes:
1. fix typo in nccopy.1 man page
2. fix chunkspec parsing for -c so that "-c var:"
   (with no chunkspec arguments) disables chunking
   on the specified variable
3. Add test case to ncdump/tst_nccopy5.sh
2018-11-12 12:59:56 -07:00
Dennis Heimbigner
7e2a9a9bdf Restore the lost documentation in nccopy.1 of
the new per-variable chunking specifications.
2018-10-13 16:24:37 -06:00
Dennis Heimbigner
8072d1f6bb Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch
re: issue https://github.com/Unidata/netcdf-c/issues/1151

Modify DAP2 and DAP4 code to handle case when _FillValue type is not
same as the parent variable type.

Specifically:
1. Define a parameter [fillmismatch] to allow this mismatch;
   default is to disallow.
2. If allowed, forcibly change the type of the _FillValue to match
   the parent variable.
3. If allowed Convert the values to match new type
4. Generate a log message
5. if not allowed, then fail

Implementing this required some changes to ncdap_test/dapcvt.c
Also added test cases.

Minor Unrelated Changes:
1. There were a number of warnings about e.g.
   assigning a const char* to a char*. Fix these
2. In nccopy.1, replace .NP with .IP "n"
   (re PR https://github.com/Unidata/netcdf-c/pull/1144)
3. fix minor error in ncdump/ocprint
2018-10-01 15:51:43 -06:00
Dennis Heimbigner
2ea1cf5f1b There was a request to extend the provenance information
stored in the _NCProperties attribute to allow two things:
1. capture of additional library dependencies (over and above
   hdf5)
2. Recognition of non-netcdf libraries that create netcdf-4 format
   files.

To this end, the _NCProperties format has been extended to be
and arbitrary set of key=value pairs separated by commas.
This new format has version = 2, and uses commas as the pair separator.
Thus the general form is:
    _NCProperties = "version=2,key1=value,key2=value2..." ;

This new version is accompanied by a new ./configure option of the form
    --with-ncproperties="key1=value1,key2=value2..."
that specifies pairs to add to the _NCProperties attribute for all
files created with that netcdf library.

At this point, what is missing is some programmatic way to
specify either all the pairs or additional pairs
to the _NCProperties attribute. Not sure of the best way
to do this.

Builders using non-netcdf libraries can specify
whatever they want in the key value pairs (as long
as the version=2 is specified first).

By convention, the primary library is expected to be the
the first pair after the leading version=2 pair, but this
is convention only and is neither required nor enforced.

Related changes:
1. Fixed the tests that check _NCProperties to properly operate with version=2.
2. When reading a version 1 _NCProperties attribute, convert it to look
   like a version 2 attribute.
2. Added some version 2 tests to ncdump/tst_fileinfo.c and
   ncdump/tst_fileinfo.sh

Misc Changes:
1. Fix minor problem in ncdap_test/testurl.sh where a parameter to
   buildurl needed to be quoted.
2. Minor fix to ncgen to swap switches -H and -h to be consistent
   with other utilities.
3. Document the -M flag in nccopy usage() and the nccopy man page.
4. Modify a test case to use the nccopy -M flag.
2018-08-25 21:44:41 -06:00
Dennis Heimbigner
b02703aa24 This PR primarily addresses Issue https://github.com/Unidata/netcdf-c/issues/725.
After a long discussion, I implemented the rules at the end of that issue.
They are documented in nccopy.1.

Additionally, I added a new, per-variable, -c flag that allows
for the direct setting of the chunking parameters for a variable.
The form is
    -c var:c1,c2,...ck
where var is the name of the variable (possibly a fully qualified name)
and the ci are the chunksizes for that variable. It must be the case
that the rank of the variable is k. If the new form is used as well
as the old form, then the new form overrides the old form for the
specified variable. Note that multiple occurrences of the new form
-c flag may be specified.

Misc. Other fixes
1. Added -M <size> option to nccopy to specify the minimum
   allowable chunksize.
2. Removed the unused variables from bigmeta.c
   (Issue https://github.com/Unidata/netcdf-c/issues/1079)
3. Fixed failure of nc_test4/tst_filter.sh by using the new -M
   flag (#1) to allow filter test on a small chunk size.
2018-07-26 20:16:02 -06:00
Dennis Heimbigner
d37ac215e2 Add new capabilities to filter code:
1. Allow nccopy to apply filters, especially on the output file.
   This provides a third way to do this other than using ncgen or
   programatically
2. Make sure that even if the filter code is not available, it is
   possible to see the filter id and parameters for variables using
   e.g ncdump -hs.
3. Fix bug in nccopy so that the input file does
   not necessarily have to be netcdf-4.
4. At last minute decided to change to using a
   single "_Filter" attribute for ncgen
5. Added a test to tst_filter.sh to generate C code using ncgen.
2017-05-14 18:10:02 -06:00
Bas Couwenberg
43fec3de42 Fix another hyphen-used-as-minus-sign issue in nccopy.1 man page.
Most of these issues were fixed in #101, but the patch included in the Debian
package was updated afterwards to include this remaining issue.
2015-01-25 19:20:00 +01:00
Nico Schlömer
6d2b61ddb7 hyphens used as minus signs 2015-01-16 13:12:11 +01:00
Russ Rew
4eefcd4707 Typos and consistency fixes in docs 2014-12-29 14:22:26 -07:00
Russ Rew
e157810c90 make nccopy.1 more consistent with ncgen.1 2014-12-28 21:18:37 -07:00
Russ Rew
40a7398b21 Added nccopy -kind_code documentation and deprecated -k format_number, need to do the same for ncgen 2014-12-13 19:50:21 -07:00
Russ Rew
d4ba81d6ff Documentation changes for ncdump numeric format code options 2014-12-10 10:49:37 -07:00
Ward Fisher
85e8e7e945 Addressed man page syntax warnings reported in github issue 52, https://github.com/Unidata/netcdf-c/issues/52 2014-10-03 10:46:02 -06:00
Russ Rew
dac98c89b5 Typo fixes in install doc. Document nccopy chunk threshold. 2014-03-04 15:03:49 -07:00
Russ Rew
920393b891 Update nccopy documentation for -v and -g options 2013-04-25 20:50:59 +00:00
Russ Rew
c34a4e674b - Deleted --has-szlib option for nc-config, since that is controlled
by an HDF5 configure option, not a netCDF-4 configure option.
 - Fixed bug in HDF5 strings test code.
 - Minor fixes to nccopy man page documentation.
 - Minor fixes to Fortran-90 texinfo docs, since we don't have doxygen
   docs for Fortran yet: just using "Fortran" instead of "fortran" or
   "FORTRAN".
2012-10-31 21:31:07 +00:00
Russ Rew
f638446d00 Fix typo in configure.ac. Also, if we have to have multiple copies of 2012-05-09 17:21:32 +00:00
Russ Rew
458612a06e Fix man pages for ncdump and nccopy 2012-03-08 22:16:00 +00:00
Russ Rew
f10a142411 Added and documented nccopy options to specify chunk cache. Fixed nccopy bug of not permit chunk lengths >= dimension lengths. Added experimental (undocumented) option for computing adequate chunk cache. 2011-07-12 19:06:00 +00:00
Russ Rew
62c4c5435d More documentation for nccopy -c for chunking in Users Guide and man page. 2011-02-15 23:28:12 +00:00
Russ Rew
e3cc92894b Fixes to nccopy -c, more testing and documentation. Added nccopy chunking documentation to User's guide. 2011-01-17 22:15:26 +00:00
Russ Rew
f4b8da646c Add nccopy doumentation to Users Guide. Update man pages for ncdump, nccopy. Other minor fixes to Users Guide. 2010-11-17 23:20:40 +00:00
Russ Rew
cdffbf74a9 Fixed spelling errors. 2010-11-05 22:12:14 +00:00
Russ Rew
c0f9c533f6 fix nccopy man page 2010-11-05 20:53:01 +00:00
Russ Rew
d9d6634ee8 Support k, m, or g suffixes for -m buffer size option. 2010-09-01 03:21:08 +00:00
Russ Rew
20b1e1615a Allow double NaNs and Infinities in double to double conversions. Add tests for nccopy deflation, shuffling, and dimension-fixing options. Add man-page documentation for new nccopy topions, with examples. Run tst_nccopy3.sh test even for netCDF-4 builds. 2010-08-31 22:41:00 +00:00
Russ Rew
4ce85da310 nccopy changes to support compression 2010-08-29 15:08:12 +00:00
Ed Hartnett
18f4bca367 moving to trunk subdir 2010-06-03 13:24:43 +00:00