cf.NetCDFArray.add_file_location

NetCDFArray.add_file_location(location)[source]

Add a new file location.

All existing files are additionally referenced from the given location.

New in version 3.15.0.

Parameters
location: str

The new location.

Returns
NetCDFArray

A new NetCDFArray with all previous files additionally referenced from location.

Examples

>>> a.get_filenames()
('/data1/file1',)
>>> a.get_addresses()
('tas',)
>>> b = a.add_file_location('/home')
>>> b.get_filenames()
('/data1/file1', '/home/file1')
>>> b.get_addresses()
('tas', 'tas')
>>> a.get_filenames()
('/data1/file1', '/data2/file2',)
>>> a.get_addresses()
('tas', 'tas')
>>> b = a.add_file_location('/home/')
>>> b = get_filenames()
('/data1/file1', '/data2/file2', '/home/file1', '/home/file2')
>>> b.get_addresses()
('tas', 'tas', 'tas', 'tas')
>>> a.get_filenames()
('/data1/file1', '/data2/file1',)
>>> a.get_addresses()
('tas1', 'tas2')
>>> b = a.add_file_location('/home/')
>>> b.get_filenames()
('/data1/file1', '/data2/file1', '/home/file1')
>>> b.get_addresses()
('tas1', 'tas2', 'tas1')
>>> a.get_filenames()
('/data1/file1', '/data2/file1',)
>>> a.get_addresses()
('tas1', 'tas2')
>>> b = a.add_file_location('/data1')
>>> b.get_filenames()
('/data1/file1', '/data2/file1')
>>> b.get_addresses()
('tas1', 'tas2')