Skip to content

Commit

Permalink
Put name on everything in prep for v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JonKing93 committed Jan 24, 2019
1 parent 739f29f commit 740a4ea
Show file tree
Hide file tree
Showing 78 changed files with 521 additions and 128 deletions.
2 changes: 1 addition & 1 deletion 1. File IO/User Operations/buildMetadata.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
% ----- Outputs -----
%
% meta: The metadata structure used by dash.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019
%
Expand Down
2 changes: 1 addition & 1 deletion 1. File IO/User Operations/deleteGridfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
% meta: A metadata structure built for Dash. Metadata at the indices for
% deletion are compared to this structure. If the metadata do not
% match, the deletion is aborted.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 1. File IO/User Operations/extendGridfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
% meta: A vector containing metadata for the new indices along the
% extended dimension. (NOT a metadata structure) If STRIDE > 1, must
% include metadata for extended indices at which data is not written.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 1. File IO/User Operations/fillGridfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
% meta: A metadata structure built for dash. Metadata at the fill
% indices are compared to this structure. If the metadata do not
% match, the fill is aborted.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
3 changes: 1 addition & 2 deletions 1. File IO/User Operations/indexGridfile.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
%% This adds new data to indices.
function[] = indexGridfile( file, gridData, gridDims, loc, meta )
%% Writes data to specified exisiting indices in a gridded .mat file.
%
Expand Down Expand Up @@ -28,7 +27,7 @@
% meta: A metadata structure built for dash. Metadata at the write indices
% are compared to this structure. If the metadata do not match, the
% write is aborted.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 1. File IO/User Operations/metaGridfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
% dimID: The order of the dimensions of the saved gridded data.
%
% gridSize: The size of the gridded data.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 1. File IO/User Operations/newGridfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
%
% meta: A metadata structure for the gridded data. See the buildMetadata.m
% function.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
3 changes: 3 additions & 0 deletions 1. File IO/Utilities/compareMetadata.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
%
% ic: A cell of indices specifying metadata indices in m.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Get the existing metadata
oldMeta = m.meta;
dimID = m.dimID;
Expand Down
3 changes: 3 additions & 0 deletions 1. File IO/Utilities/fileCheck.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
%
% m: A matfile object for a gridded .mat file.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Check that the file is a .mat file
if isstring(file)
file = char(file);
Expand Down
3 changes: 3 additions & 0 deletions 1. File IO/Utilities/fullSize.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
%
% siz: The size of the array.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Get the size
siz = size(X);
nDim = numel(siz);
Expand Down
3 changes: 3 additions & 0 deletions 1. File IO/Utilities/getIndexCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
%
% nAdd: The number of new indices added in each dimension.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Get the size of the existing data
sData = size( m.gridData );
nDim = numel(sData);
Expand Down
3 changes: 3 additions & 0 deletions 1. File IO/Utilities/getPermutation.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
%
% permDex: The permutation index.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Check that the values are all recognized
allVals = [X(:);Y(:)];
for d = 1:numel(allVals)
Expand Down
3 changes: 3 additions & 0 deletions 1. File IO/Utilities/permuteInputs.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
%
% dimLoc: Permuted indexing locations.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Get the permutation ordering
permDex = getPermutation( gridDims, m.dimID, getKnownIDs );

Expand Down
2 changes: 1 addition & 1 deletion 2. Design State Vector/User Operations/addVariable.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
% ----- Outputs -----
%
% design: The updated state vector design.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 2. Design State Vector/User Operations/coupleVariables.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
% ----- Outputs -----
%
% design: The updated state vector design.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 2. Design State Vector/User Operations/deleteVariable.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
% ----- Outputs -----
%
% design: The updated state vector design.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
14 changes: 14 additions & 0 deletions 2. Design State Vector/User Operations/dispDesign.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
% dispDesign( d, var, dim, longform )
% Specifies whether to display all metadata values in the state or ensemble
% indices of a specific dimension of a variable in a state vector design.
%
% ----- Inputs -----
%
% d: A state vector design
%
% var: The name of a variable in the design
%
% dim: The name of a dimension in the variable
%
% longform: A scalar logical. If true, displays all dimension metadata at
% the state or ensemble indices.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Check the design is a design
if ~isa(d, 'stateDesign')
Expand Down
4 changes: 4 additions & 0 deletions 2. Design State Vector/User Operations/editDesign.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
% overlap: A scalar logical indicating whether to allow non-duplicate,
% overlapping sequences in the ensemble.
%
% ----- Outputs -----
%
% design: The updated state vector design.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 2. Design State Vector/User Operations/syncVariables.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
% ----- Outputs -----
%
% design: The updated state vector design
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 2. Design State Vector/User Operations/uncoupleVariables.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
% ----- Outputs -----
%
% design: The updated state vector design.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
2 changes: 1 addition & 1 deletion 2. Design State Vector/User Operations/unsyncVariables.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
% ----- Outputs -----
%
% design: The updated state vector design.
%

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

