Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TSG QC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
US191
TSG QC
Commits
c5d639c1
Commit
c5d639c1
authored
17 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
utilise la derniere version du fichier netcdf (1.4 maj)
parent
69e453bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tsg_util/tsg_readTsgDataNetCDF.m
+125
-97
125 additions, 97 deletions
tsg_util/tsg_readTsgDataNetCDF.m
with
125 additions
and
97 deletions
tsg_util/tsg_readTsgDataNetCDF.m
+
125
−
97
View file @
c5d639c1
...
...
@@ -15,131 +15,159 @@ function [error] = tsg_readTsgDataNetCDF( hTsgGUI, filename)
%
% $Id$
% Get the data from the application GUI
% -------------------------------------
tsg
=
getappdata
(
hTsgGUI
,
'tsg_data'
);
% Open netCDF file
% -------------
nc1
=
netcdf
(
filename
,
'read'
);
msg_error
=
'ok'
;
if
isempty
(
nc1
)
msg_error
=
[
'TSG_GOSUD file_lecture : Open file error : '
filename
];
% ----------------
nc
=
netcdf
(
filename
,
'read'
);
if
isempty
(
nc
)
msg_error
=
[
'TSG_GOSUD file_lecture : Open file error : '
filename
];
warndlg
(
msg_error
,
'NetCDF error dialog'
);
error
=
-
1
;
end
% Read global attributes: meta data
% ----------------------------------
tsg
.
PLATFORM_NAME
=
nc1
.
PLATFORM_NAME
(:);
tsg
.
PLATFORM_WMO_NUMBER
=
nc1
.
PLATFORM_WMO_NUMBER
(:);
tsg
.
PLATFORM_MMSI_NUMBER
=
nc1
.
PLATFORM_MMSI_NUMBER
(:);
tsg
.
TSG_TYPE
=
nc1
.
TSG_TYPE
(:);
tsg
.
TSG_NUMBER
=
nc1
.
TSG_NUMBER
(:);
tsg
.
TINT_TYPE
=
nc1
.
TINT_TYPE
(:);
tsg
.
TINT_NUMBER
=
nc1
.
TINT_NUMBER
(:);
tsg
.
DATA_TYPE
=
nc1
.
DATA_TYPE
(:);
tsg
.
DATA_MODE
=
nc1
.
DATA_MODE
(:);
tsg
.
SAMPLING_PERIOD
=
nc1
.
SAMPLING_PERIOD
(:);
tsg
.
PROCESSING_STATUS
=
nc1
.
PROCESSING_STATUS
(:);
tsg
.
DATE_START
=
nc1
.
DATE_START
(:);
tsg
.
DATE_END
=
nc1
.
DATE_END
(:);
tsg
.
SOUTH_LATITUDE
=
nc1
.
SOUTH_LATITUDE
;
tsg
.
NORTH_LATITUDE
=
nc1
.
NORTH_LATITUDE
;
tsg
.
WEST_LONGITUDE
=
nc1
.
WEST_LONGITUDE
;
tsg
.
EAST_LONGITUDE
=
nc1
.
EAST_LONGITUDE
;
tsg
.
FORMAT_VERSION
=
nc1
.
FORMAT_VERSION
(:);
tsg
.
DATE_CREATION
=
nc1
.
DATE_CREATION
(:);
tsg
.
DATE_UPDATE
=
nc1
.
DATE_UPDATE
(:);
tsg
.
DATA_RESTRICTIONS
=
nc1
.
DATA_RESTRICTIONS
(:);
tsg
.
CITATION
=
nc1
.
CITATION
(:);
tsg
.
COMMENT
=
nc1
.
COMMENT
(:);
tsg
.
PROJECT_NAME
=
nc1
.
PROJECT_NAME
(:);
tsg
.
PI_NAME
=
nc1
.
PI_NAME
(:);
tsg
.
DATA_CENTRE
=
nc1
.
DATA_CENTRE
(:);
tsg
.
PLATFORM_NAME
=
nc
.
PLATFORM_NAME
(:);
tsg
.
SHIP_CALL_SIGN
=
nc
.
SHIP_CALL_SIGN
(:);
tsg
.
SHIP_MMSI
=
nc
.
SHIP_MMSI
(:);
tsg
.
TSG_TYPE
=
nc
.
TSG_TYPE
(:);
tsg
.
TSG_NUMBER
=
nc
.
TSG_NUMBER
(:);
tsg
.
TINT_TYPE
=
nc
.
TINT_TYPE
(:);
tsg
.
TINT_NUMBER
=
nc
.
TINT_NUMBER
(:);
tsg
.
DATA_TYPE
=
nc
.
DATA_TYPE
(:);
tsg
.
DATA_MODE
=
nc
.
DATA_MODE
(:);
tsg
.
SAMPLING_PERIOD
=
nc
.
SAMPLING_PERIOD
(:);
tsg
.
PROCESSING_STATUS
=
nc
.
PROCESSING_STATUS
(:);
tsg
.
DATE_START
=
nc
.
DATE_START
(:);
tsg
.
DATE_END
=
nc
.
DATE_END
(:);
tsg
.
SOUTH_LATX
=
nc
.
SOUTH_LATX
(:);
tsg
.
NORTH_LATX
=
nc
.
NORTH_LATX
(:);
tsg
.
WEST_LONX
=
nc
.
WEST_LONX
(:);
tsg
.
EAST_LONX
=
nc
.
EAST_LONX
(:);
tsg
.
FORMAT_VERSION
=
nc
.
FORMAT_VERSION
(:);
tsg
.
DATE_CREATION
=
nc
.
DATE_CREATION
(:);
tsg
.
DATE_UPDATE
=
nc
.
DATE_UPDATE
(:);
tsg
.
DATA_RESTRICTIONS
=
nc
.
DATA_RESTRICTIONS
(:);
tsg
.
CITATION
=
nc
.
CITATION
(:);
tsg
.
COMMENT
=
nc
.
COMMENT
(:);
tsg
.
PROJECT_NAME
=
nc
.
PROJECT_NAME
(:);
tsg
.
PI_NAME
=
nc
.
PI_NAME
(:);
tsg
.
DATA_CENTRE
=
nc
.
DATA_CENTRE
(:);
tsg
.
DATA_ACQUISITION
=
nc
.
DATA_ACQUISITION
(:);
tsg
.
PROCESSING_CENTRE
=
nc
.
PROCESSING_CENTRE
(:);
tsg
.
PROCESSING_STATE
=
nc
.
PROCESSING_STATE
(:);
% read variables describing TSG installation
% ------------------------------------------
tsg
.
DEPTH_TSG
=
nc
1
{
'
DEPTH_TSG
'
}(:);
tsg
.
DEPTH_TSG
_MIN
=
nc
1
{
'
DEPTH_TSG
_MIN'
}(:);
tsg
.
DEPTH_TSG
_MAX
=
nc
1
{
'
DEPTH_TSG
_MAX'
}(:);
tsg
.
CNDC_
TSG_
CALCOEF
=
nc
1
{
'CNDC_
TSG_
CALCOEF'
}(:);
tsg
.
CNDC_
TSG_
LINCOEF
=
nc
1
{
'CNDC_
TSG_
LINCOEF'
}(:);
tsg
.
TEMP_TSG
_CALCOEF
=
nc
1
{
'
TEMP_TSG
_CALCOEF'
}(:);
tsg
.
TEMP_TSG
_LINCOEF
=
nc
1
{
'
TEMP_TSG
_LINCOEF'
}(:);
tsg
.
SSJT_DEPH
=
nc
{
'
SSJT_DEPH
'
}(:);
tsg
.
SSJT_DEPH
_MIN
=
nc
{
'
SSJT_DEPH
_MIN'
}(:);
tsg
.
SSJT_DEPH
_MAX
=
nc
{
'
SSJT_DEPH
_MAX'
}(:);
tsg
.
CNDC_CALCOEF
=
nc
{
'CNDC_CALCOEF'
}(:);
tsg
.
CNDC_LINCOEF
=
nc
{
'CNDC_LINCOEF'
}(:);
tsg
.
SSJT
_CALCOEF
=
nc
{
'
SSJT
_CALCOEF'
}(:);
tsg
.
SSJT
_LINCOEF
=
nc
{
'
SSJT
_LINCOEF'
}(:);
% read variables describing Temperature sensor at intake (TINT) installation
% --------------------------------------------------------------------------
tsg
.
DEPTH_TINT
=
nc
1
{
'
DEPTH_TINT
'
}(:);
tsg
.
DEP
T
H_
TINT_
MIN
=
nc
1
{
'
DEPTH_TINT
_MIN'
}(:);
tsg
.
DEP
T
H_
TINT_
MAX
=
nc
1
{
'
DEPTH_TINT
_MAX'
}(:);
tsg
.
TEMP_TINT
_CALCOEF
=
nc
1
{
'
TEMP_TINT
_CALCOEF'
}(:);
tsg
.
TEMP_TINT
_LINCOEF
=
nc
1
{
'
TEMP_TINT
_LINCOEF'
}(:);
tsg
.
SSTP_DEPH
=
nc
{
'
SSTP_DEPH
'
}(:);
tsg
.
SSTP_
DEPH_MIN
=
nc
{
'
SSTP_DEPH
_MIN'
}(:);
tsg
.
SSTP_
DEPH_MAX
=
nc
{
'
SSTP_DEPH
_MAX'
}(:);
tsg
.
SSTP
_CALCOEF
=
nc
{
'
SSTP
_CALCOEF'
}(:);
tsg
.
SSTP
_LINCOEF
=
nc
{
'
SSTP
_LINCOEF'
}(:);
% Coordinates
%------------
tsg
.
DATE_TSG
=
nc1
{
'DATE_TSG'
}(:,:);
tsg
.
TIME_TSG
=
nc1
{
'TIME_TSG'
}(:);
tsg
.
LATITUDE_TSG
=
nc1
{
'LATITUDE_TSG'
}(:);
tsg
.
LONGITUDE_TSG
=
nc1
{
'LONGITUDE_TSG'
}(:);
tsg
.
POSITION_TSG_QC
=
nc1
{
'POSITION_TSG_QC'
}(:);
tsg
.
VELOCITY_TSG
=
nc1
{
'VELOCITY_TSG'
}(:);
tsg
.
DATE
=
nc
{
'DATE'
}(:,:);
tsg
.
DAYD
=
nc
{
'DAYD'
}(:);
tsg
.
LATX
=
nc
{
'LATX'
}(:);
tsg
.
LONX
=
nc
{
'LONX'
}(:);
tsg
.
POSITION_QC
=
nc
{
'POSITION_QC'
}(:);
tsg
.
SPDC
=
nc
{
'SPDC'
}(:);
tsg
.
REFERENCE_DATE_TIME
=
nc
{
'REFERENCE_DATE_TIME'
}(:);
% Convert julian day with origin 1950 to Matlab datenum in memory
% ---------------------------------------------------------------
tsg
.
DAYD
=
julianToDatenum
(
tsg
.
DAYD
);
% Variables holding data from the main TSG
% data series 1
% data series 1
%-----------------------------------------
% measured variables
% measured variables
%-----------------------------------------
if
~
isempty
(
'
PRES
'
)
tsg
.
PRES
_TSG
=
nc
1
{
'PRES
_TSG
'
}(:);
end
if
~
isempty
(
'TEMP'
)
tsg
.
TEMP_TSG
=
nc
1
{
'
TEMP_TSG
'
}(:);
tsg
.
TEMP_TSG
_STD
=
nc
1
{
'
TEMP_TSG
_STD'
}(:);
tsg
.
TEMP
_STD_CAL
=
nc
1
{
'TEMP_STD_CAL'
}(:);
end
if
~
isempty
(
'
CNDC
'
)
tsg
.
CNDC
_TSG
=
nc
1
{
'CNDC
_TSG
'
}(:);
tsg
.
CNDC_
TSG_
STD
=
nc
1
{
'CNDC_
TSG_
STD'
}(:);
tsg
.
CNDC_
TSG_
CAL
=
nc
1
{
'CNDC_
TSG_
CAL'
}(:);
end
% intake temperature variable
%
if isempty(
tsg.
PRES)
tsg
.
PRES
=
nc
{
'PRES'
}(:);
%
end
%
if isempty(
tsg.SSJT
)
tsg
.
SSJT
=
nc
{
'
SSJT
'
}(:);
tsg
.
SSJT
_STD
=
nc
{
'
SSJT
_STD'
}(:);
tsg
.
SSJT
_STD_CAL
=
nc
{
'TEMP_STD_CAL'
}(:);
%
end
%
if isempty(
tsg.
CNDC)
tsg
.
CNDC
=
nc
{
'CNDC'
}(:);
tsg
.
CNDC_STD
=
nc
{
'CNDC_STD'
}(:);
tsg
.
CNDC_CAL
=
nc
{
'CNDC_CAL'
}(:);
%
end
% intake temperature variable
%-----------------------------------------
tsg
.
TEM
P
=
nc
1
{
'
TEM
P'
}(:);
tsg
.
TEM
P_QC
=
nc
1
{
'
TEM
P_QC'
}(:);
tsg
.
TEM
P_CAL
=
nc
1
{
'
TEM
P_CAL'
}(:);
tsg
.
TEM
P_ADJUSTED
=
nc
1
{
'
TEM
P_ADJUSTED'
}(:);
tsg
.
TEM
P_ADJUSTED_ERROR
=
nc
1
{
'
TEM
P_ADJUSTED_ERROR'
}(:);
tsg
.
TEM
P_ADJUSTED_QC
=
nc
1
{
'
TEM
P_ADJUSTED_QC'
}(:);
tsg
.
TEM
P_ADJUSTED_HIST
=
nc
1
{
'HIST_
TEM
P_ADJUSTED'
}(:);
% derived variables
tsg
.
SST
P
=
nc
{
'
SST
P'
}(:);
tsg
.
SST
P_QC
=
nc
{
'
SST
P_QC'
}(:);
tsg
.
SST
P_CAL
=
nc
{
'
SST
P_CAL'
}(:);
tsg
.
SST
P_ADJUSTED
=
nc
{
'
SST
P_ADJUSTED'
}(:);
tsg
.
SST
P_ADJUSTED_ERROR
=
nc
{
'
SST
P_ADJUSTED_ERROR'
}(:);
tsg
.
SST
P_ADJUSTED_QC
=
nc
{
'
SST
P_ADJUSTED_QC'
}(:);
tsg
.
SST
P_ADJUSTED_HIST
=
nc
{
'HIST_
SST
P_ADJUSTED'
}(:);
% derived variables
%-----------------------------------------
tsg
.
PS
AL
=
nc
1
{
'PS
AL
'
}(:);
tsg
.
PS
AL
_QC
=
nc
1
{
'PS
AL
_QC'
}(:);
tsg
.
PS
AL
_CAL
=
nc
1
{
'PS
AL
_CAL'
}(:);
tsg
.
PS
AL
_ADJUSTED
=
nc
1
{
'PS
AL
_ADJUSTED'
}(:);
tsg
.
PS
AL
_ADJUSTED_ERROR
=
nc
1
{
'PS
AL
_ADJUSTED_ERROR'
}(:);
tsg
.
PS
AL
_ADJUSTED_QC
=
nc
1
{
'PS
AL
_ADJUSTED_QC'
}(:);
tsg
.
PS
AL
_ADJUSTED_HIST
=
nc
1
{
'HIST_PS
AL
_ADJUSTED'
}(:);
% data series 2
tsg
.
SS
PS
=
nc
{
'
SS
PS'
}(:);
tsg
.
SS
PS_QC
=
nc
{
'
SS
PS_QC'
}(:);
tsg
.
SS
PS_CAL
=
nc
{
'
SS
PS_CAL'
}(:);
tsg
.
SS
PS_ADJUSTED
=
nc
{
'
SS
PS_ADJUSTED'
}(:);
tsg
.
SS
PS_ADJUSTED_ERROR
=
nc
{
'
SS
PS_ADJUSTED_ERROR'
}(:);
tsg
.
SS
PS_ADJUSTED_QC
=
nc
{
'
SS
PS_ADJUSTED_QC'
}(:);
tsg
.
SS
PS_ADJUSTED_HIST
=
nc
{
'HIST_
SS
PS_ADJUSTED'
}(:);
% data series 2
%-----------------------------------------
% water samples
% water samples
%-----------------------------------------
tsg
.
DATE_WS
=
nc1
{
'DATE_WS'
}(:,:);
tsg
.
TIME_WS
=
nc1
{
'TIME_WS'
}(:);
tsg
.
LATITUDE_WS
=
nc1
{
'LATITUDE_WS'
}(:);
tsg
.
LONGITUDE_WS
=
nc1
{
'LONGITUDE_WS'
}(:);
tsg
.
PSAL_WS
=
nc1
{
'PSAL_WS'
}(:);
tsg
.
PSAL_WS_QC
=
nc1
{
'PSAL_WS_QC'
}(:);
tsg
.
PSAL_WS_ANALDATE
=
nc1
{
'PSAL_WS_ANALDATE'
}(:,:);
tsg
.
PSAL_WS_BOTTLE
=
nc1
{
'PSAL_WS_BOTTLE'
}(:,:);
tsg
.
DATE_WS
=
nc
{
'DATE_WS'
}(:,:);
tsg
.
DAYD_WS
=
julianToDatenum
(
nc
{
'DAYD_WS'
}(:));
tsg
.
LATX_WS
=
nc
{
'LATX_WS'
}(:);
tsg
.
LONX_WS
=
nc
{
'LONX_WS'
}(:);
tsg
.
SSPS_WS
=
nc
{
'SSPS_WS'
}(:);
tsg
.
SSPS_WS_QC
=
nc
{
'SSPS_WS_QC'
}(:);
tsg
.
SSPS_WS_ANALDATE
=
nc
{
'SSPS_WS_ANALDATE'
}(:,:);
tsg
.
SSPS_WS_BOTTLE
=
nc
{
'SSPS_WS_BOTTLE'
}(:,:);
% Save the data in the application GUI
% ------------------------------------
setappdata
(
hTsgGUI
,
'tsg_data'
,
tsg
);
% Clear the Workspace
% -------------------
clear
tsgdata
% Close the file
% --------------
%endef(nc)
close
(
nc
)
close
(
nc
);
% Everything OK
% -------------
error
=
1
;
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment