Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
adcp_mooring_data_processing
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
Container 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
adcp_mooring_data_processing
Commits
a0cebfda
"git@forge.ird.fr:cesbio/modelisation/modspa_pixel.git" did not exist on "0395829de6ae147dacf82811e97e71da8abe639b"
Commit
a0cebfda
authored
8 years ago
by
habasque
Browse files
Options
Downloads
Patches
Plain Diff
ajout création fichier NetCDF
parent
ecdfaab4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
template_get_adcp_data.m
+28
-2
28 additions, 2 deletions
template_get_adcp_data.m
with
28 additions
and
2 deletions
template_get_adcp_data.m
+
28
−
2
View file @
a0cebfda
...
...
@@ -24,7 +24,7 @@ rawfile='.\data_example\FR24_000.000'; % binary file with .000 extension
fpath_output
=
'.\data_example\'
;
cruise
.
name
=
''
;
mooring
.
name
=
''
;
mooring
.
name
=
'
10W0N
'
;
mooring
.
lat
=
00
+
00
/
60
;
%latitude
mooring
.
lon
=-
10
+
00
/
60
;
%longitude
...
...
@@ -227,6 +227,32 @@ pos = get(hf,'Position');
set
(
hf
,
'PaperPositionMode'
,
'Auto'
,
'PaperUnits'
,
'Inches'
,
'PaperSize'
,[
pos
(
3
),
pos
(
4
)]);
print
(
hf
,
graph_name
,
'-dpdf'
,
'-r300'
);
%% Write netcdf file
[
yr_start
,
~
,
~
]
=
gregorian
(
inttim
(
1
));
[
yr_end
,
~
,
~
]
=
gregorian
(
inttim
(
length
(
inttim
)));
ncid
=
netcdf
.
create
([
fpath_output
,
'ADCP_'
,
mooring
.
name
,
'_'
,
num2str
(
yr_start
),
'_'
,
num2str
(
yr_end
),
'_1d.nc'
],
'NC_WRITE'
);
%create dimension
dimidt
=
netcdf
.
defDim
(
ncid
,
'time'
,
length
(
inttim
));
dimidz
=
netcdf
.
defDim
(
ncid
,
'depth'
,
length
(
Z
));
%Define IDs for the dimension variables (pressure,time,latitude,...)
time_ID
=
netcdf
.
defVar
(
ncid
,
'time'
,
'double'
,
dimidt
);
depth_ID
=
netcdf
.
defVar
(
ncid
,
'depth'
,
'double'
,
dimidz
);
%Define the main variable ()
u_ID
=
netcdf
.
defVar
(
ncid
,
'u'
,
'double'
,[
dimidt
dimidz
]);
v_ID
=
netcdf
.
defVar
(
ncid
,
'v'
,
'double'
,[
dimidt
dimidz
]);
%We are done defining the NetCdf
netcdf
.
endDef
(
ncid
);
%Then store the dimension variables in
netcdf
.
putVar
(
ncid
,
time_ID
,
inttim
);
netcdf
.
putVar
(
ncid
,
depth_ID
,
Z
);
%Then store my main variable
netcdf
.
putVar
(
ncid
,
u_ID
,
uintfilt
);
netcdf
.
putVar
(
ncid
,
v_ID
,
vintfilt
);
%We're done, close the netcdf
netcdf
.
close
(
ncid
);
% rmpath
rmpath
(
'.\moored_adcp_proc'
);
rmpath
(
'.
.
\moored_adcp_proc'
);
clear
all
;
close
all
;
\ No newline at end of file
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