Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Pau Beltran committed Jun 6, 2016
2 parents 1cc81fc + 31e3f35 commit 41cf8e4
Show file tree
Hide file tree
Showing 126 changed files with 7,581 additions and 2,363 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ The following features are already implemented in the glider toolbox:
- Support for different glider models:
- Slocum G1 and G2
- Seaglider
- SeaExplorer
- Deployment metadata gathering from virtually any database.
- File retrieval from multiple dockservers/basestations for real time processing.
- Improved Slocum raw data loading from ascii files (`.dba`).
- Improved Seaglider raw data loading from ascii files (`.log` and `.eng`).
- SeaExplorer raw data loading from ascii files (`.gli` and `.pld`).
- Data processing, including:
- unit conversions
- factory calibrations
Expand All @@ -41,7 +43,7 @@ The following features are already implemented in the glider toolbox:
- parameters for data gridding
- customizable standard NetCDF product and figure outputs

The following features are planned:
The following features are planned or in development:

- automatic quality control of processed data.

Expand Down Expand Up @@ -87,10 +89,12 @@ developed to automatically process the data from a glider fleet is not needed:

- Slocum data file API:
[`dba2mat`][dba2mat], [`dbacat`][dbacat], and [`dbamerge`][dbamerge]
- Seaglider data file API:
[`sglog2mat`][sglog2mat], [`sglogcat`][sglogcat],
[`sgeng2mat`][sgeng2mat], [`sgengcat`][sgengcat],
- Seaglider data file API:
[`sglog2mat`][sglog2mat], [`sglogcat`][sglogcat],
[`sgeng2mat`][sgeng2mat], [`sgengcat`][sgengcat],
and [`sglogenmerge`][sglogengmerge]
- SeaExplorer data file API:
[`sx2mat`][sx2mat], [`sxcat`][sxcat], and [`sxmerge`][sxmerge]
- More convenient [NetCDF interface][netcdf_dsl]:
[`loadnc`][loadnc] and [`savenc`][savenc]
- RFC-compliant [JSON interface][json_rfc]:
Expand All @@ -111,6 +115,9 @@ developed to automatically process the data from a glider fleet is not needed:
[sgeng2mat]: http://www.socib.es/users/glider/glider_toolbox/doc/m/reading_tools/sgeng2mat
[sgengcat]: http://www.socib.es/users/glider/glider_toolbox/doc/m/reading_tools/sgengcat
[sglogengmerge]: http://www.socib.es/users/glider/glider_toolbox/doc/m/reading_tools/sglogengmerge
[sx2mat]: http://www.socib.es/users/glider/glider_toolbox/doc/m/reading_tools/sx2mat
[sxcat]: http://www.socib.es/users/glider/glider_toolbox/doc/m/reading_tools/sxcat
[sxmerge]: http://www.socib.es/users/glider/glider_toolbox/doc/m/reading_tools/sxmerge
[netcdf_dsl]: http://repository.socib.es/repository/entry/show/Top/Public+Staff/jbeltran/Octave+and+MATLAB/Octave+and+MATLAB+notes#Load%20and%20save%20data%20in%20NetCDF%20format
[loadnc]: http://www.socib.es/users/glider/glider_toolbox/doc/m/common_tools/loadnc
[savenc]: http://www.socib.es/users/glider/glider_toolbox/doc/m/common_tools/savenc
Expand Down Expand Up @@ -154,7 +161,7 @@ and [SOCIB][socib] by Tomeu Garau. He is the true glider man.
Copyright
---------

