gridfile.relocate

Update paths to data sources catalogued in a gridfile


Syntax



Description

obj.relocate

Checks every data source file in the .grid file to make sure it still exists. If a data source cannot be found, the method searches the active path for files with the same name and extension. If a file with the same name is found, checks that the new file contains a data matrix with the same size and data type as the recorded data source. If so, stores the new file location for the data source. If a data source cannot be found and these criteria are not met, throws an error reporting the missing data source.

Note: This method only checks the existence of data sources located on a file system drive. Data sources accessed via an OPENDAP url are not checked.

obj.relocate(s)
obj.relocate(sourceNames)

Specify which data sources should be checked and renamed. Any specified data sources accessed via an OPENDAP url are not checked.

obj.relocate(…, newNames)

Specify the new names to use for the data sources. Use this syntax when the file name or extension of a data source file has changed. This syntax also allows data sources accessed via an OPENDAP url to be relocated (either to a different OPENDAP url, or a local data file).


Input Arguments

s

logical vector [nSources] | vector, linear indices
The indices of the data sources that should be checked and/or renamed.

sourceNames

string vector
The names of the data sources that should be checked and/or renamed.

newNames

string vector [nRename]
The new file paths/names for the specified sources. Should have one element per specified data source.