Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
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
Tom Rink
python
Commits
3460dd72
Commit
3460dd72
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
7f9c1a30
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
modules/amv/caliop_clavrx_amv.py
+28
-6
28 additions, 6 deletions
modules/amv/caliop_clavrx_amv.py
with
28 additions
and
6 deletions
modules/amv/caliop_clavrx_amv.py
+
28
−
6
View file @
3460dd72
...
...
@@ -107,7 +107,7 @@ def match_calipso_clavrx_to_amvs(calipso_clavrx_path, calipso_clavrx_file, amv_f
match_dict
[
nom_time
].
append
((
cc
,
ll
,
lon_s
[
idx
],
lat_s
[
idx
],
f_idx
,
data_da
,
amvs_da
))
return
match_dict
,
calipso_clavrx_params
,
amv_
files
.
get_out_parameters
()
return
match_dict
,
calipso_clavrx_params
,
amv_
params
def
create_file_new
(
match_dct
,
filename
,
caliop_clavrx_params
,
amv_params
):
...
...
@@ -157,8 +157,6 @@ def create_file_new(match_dct, filename, caliop_clavrx_params, amv_params):
# the top level group for the output file
rootgrp
=
Dataset
(
filename
,
'
w
'
,
format
=
'
NETCDF4
'
)
#dim_aparams = rootgrp.createDimension('num_aeolus_params', size=num_aparams)
#dim_alevs = rootgrp.createDimension('max_num_aeolus_levels', size=max_num_alevels)
dim_amvs
=
rootgrp
.
createDimension
(
'
max_num_amvs
'
,
size
=
max_num_amvs
)
dim_num_aeolus_prof
=
rootgrp
.
createDimension
(
'
num_caliop_profs
'
,
size
=
num_aprofs
)
#dim_num_files = rootgrp.createDimension('num_amv_files', size=amv_file_s.shape[0])
...
...
@@ -166,7 +164,7 @@ def create_file_new(match_dct, filename, caliop_clavrx_params, amv_params):
prf_time
=
rootgrp
.
createVariable
(
'
time
'
,
'
f4
'
,
[
'
num_caliop_profs
'
])
#amv_file_names = rootgrp.createVariable('amv_file_names', str, ['num_amv_files'])
# ----
Profile
variables ---------------
# ----
CALIOP
variables ---------------
prf_lon
=
rootgrp
.
createVariable
(
'
prof_longitude
'
,
'
f4
'
,
[
'
num_caliop_profs
'
])
prf_lon
.
units
=
'
degrees east
'
prf_lat
=
rootgrp
.
createVariable
(
'
prof_latitude
'
,
'
f4
'
,
[
'
num_caliop_profs
'
])
...
...
@@ -174,7 +172,7 @@ def create_file_new(match_dct, filename, caliop_clavrx_params, amv_params):
prf_time
.
units
=
'
seconds since 1970-01-1 00:00:00
'
prf_elem
=
rootgrp
.
createVariable
(
'
FD_elem
'
,
'
f4
'
,
[
'
num_caliop_profs
'
])
prf_line
=
rootgrp
.
createVariable
(
'
FD_line
'
,
'
f4
'
,
[
'
num_caliop_profs
'
])
prf_fidx
=
rootgrp
.
createVariable
(
'
amv_file_index
'
,
'
i4
'
,
[
'
num_caliop_profs
'
])
#
prf_fidx = rootgrp.createVariable('amv_file_index', 'i4', ['num_caliop_profs'])
# ----- CALIOP+CLAVRx variables ------
nc4_vars_cc
=
[]
...
...
@@ -193,6 +191,14 @@ def create_file_new(match_dct, filename, caliop_clavrx_params, amv_params):
nc4_vars_cc
.
append
(
var
)
# ----- AMV variables ----------------
amv_lon
=
rootgrp
.
createVariable
(
'
amv_longitude
'
,
'
f4
'
,
[
'
num_caliop_profs
'
,
'
max_num_amvs
'
])
amv_lon
.
units
=
'
degrees east
'
amv_lat
=
rootgrp
.
createVariable
(
'
amv_latitude
'
,
'
f4
'
,
[
'
num_caliop_profs
'
,
'
max_num_amvs
'
])
amv_lat
.
units
=
'
degrees north
'
amv_elem
=
rootgrp
.
createVariable
(
'
amv_elem
'
,
'
f4
'
,
[
'
num_caliop_profs
'
,
'
max_num_amvs
'
])
amv_line
=
rootgrp
.
createVariable
(
'
amv_line
'
,
'
f4
'
,
[
'
num_caliop_profs
'
,
'
max_num_amvs
'
])
#prf_fidx = rootgrp.createVariable('amv_file_index', 'i4', ['num_caliop_profs'])
nc4_vars
=
[]
var_s
=
rg_exmpl
.
variables
for
pidx
,
param
in
enumerate
(
amv_params
):
...
...
@@ -214,7 +220,7 @@ def create_file_new(match_dct, filename, caliop_clavrx_params, amv_params):
prf_elem
[:]
=
elems
prf_line
[:]
=
lines
prf_time
[:]
=
atimes
prf_fidx
[:]
=
fidxs
#
prf_fidx[:] = fidxs
#amv_file_names[:] = amv_file_s
...
...
@@ -229,6 +235,22 @@ def create_file_new(match_dct, filename, caliop_clavrx_params, amv_params):
nda
=
data_nd
[
pidx
]
nc4_vars_cc
[
pidx
][
idx
]
=
nda
nda
=
amvs_nd
[
0
,]
cnt
=
nda
.
shape
[
0
]
amv_lon
[
idx
,
0
:
cnt
]
=
nda
nda
=
amvs_nd
[
1
,]
cnt
=
nda
.
shape
[
0
]
amv_lat
[
idx
,
0
:
cnt
]
=
nda
nda
=
amvs_nd
[
2
,]
cnt
=
nda
.
shape
[
0
]
amv_elem
[
idx
,
0
:
cnt
]
=
nda
nda
=
amvs_nd
[
3
,]
cnt
=
nda
.
shape
[
0
]
amv_line
[
idx
,
0
:
cnt
]
=
nda
for
pidx
,
param
in
enumerate
(
amv_params
):
nda
=
amvs_nd
[
pidx
+
4
,]
cnt
=
nda
.
shape
[
0
]
...
...
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