Copyright (C) 2013-2015
Copyright (C) 2013-2016
ICTS SOCIB - Servei d'observació i predicció costaner de les Illes Balears
<http://www.socib.es>

Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/cd.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/close.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function close(h)
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/delete.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function delete(h, filename)
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/dir.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/mget.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/mkdir.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function mkdir(h, dirname)
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/mput.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/private/mexsftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @brief Mex interface to libssh for sftp connection.
* @author Joan Pau Beltran <joanpau.beltran@socib.cat>
*
* Copyright (C) 2014-2015
* Copyright (C) 2014-2016
* ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears.
* <http://www.socib.es>
*
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/private/mexsftp.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/rename.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function rename(h, oldname, newname)
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/rmdir.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function rmdir(h, dirname)
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/@sftp/sftp.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/getfiles.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/loadjson.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/loadnc.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/posixtime2utc.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/printfigure.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/savejson.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
38 changes: 32 additions & 6 deletions m/common_tools/savenc.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function savenc(var_data, var_meta, global_meta, filename)
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down Expand Up @@ -127,7 +127,11 @@ function savenc(var_data, var_meta, global_meta, filename)
% Set dimensions.
if isfield(global_meta, 'dimensions')
for global_dim = global_meta.dimensions(:)'
nc(global_dim.name) = global_dim.length;
if isfield(global_dim, 'unlimited') && (global_dim.unlimited)
nc(global_dim.name) = 0;
else
nc(global_dim.name) = global_dim.length;
end
end
end
% Set variable dimensions and attributes, and variable data.
Expand Down Expand Up @@ -157,6 +161,14 @@ function savenc(var_data, var_meta, global_meta, filename)
nc{var_name}.(var_att.name) = var_att.value;
end
end
end
for var_idx = 1:numel(field_name_list)
field_name = field_name_list{var_idx};
if isfield(var_meta.(field_name), 'name')
var_name = var_meta.(field_name).name;
else
var_name = field_name;
end
% Set the variable data with fill value and scale handling enabled.
% Give the range for record dimensions.
nc_var = nc{var_name};
Expand All @@ -179,13 +191,19 @@ function savenc(var_data, var_meta, global_meta, filename)
try
% Set global attributes.
if isfield(global_meta, 'attributes')
arrayfun(@(a) nc_attput(filename, nc_global, a.name, a.value), ...
global_meta.attributes);
for global_att = global_meta.attributes(:)'
nc_attput(filename, nc_global, global_att.name, global_att.value);
end
end
% Set dimensions.
if isfield(global_meta, 'dimensions')
arrayfun(@(d) nc_adddim(filename, d.name, d.length), ...
global_meta.dimensions);
for global_dim = global_meta.dimensions(:)'
if isfield(global_dim, 'unlimited') && (global_dim.unlimited)
nc_adddim(filename, global_dim.name, 0);
else
nc_adddim(filename, global_dim.name, global_dim.length);
end
end
end
% Set variable dimensions and attributes, and variable data.
field_name_list = intersect(fieldnames(var_data), fieldnames(var_meta));
Expand Down Expand Up @@ -217,6 +235,14 @@ function savenc(var_data, var_meta, global_meta, filename)
'Value', {var_meta.(field_name).attributes.value});
end
nc_addvar(filename, nc_var);
end
for var_idx = 1:numel(field_name_list)
field_name = field_name_list{var_idx};
if isfield(var_meta.(field_name), 'name')
var_name = var_meta.(field_name).name;
else
var_name = field_name;
end
nc_varput(filename, var_name, var_data.(field_name))
end
catch exception
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/strc.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/strfstruct.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/common_tools/utc2posixtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
2 changes: 1 addition & 1 deletion m/configBasestations.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2014-2015
% Copyright (C) 2014-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down
4 changes: 2 additions & 2 deletions m/configDBAccess.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand All @@ -42,7 +42,7 @@

error(nargchk(0, 0, nargin, 'struct'));

db_access.url = 'jdbc:postgresql://mydb.myportal.mydomain:5433/my_data_base';
db_access.server = 'jdbc:postgresql://mydb.myportal.mydomain:5433/my_data_base';
db_access.name = 'my_data_base';
db_access.user = 'myself';
db_access.pass = 'top_secret';
Expand Down
14 changes: 8 additions & 6 deletions m/configDTDeploymentInfoQueryDB.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
% Authors:
% Joan Pau Beltran <joanpau.beltran@socib.cat>

% Copyright (C) 2013-2015
% Copyright (C) 2013-2016
% ICTS SOCIB - Servei d'observacio i prediccio costaner de les Illes Balears
% <http://www.socib.es>
%
Expand Down Expand Up @@ -61,12 +61,14 @@
};

deployment_fields = fields_map(:,1)';
db_fields = fields_map(:,2)';
database_fields = fields_map(:,2)';

% Build the query.
db_fields_str = [sprintf('%s, ', db_fields{1:end-1}) db_fields{end}];

sql_query = ['select ' db_fields_str ...
deployment_ids_str = ...
[sprintf('%s, ', deployment_ids{1:end-1}) deployment_ids{end}];
database_fields_str = ...
[sprintf('%s, ', database_fields{1:end-1}) database_fields{end}];
sql_query = ['select ' database_fields_str ...
' from instrumentation.deployment' ...
' inner join instrumentation.instrument' ...
' on (deployment_instrument_id=instrument_id)' ...
Expand All @@ -78,6 +80,6 @@
' on (instrument_platform_platform_id = platform_id)' ...
' inner join instrumentation.institution' ...
' on (deployment_institution_id=institution_id)' ...
' where (deployment_id in (' deployment_ids '));'];
' where (deployment_id in (' deployment_ids_str '));'];

end
Loading

0 comments on commit 41cf8e4

Please sign in to comment.