pmlmodelling/nctoolkit: v 0.4.0
Description
This is a major release that features some breaking changes.
Methods for adding, subtracting, multipling and dividing datasets from each other will be enhanced. Until now these methods used a simplistic approach where values from matching time steps were added to each other, etc. So if you are subtracting a 12 time step file from a dataset, only the first 12 time steps were subtracted from. However, often this is not what you want. For example, you might want to subtract data from a file which contains montly values for each year.
This version of nctoolkit updates these methods so that it can automatically figure out, in most cases, what kind of addition etc. it should carry out. For example, if you have a dataset which has monthly values for each year from 1950 to 1999, and use subtract
to subtract the values from a file which contains annual means for each year from 1950, it will subtract the annual mean for 1950 from each month in 1950 and the the annual mean for 1951 from each month in 1951, and so on.
Users are now able to specify the numeric precision of datasets using ds.set_precision
. By default, nctoolkit uses the underlying netCDF files's data type. This is normally not a problem. However, when the data type is integer, this can cause problems. nc.open_data
has been updated with this issue in mind. It will now warn users when the data type of the netCDF is integer, and it will suggest switching to float 'F64' or 'F32'.
The drop
method has been enhanced. It now accepts day, month and year as arguments to enable dropping specific time periods. For example ds.drop(month = 2, day = 29)
will remove leap days. Code written to use the old drop
method will now fail, as keywords are now required.
The method surface
has now been renamed top
for consistency with bottom
. surface
is deprecated and will be removed in a few months.
The split
method now allows users to split datasets into multiple files by variable.
ds.times
now returns a datetime object, not a str as before.
Files
pmlmodelling/nctoolkit-v0.4.0.zip
Files
(236.9 MB)
Name | Size | Download all |
---|---|---|
md5:c9290a316792df167741f37913d484df
|
236.9 MB | Preview Download |
Additional details
Related works
- Is supplement to
- https://github.com/pmlmodelling/nctoolkit/tree/v0.4.0 (URL)