cf.open_files

cf.open_files(file_format=None)[source]

Return the open files containing sub-arrays of master data arrays.

By default all such files are returned, but the selection may be restricted to files of a particular format.

Parameters:
file_format : str, optional

Only return files of the given format. Recognised formats are 'netCDF' and 'PP'. By default all files are returned.

Returns:
out: dict

If file_format is set then return a dictionary of file names of the specified format and their open file objects. If file_format is not set then return a dictionary for which each key is a file format whose value is the dictionary that would have been returned if the file_format parameter was set.

Examples:
>>> cf.open_files()
{'netCDF': {'file1.nc': <netCDF4.Dataset at 0x187b6d0>}}
>>> cf.open_files('netCDF')
{'file1.nc': <netCDF4.Dataset at 0x187b6d0>}
>>> cf.open_files('PP')
{}