Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Oceano2python
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
Oceano2python
Commits
269eae61
Commit
269eae61
authored
5 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
add netcdf
parent
6e921369
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
netcdf.py
+14
-0
14 additions, 0 deletions
netcdf.py
netcdf/.emptydir
+0
-1
0 additions, 1 deletion
netcdf/.emptydir
oceano.py
+3
-1
3 additions, 1 deletion
oceano.py
with
19 additions
and
2 deletions
.gitignore
+
2
−
0
View file @
269eae61
...
...
@@ -20,3 +20,5 @@ build/
dest/
oceano.spec
oceano.cfg
basemap
/dist
This diff is collapsed.
Click to expand it.
netcdf.py
0 → 100644
+
14
−
0
View file @
269eae61
from
netCDF4
import
Dataset
def
writeNetCDF
(
fileName
,
fe
):
# create netcdf file
nc
=
Dataset
(
fileName
,
"
w
"
,
format
=
"
NETCDF3_CLASSIC
"
)
print
(
nc
.
data_model
)
# create dimensions
depth
=
nc
.
createDimension
(
"
DEPTH
"
,
None
)
time
=
nc
.
createDimension
(
"
TIME
"
,
None
)
lat
=
nc
.
createDimension
(
"
LATITUDE
"
,
73
)
lon
=
nc
.
createDimension
(
"
LONGITUDE
"
,
144
)
This diff is collapsed.
Click to expand it.
netcdf/.emptydir
deleted
100644 → 0
+
0
−
1
View file @
6e921369
Do not delete this file.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
oceano.py
+
3
−
1
View file @
269eae61
...
...
@@ -9,6 +9,7 @@ import pathlib
from
configparser
import
ConfigParser
import
os
import
distutils.util
as
du
import
netcdf
# typeInstrument is a dictionary as key: files extension
typeInstrument
=
{
'
CTD
'
:
(
'
cnv
'
,
'
CNV
'
),
'
XBT
'
:
(
...
...
@@ -24,7 +25,7 @@ def processArgs():
following ROSCOP codification at the given column, fill arrays, write header file
'
,
usage
=
'
\n
python oceano.py data/CTD/cnv/dfr2900[1-3].cnv -i CTD -d
\n
'
'
python oceano.py data/CTD/cnv/dfr2900[1-3].cnv -i CTD -k PRES TEMP PSAL DOX2 DENS
\n
'
'
python oceano.py data/CTDcnv/dfr29*.cnv -i CTD -d
\n
'
'
python oceano.py data/CTD
/
cnv/dfr29*.cnv -i CTD -d
\n
'
'
python oceano.py data/XBT/T7_0000*.EDF -i XBT -k DEPTH TEMP SVEL
\n
'
'
python oceano.py data/LADCP/*.lad - i LADCP - k DEPTH EWCT NSCT
\n
'
'
\n
'
,
...
...
@@ -266,3 +267,4 @@ if __name__ == "__main__":
fe
,
n
,
m
=
process
(
args
,
cfg
,
device
)
print
(
"
Dimensions: {} x {}
"
.
format
(
m
,
n
))
print
(
fe
.
disp
(
args
.
key
))
netcdf
.
writeNetCDF
(
'
test.nc
'
,
fe
)
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