Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ray Garcia
himawari
Commits
4e7d559a
Commit
4e7d559a
authored
Aug 10, 2017
by
R.K.Garcia
Browse files
fix to inverting y
had to both invert sf/ao and the value itself, since sf/ao are removed during netcdf storage
parent
18a81a53
Changes
1
Hide whitespace changes
Inline
Side-by-side
himawari/ahi2cmi.py
View file @
4e7d559a
...
...
@@ -372,23 +372,23 @@ class HimawariAHIasCMIP(object):
_
,
_
,
mb
=
self
.
_hs
.
coords
(
lines
=
1
,
columns
=
1
,
unscaled
=
True
)
y
,
x
=
self
.
y
,
self
.
x
def
yx_pvda
(
name
,
v
,
m
,
b
):
def
yx_pvda
(
name
,
v
,
m
,
b
,
invert
=
False
):
assert
(
name
in
{
'y'
,
'x'
})
a
=
{
'.dtype'
:
np
.
int16
,
# annotation telling goesr.rockfall.nc_write what kind of var to make
'units'
:
'rad'
,
'long_name'
:
"AHI fixed grid projection %s-coordinate"
%
name
,
'standard_name'
:
"projection_%s_coordinate"
%
name
,
'scale_factor'
:
-
m
if
name
==
'y'
else
m
,
# PUG has negative y north of equator
'add_offset'
:
-
b
if
name
==
'y'
else
b
# ref GIT 3ebfc9ab1f
'scale_factor'
:
-
m
if
invert
else
m
,
# PUG has negative y north of equator
; prefer monotonic +1 raw value however
'add_offset'
:
-
b
if
invert
else
b
# ref GIT 3ebfc9ab1f
}
# y/x
yield
self
.
p
(
name
),
v
,
self
.
d
(
name
),
a
yield
self
.
p
(
name
),
-
v
if
invert
else
v
,
self
.
d
(
name
),
a
# y_image/x_image single value
v_image
=
np
.
nanmean
(
v
)
a
[
'long_name'
]
=
"AHI fixed grid projection %s-coordinate center of image"
%
name
,
yield
self
.
p
(
'%s_image'
%
name
),
v_image
,
{},
a
yield
self
.
p
(
'%s_image'
%
name
),
-
v_image
if
invert
else
v_image
,
{},
a
# y_image_bounds
vrange
=
np
.
array
([
np
.
nanmin
(
v
),
np
.
nanmax
(
v
)])
...
...
@@ -398,10 +398,10 @@ class HimawariAHIasCMIP(object):
}[
name
]
a
=
{}
a
[
'long_name'
]
=
"AHI fixed grid projection %s-coordinate %s extent of image"
%
(
name
,
nsew
)
yield
self
.
p
(
'%s_image_bounds'
%
name
),
vrange
,
self
.
d
(
DEFAULT_YX_BOUNDS_NAME
),
a
yield
self
.
p
(
'%s_image_bounds'
%
name
),
-
vrange
if
invert
else
vrange
,
self
.
d
(
DEFAULT_YX_BOUNDS_NAME
),
a
# y and x variables and their bounds and centerpoints
for
each
in
yx_pvda
(
'y'
,
y
,
mb
.
my
,
mb
.
by
):
for
each
in
yx_pvda
(
'y'
,
y
,
mb
.
my
,
mb
.
by
,
invert
=
True
):
yield
each
for
each
in
yx_pvda
(
'x'
,
x
,
mb
.
mx
,
mb
.
bx
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment