Mercurial > forge
changeset 10542:45037f86658f octave-forge
(none)
author | abarth93 |
---|---|
date | Thu, 05 Jul 2012 13:12:20 +0000 |
parents | ae71eaf1e440 |
children | cb3fb2f9443d |
files | extra/ncArray/INDEX extra/ncArray/inst/@ncArray/ncArray.m extra/ncArray/inst/cached_decompress.m extra/ncArray/inst/ncCatArray.m extra/ncArray/inst/nccoord.m extra/ncArray/inst/test_ncarray.m |
diffstat | 6 files changed, 24 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/extra/ncArray/INDEX Wed Jul 04 15:19:39 2012 +0000 +++ b/extra/ncArray/INDEX Thu Jul 05 13:12:20 2012 +0000 @@ -1,5 +1,8 @@ ncarray >> ncArray ncArray + ncArray ncCatArray - ncArray - nccoord \ No newline at end of file + nccoord + cached_decompress +Test script + test_ncarray \ No newline at end of file
--- a/extra/ncArray/inst/@ncArray/ncArray.m Wed Jul 04 15:19:39 2012 +0000 +++ b/extra/ncArray/inst/@ncArray/ncArray.m Thu Jul 05 13:12:20 2012 +0000 @@ -1,6 +1,8 @@ -% V = ncBaseArray(filename,varname) -% V = ncBaseArray(filename,varname,'property',value,...) -% create a ncBaseArray that can be accessed as a normal matlab array. +% Create an array representing a NetCDF variable. +% +% V = ncArray(filename,varname) +% V = ncArray(filename,varname,'property',value,...) +% create a ncArray that can be accessed as a normal array. % % For read access filename can be compressed if it has the extensions % ".gz" or ".bz2". It use the function cache_decompress to cache to @@ -32,7 +34,8 @@ % % V.('_someStrangeAttribute') = 123; % -% see also cache_decompress +% see also cache_decompress, ncCatArray +% Web: http://modb.oce.ulg.ac.be/mediawiki/index.php/ncArray % hidded constructor signature: % data = ncArray(filename,varname)
--- a/extra/ncArray/inst/cached_decompress.m Wed Jul 04 15:19:39 2012 +0000 +++ b/extra/ncArray/inst/cached_decompress.m Thu Jul 05 13:12:20 2012 +0000 @@ -1,4 +1,5 @@ % Decompress a file using a cache. +% % [fname,success]=cached_decompress(filename) % % Input: @@ -12,11 +13,11 @@ function [fname]=cached_decompress(url) -global CASHED_GUNZIP_DIR -global CASHED_GUNZIP_LOG_FID +global CACHED_DECOMPRESS_DIR +global CACHED_DECOMPRESS_LOG_FID -cache_dir = CASHED_GUNZIP_DIR; +cache_dir = CACHED_DECOMPRESS_DIR; if isempty(cache_dir) % cache_dir = fullfile(getenv('HOME'),'tmp','Cache'); cache_dir = fullfile(getenv('HOME'),'tmp','Cache'); @@ -27,7 +28,7 @@ if exist(cache_dir,'dir') ~= 7 error(['cache directory for compressed files does not exist. '... 'Please create the directory %s or change le value of the '... - 'global variable CASHED_GUNZIP_DIR'],cache_dir); + 'global variable CACHED_DECOMPRESS_DIR'],cache_dir); end else fname = url; @@ -36,7 +37,7 @@ % where to print logs? default to screen -fid=CASHED_GUNZIP_LOG_FID; +fid=CACHED_DECOMPRESS_LOG_FID; if (isempty(fid)) fid=1;
--- a/extra/ncArray/inst/ncCatArray.m Wed Jul 04 15:19:39 2012 +0000 +++ b/extra/ncArray/inst/ncCatArray.m Thu Jul 05 13:12:20 2012 +0000 @@ -26,6 +26,9 @@ % shell wildcard pattern, while in Matlab rdir is used. The function rdir % is available from Matlab exchange under BSD license % (http://www.mathworks.com/matlabcentral/fileexchange/19550). +% +% see also cache_decompress, ncArray +% Web: http://modb.oce.ulg.ac.be/mediawiki/index.php/ncArray % Author: Alexander Barth (barth.alexander@gmail.com) %
--- a/extra/ncArray/inst/nccoord.m Wed Jul 04 15:19:39 2012 +0000 +++ b/extra/ncArray/inst/nccoord.m Thu Jul 05 13:12:20 2012 +0000 @@ -1,4 +1,5 @@ -% Coordinate of a NetCDF variable +% Coordinate of a NetCDF variable. +% % coord = nccoord(filename,varname) % get coordinates of the variable varname in the % netcdf file called filename. The netcdf is assumed to