Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
finam
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FINAM
finam
Commits
4b21735d
Commit
4b21735d
authored
1 year ago
by
Sebastian Müller
🐈
Browse files
Options
Downloads
Patches
Plain Diff
masking adapter: don't add missing value if grid is not masked
parent
4414568e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!260
Masked array support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/finam/adapters/masking.py
+7
-3
7 additions, 3 deletions
src/finam/adapters/masking.py
with
7 additions
and
3 deletions
src/finam/adapters/masking.py
+
7
−
3
View file @
4b21735d
...
...
@@ -14,7 +14,7 @@ __all__ = ["Masking"]
class
Masking
(
Adapter
):
"""
Adapter for compatible grids with output on a sub-grid.
Adapter for compatible
constantly masked
grids with output on a sub-grid.
Examples
--------
...
...
@@ -95,10 +95,14 @@ class Masking(Adapter):
if
self
.
nodata
is
None
:
with
ErrorLogger
(
self
.
logger
):
raise
FinamMetaDataError
(
"
Couldn
'
t determine no-data value.
"
)
else
:
self
.
_canonical_mask
=
None
# return output info
return
in_info
.
copy_with
(
grid
=
info
.
grid
,
missing_value
=
self
.
nodata
)
# return output info
self
.
_canonical_mask
=
None
if
out_nodata
is
None
:
return
in_info
.
copy_with
(
grid
=
info
.
grid
)
# if missing value was present, add it again
return
in_info
.
copy_with
(
grid
=
info
.
grid
,
missing_value
=
self
.
nodata
)
def
_masks_compatible
(
self
,
sup_grid
,
sub_grid
):
...
...
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