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
88672d2a
Commit
88672d2a
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
6912cf68
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/aeolus/datasource.py
+22
-0
22 additions, 0 deletions
modules/aeolus/datasource.py
with
22 additions
and
0 deletions
modules/aeolus/datasource.py
+
22
−
0
View file @
88672d2a
...
@@ -4,6 +4,8 @@ import glob
...
@@ -4,6 +4,8 @@ import glob
import
numpy
as
np
import
numpy
as
np
import
re
import
re
from
netCDF4
import
Dataset
from
netCDF4
import
Dataset
import
pathlib
from
pathlib
import
Path
from
aeolus.geos_nav
import
GEOSNavigation
from
aeolus.geos_nav
import
GEOSNavigation
from
util.util
import
GenericException
from
util.util
import
GenericException
...
@@ -47,6 +49,10 @@ def get_parameters_fmwk_amvs(filename='/ships19/cloud/scratch/4TH_AMV_INTERCOMPA
...
@@ -47,6 +49,10 @@ def get_parameters_fmwk_amvs(filename='/ships19/cloud/scratch/4TH_AMV_INTERCOMPA
class
Files
:
class
Files
:
def
__init__
(
self
,
files_path
,
file_time_span
,
pattern
):
def
__init__
(
self
,
files_path
,
file_time_span
,
pattern
):
if
os
.
path
.
isdir
(
files_path
):
self
.
flist
=
[]
for
path
in
Path
(
files_path
).
rglob
(
pattern
):
self
.
flist
.
append
(
path
)
self
.
flist
=
glob
.
glob
(
files_path
+
pattern
)
self
.
flist
=
glob
.
glob
(
files_path
+
pattern
)
if
len
(
self
.
flist
)
==
0
:
if
len
(
self
.
flist
)
==
0
:
raise
GenericException
(
'
no matching files found in:
'
+
files_path
+
pattern
)
raise
GenericException
(
'
no matching files found in:
'
+
files_path
+
pattern
)
...
@@ -124,6 +130,22 @@ class CLAVRx(Files):
...
@@ -124,6 +130,22 @@ class CLAVRx(Files):
return
self
.
params
return
self
.
params
class
CLAVRx_VIIRS
(
Files
):
def
__init__
(
self
,
files_path
):
super
().
__init__
(
files_path
,
10
,
'
clavrx*viirs*level2.h5
'
)
self
.
params
=
get_parameters_clavrx
()
def
get_datetime
(
self
,
pathname
):
filename
=
os
.
path
.
split
(
pathname
)[
1
]
so
=
re
.
search
(
'
_s
\\
d{11}
'
,
filename
)
dt_str
=
so
.
group
()
dto
=
datetime
.
datetime
.
strptime
(
dt_str
,
'
_s%Y%j%H%M
'
).
replace
(
tzinfo
=
timezone
.
utc
)
return
dto
def
get_parameters
(
self
):
return
self
.
params
class
RAOBfiles
(
Files
):
class
RAOBfiles
(
Files
):
def
__init__
(
self
,
files_path
,
file_time_span
=
10
):
def
__init__
(
self
,
files_path
,
file_time_span
=
10
):
super
().
__init__
(
files_path
,
file_time_span
,
'
raob_soundings*.cdf
'
)
super
().
__init__
(
files_path
,
file_time_span
,
'
raob_soundings*.cdf
'
)
...
...
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