-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Bug fix for relative paths 2. Added opendap functionality 3. Added ensemble hasnan and naming
- Loading branch information
Showing
25 changed files
with
456 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
function[nanMembers] = hasnan(obj, varNames) | ||
%% Indicates whether ensemble members contain NaN elements for variables | ||
% in a state vector ensemble. | ||
% | ||
% nanMembers = obj.hasnan | ||
% Returns a row vector that indicates which ensemble members contain NaN | ||
% elements. | ||
% | ||
% nanVars = obj.hasnan(varNames) | ||
% Returns a logical matrix that indicates whether specified variables have | ||
% NaN elements in ensemble members. | ||
% | ||
% nanVars = obj.hasnan([]) | ||
% Indicates whether variables have NaN elements in ensemble members for | ||
% each variable in a state vector. | ||
% | ||
% ----- Inputs ----- | ||
% | ||
% varNames: A list of variables in a state vector. A string vector or | ||
% cellstring vector. | ||
% | ||
% ----- Outputs ----- | ||
% | ||
% nanMembers: A logical row vector with one element per ensemble member. True | ||
% elements indicate that the ensemble member contains NaN elements. | ||
% | ||
% nanVars: A logical matrix with one column per ensemble member. Each row | ||
% indicates whether a particular variable has NaN elements in each | ||
% ensemble member. | ||
|
||
% If no inputs, return summary for all variables | ||
if ~exist('varNames','var') | ||
nanMembers = any(obj.has_nan,1); | ||
return; | ||
end | ||
|
||
% Otherwise, return for specified variables | ||
allVars = obj.metadata.variableNames; | ||
if isempty(varNames) | ||
v = 1:numel(allVars); | ||
else | ||
v = dash.checkStrsInList(varNames, allVars, 'varNames', 'variable in the state vector'); | ||
end | ||
nanMembers = obj.has_nan(v,:); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
function[obj] = rename(obj, newName) | ||
%% Renames an ensemble object | ||
% | ||
% obj = obj.rename(newName) | ||
% | ||
% ----- Inputs ----- | ||
% | ||
% newName: The new name for the ensemble object. A string. | ||
% | ||
% ----- Outputs ----- | ||
% | ||
% obj: The updated ensemble object | ||
|
||
% Update name (error checking via ensembleMetadata) | ||
obj.metadata = obj.metadata.rename(name); | ||
obj.name = dash.assertStrFlag(newName, 'newName'); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function[obj] = rename(obj, newName) | ||
%% Changes the identifying ensemble name for the ensembleMetadata object. | ||
% | ||
% obj = obj.rename(newName) | ||
% | ||
% ----- Inputs ----- | ||
% | ||
% newName: The new identifying name for the ensemble. A string. | ||
% | ||
% ----- Outputs ----- | ||
% | ||
% obj: The updated ensembleMetadata object. | ||
|
||
obj.name = dash.assertStrFlag(newName, 'newName'); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.