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
5def3a41
Commit
5def3a41
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
93a49a47
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/aeolus/datasource.py
+25
-0
25 additions, 0 deletions
modules/aeolus/datasource.py
with
25 additions
and
0 deletions
modules/aeolus/datasource.py
+
25
−
0
View file @
5def3a41
...
...
@@ -3,11 +3,29 @@ from datetime import timezone
import
glob
import
numpy
as
np
import
re
from
netCDF4
import
Dataset
from
aeolus.geos_nav
import
GEOSNavigation
from
util.util
import
GenericException
def
get_parameters_clavrx
(
filename
=
'
/home/rink/data/clavrx/clavrx_OR_ABI-L1b-RadC-M3C01_G16_s20190020002186.level2.nc
'
):
rg
=
Dataset
(
filename
,
'
r
'
)
var_s
=
rg
.
variables
var_names
=
list
(
var_s
.
keys
())
var_names_2d
=
[]
for
str
in
var_names
:
v
=
var_s
[
str
]
if
len
(
v
.
shape
)
==
2
:
if
not
(
str
.
find
(
'
latitude
'
)
!=
-
1
or
str
.
find
(
'
longitude
'
)
!=
-
1
):
var_names_2d
.
append
(
str
)
rg
.
close
()
return
var_names_2d
class
Files
:
def
__init__
(
self
,
files_path
,
file_time_span
,
pattern
):
self
.
flist
=
glob
.
glob
(
files_path
+
pattern
)
...
...
@@ -55,6 +73,9 @@ class Files:
else
:
return
None
,
None
,
None
def
get_parameters
(
self
):
pass
class
GOESL1B
(
Files
):
def
__init__
(
self
,
files_path
,
band
=
'
14
'
):
...
...
@@ -71,6 +92,7 @@ class GOESL1B(Files):
class
CLAVRx
(
Files
):
def
__init__
(
self
,
files_path
):
super
().
__init__
(
files_path
,
10
,
'
clavrx_OR_ABI-L1b*.level2.nc
'
)
self
.
params
=
get_parameters_clavrx
()
def
get_datetime
(
self
,
pathname
):
filename
=
os
.
path
.
split
(
pathname
)[
1
]
...
...
@@ -79,6 +101,9 @@ class CLAVRx(Files):
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
):
def
__init__
(
self
,
files_path
,
file_time_span
=
10
):
...
...
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