-
Notifications
You must be signed in to change notification settings - Fork 6
Methods Overview
The RdtClient object implements methods for changing into remote directories, listing the artifacts in those directories, downloading from the artifacts. We describe the methods here.
rd.crp('/resources/scenes')
Note the initial slash. Describe the directory notion
rd.pwrp
ans =
resources/scenes
(seems to list them all, wherever the current path is)
p = rd.listRemotePaths;
p{1}
ans =
resources/data/cones
The RemoteDataToolbox refers to files as 'artifacts.' Files with the same base file name are typically stored together. Thus, there might be a Matlab file (scene1.mat) and a jpg file (scene1.jpg). They are counted as part of the same artifact (scene1). Furthermore, there might be several versions of scene1 ('version' is a string).
We query for a list of the artifacts in the current remote path using rd.listArtifacts(parameter,value, ...)
. Here is an example on the ISETBIO repository.
rd.crp('/resources/scenes/hyperspectral/stanford_database/landscape');
a = rd.listArtifacts('printID',true);
Artifact ID Name
#1: SanFranciscoPFilter
#2: SanFranciscoPFilter
#3: StanfordDishPFilter
#4: StanfordDishPFilter
#5: StanfordMemorial
#6: StanfordMemorial
#7: StanfordTowerPFilter
#8: StanfordTowerPFilter
Notice that 8 artifacts are returned, but the names are repeated. This is because there is both a 'mat' and 'jpg' file for each artifact. To return only the 'jpg' files, use the parameter/value pair
a = rd.listArtifacts(''type','jpg','printID',true);
Artifact ID Name
#1: SanFranciscoPFilter
#2: StanfordDishPFilter
#3: StanfordMemorial
#4: StanfordTowerPFilter
In each of these examples, I set 'printID' to true in order to generate the printed output. But if you just want the list, do not set that parameter.
- 'artifactId',string - This is the base name of the file, and it will return all file types.
- 'remotePath',string - Uses the current remote path (rd.crp); if empty, iterates over all remote paths and returns a cell array.
- 'type', string - The file type
- 'sortField', logical - The returned artifacts can be sorted by different fields. The default is the artifactId. But you can also sort by 'type' or other fields
- 'printID', logical - Print an ordered list to the command line
- 'version', string - Select these versions
- 'pageSize', int - Return no more than this many
rp = '/resources/scenes/hyperspectral/stanford_database';
a = rd.listArtifacts('remotePath',rp,'type','mat');
fprintf('%d artifacts are returned',length(a));
a(10)
This shows that we can set the remote path and then do the search without specifying the parameter/value. The same result is returned.
rd.crp(rp);
a = rd.listArtifacts('type','mat');
fprintf('%d artifacts are returned',length(a));
a(10)
Finally, let's look for jpg files instead of mat files
rd.crp(rp);
a = rd.listArtifacts('type','jpg');
fprintf('%d artifacts are returned',length(a));
a(10)
See rdtDeleteArtifacts and related in the api/artifacts folder. I am not sure these are properly exposed in the RdtClient, but I haven't checked carefully enough.
'whichURLorArtifact' - brings you to the artifact you request 'fancy' - Use the fancy browser facility on the site. But we just take you to the site root, not a specific artifact
Print object parameters to the command window