Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
himawari
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Ray Garcia
himawari
Commits
b44e94a5
Commit
b44e94a5
authored
7 years ago
by
Ray Garcia
Browse files
Options
Downloads
Patches
Plain Diff
caching of navigation speeds up cmi_changer a LOT
parent
23fb0bcc
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
himawari/ahi2cmi.py
+13
-4
13 additions, 4 deletions
himawari/ahi2cmi.py
with
13 additions
and
4 deletions
himawari/ahi2cmi.py
+
13
−
4
View file @
b44e94a5
...
...
@@ -51,6 +51,9 @@ class HimawariAHIasCMIP(object):
_data_name
=
DEFAULT_CMIP_NAME
_projection_name
=
DEFAULT_CMIP_PROJECTION_NAME
_when
=
None
y
=
None
x
=
None
shape_m
=
None
def
__init__
(
self
,
path
,
as_radiances
=
False
,
data_name
=
None
):
"""
...
...
@@ -68,6 +71,10 @@ class HimawariAHIasCMIP(object):
data_name
=
DEFAULT_CMIP_NAME
if
not
as_radiances
else
DEFAULT_CMIP_RAD_NAME
self
.
_data_name
=
data_name
self
.
_when
=
datetime
.
utcnow
()
# cache the y and x angles
self
.
y
=
self
.
_y
self
.
x
=
self
.
_x
self
.
shape_m
=
self
.
_shape_m
def
p
(
self
,
*
strings
):
return
(
self
.
path
,)
+
tuple
(
strings
)
...
...
@@ -590,7 +597,7 @@ class HimawariAHIasCMIP(object):
return
self
.
_hs
.
radiances
()
@property
def
y
(
self
):
def
_
y
(
self
):
"""
negate y values to match PUG convention
also see yx_pvda regarding negation of scale_factor and add_offset to keep monotonic increasing unscaled values
...
...
@@ -600,7 +607,7 @@ class HimawariAHIasCMIP(object):
return
-
y
.
squeeze
()
@property
def
x
(
self
):
def
_
x
(
self
):
_
,
x
=
self
.
_hs
.
coords
(
lines
=
1
)
return
x
.
squeeze
()
...
...
@@ -633,7 +640,7 @@ class HimawariAHIasCMIP(object):
return
np
.
require
(
self
.
x
,
dtype
=
np
.
float64
)
*
self
.
perspective_point_height
@property
def
shape_m
(
self
):
def
_
shape_m
(
self
):
"""
:return: (y, x) nadir-meters nominal size of a cell
"""
...
...
@@ -641,7 +648,9 @@ class HimawariAHIasCMIP(object):
h
=
self
.
perspective_point_height
return
mb
.
my
*
h
,
mb
.
mx
*
h
cell_size
=
shape_m
@property
def
cell_size
(
self
):
return
self
.
shape_m
@property
def
origin
(
self
):
...
...
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