Close an arbitrary open file containing a sub-array of a master data array.
By default a file of arbitrary format is closed, but the choice may be restricted to files of a particular format.
Note that the closed file will be automatically reopened if subsequently needed by a variable to access the sub-array.
If there are no appropriate open files then no action is taken.
Parameters : |
|
---|---|
Returns : | None |
Examples
>>> cf.close_one_file()
>>> cf.close_one_file('netCDF')
>>> cf.close_one_file('PP')
>>> cf.open_files()
{'netCDF': {'file1.nc': <netCDF4.Dataset at 0x181bcd0>,
'file2.nc': <netCDF4.Dataset at 0x1e42350>,
'file3.nc': <netCDF4.Dataset at 0x1d185e9>}}
>>> cf.close_one_file()
>>> cf.open_files()
{'netCDF': {'file1.nc': <netCDF4.Dataset at 0x181bcd0>,
'file3.nc': <netCDF4.Dataset at 0x1d185e9>}}