Expand Down
15 changes: 15 additions & 0 deletions 2. Design State Vector/Utilities/Dimension Indices/ensDimension.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
function[design] = ensDimension( design, var, dim, varargin )
%% Edits an ensemble dimension.
%
% See editDesign for use.
%
% ----- Inputs -----
%
% design: the state vector design
%
% var: Variable name
%
% dim: Dimension name
%
% flags: 'index','seq','mean','nanflag','meta','overlap'

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Parse inputs
[index, seq, mean, nanflag, ensMeta, overlap] = parseInputs( varargin, ...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
function[index, ix] = getMatchingMetaDex( var, dim, meta, isState )
%% This gets indices of a dimensions of a specific variables that match a
% metadata template.
%
% [index, ix] = getMatchingMetaDex( var, dim, meta, isState )
% Returns indices that match a metadata template.
%
% ----- Inputs -----
%
% var: A varDesign
%
% dim: Dimension name
%
% meta: Metadata template for the dimension.
%
% isState: Scalar logical. True if for state dimensions, false for ens.
%
% ----- Outputs -----
%
% index: The indices in the variable that match the metadata
%
% ix: The indices in the template that the variable matches.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Get the metadata for the variable in the dimension
dimMeta = var.meta.(dim);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
function[design] = stateDimension( design, var, dim, varargin )
%% Edits a state dimension.
%
% See editDesign for use.
%
% ----- Inputs -----
% design: state vector design
%
% var: Variable name
%
% dim: Dimension name
%
% flags: 'index','mean','nanflag'

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Parse the inputs
[index, takeMean, nanflag] = parseInputs( varargin, {'index','mean','nanflag'}, {[],[],[]}, {[],[],{'omitnan','includenan'}} );
Expand Down
15 changes: 15 additions & 0 deletions 2. Design State Vector/Utilities/Display/dispDimension.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
function[] = dispDimension(var, d, long)
%% Displays the design of a dimension in a variable in a state vector design.
%
% dispDimension( var, d, long )
%
% ----- Inputs -----
%
% var: A varDesign
%
% d: The index of the dimension in the varDesign
%
% long: Logical scalar indicating whether to display indexed metadata. True
% to display, false (default) to not display.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Dimension name
fprintf('\t\t\t%s\n', var.dimID{d});
Expand Down
37 changes: 27 additions & 10 deletions 2. Design State Vector/Utilities/Display/dispVariable.m
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
function[] = dispVariable( d, v, dim, longform )
function[] = dispVariable( design, v, dim, longform )
%% Displays a variable in a state vector design.
%
% dispVariable( design, v, dim, longform )
%
% ----- Inputs -----
%
% design: A state vector design
%
% v: The index of a variable in the design.
%
% dim: The name of a dimension to display or 'all' to display all
% dimensions.
%
% long: Logical scalar for whether to display indexed dimensional metadata.

% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Get the variables
if strcmp(dim,'all')
dim = 1:numel(d.var(v).dimID);
dim = 1:numel(design.var(v).dimID);
end

% Variable name
fprintf('\t%s\n', d.var(v).name );
fprintf('\t%s\n', design.var(v).name );

% Reference file
fprintf( '\t\tGridfile: %s\n', d.var(v).file );
fprintf( '\t\tGridfile: %s\n', design.var(v).file );

% Coupled Varialbes
if any( d.isCoupled(v,:) )
if any( design.isCoupled(v,:) )
fprintf( '\t\tCoupled Variables: ' );
disp( d.varName( d.isCoupled(v,:) ) );
disp( design.varName( design.isCoupled(v,:) ) );
fprintf('\b');
end

% Synced Variables
if any(d.isSynced(v,:))
if any(design.isSynced(v,:))
fprintf('\t\tSynced Variables:\n');
disp( d.varName( d.isSynced(v,:) ) );
disp( design.varName( design.isSynced(v,:) ) );
fprintf('\b');
end

% Overlap
if d.var(v).overlap
if design.var(v).overlap
overStr = 'Allowed';
else
overStr = 'Forbidden';
Expand All @@ -38,7 +55,7 @@

% Display the dimensions
for k = 1:numel(dim)
dispDimension( d.var(v), dim(k), longform );
dispDimension( design.var(v), dim(k), longform );
end

end
5 changes: 4 additions & 1 deletion 2. Design State Vector/Utilities/General/checkDesignVar.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
function[varDex] = checkDesignVar( design, var )
%% Ensures a design contains the vars
%
% varDex: The variable indices
% var: Variable name
%
% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Check there is a variable design
if ~isa( design, 'stateDesign') || ~isscalar(design)
Expand Down
7 changes: 7 additions & 0 deletions 2. Design State Vector/Utilities/General/checkIndices.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
function[] = checkIndices(var, d, index)
%% Low level error checking for indices for a dimension.
%
% var: varDesign
%
% d: Dimension index
%
% ----- Written By -----
% Jonathan King, University of Arizona, 2019

% Get the size of the data
dimSize = var.dimSize(d);
Expand Down
Loading

0 comments on commit 740a4ea

Please sign in to comment.