Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GeoPEAS
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
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
esde
toar-data
GeoPEAS
Commits
a4cf795e
Commit
a4cf795e
authored
1 year ago
by
Tom Ohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
Nox emission now returns data in kg/km2/y
parent
d1cb7463
No related branches found
No related tags found
1 merge request
!85
GeoPEAS work on original files
Pipeline
#191352
failed
1 year ago
Stage: test
Stage: pages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
services/nox_emissions/serializers.py
+1
-1
1 addition, 1 deletion
services/nox_emissions/serializers.py
utils/geocube_connection.py
+12
-1
12 additions, 1 deletion
utils/geocube_connection.py
with
13 additions
and
2 deletions
services/nox_emissions/serializers.py
+
1
−
1
View file @
a4cf795e
...
@@ -8,5 +8,5 @@ from utils.agg_serializer import GeneralAggSerializer
...
@@ -8,5 +8,5 @@ from utils.agg_serializer import GeneralAggSerializer
class
AggSerializer
(
GeneralAggSerializer
):
class
AggSerializer
(
GeneralAggSerializer
):
def
__init__
(
self
,
instance
):
def
__init__
(
self
,
instance
):
instance
[
'
unit
'
]
=
'
kg m-2
s
-1
'
instance
[
'
unit
'
]
=
'
kg
k
m-2
y
-1
'
super
(
AggSerializer
,
self
).
__init__
(
instance
)
super
(
AggSerializer
,
self
).
__init__
(
instance
)
This diff is collapsed.
Click to expand it.
utils/geocube_connection.py
+
12
−
1
View file @
a4cf795e
...
@@ -13,7 +13,8 @@ from utils.g_c_methods import generate_monthly_timestamps, generate_yearly_times
...
@@ -13,7 +13,8 @@ from utils.g_c_methods import generate_monthly_timestamps, generate_yearly_times
import
xarray
as
xr
import
xarray
as
xr
import
nctoolkit
as
nc
import
nctoolkit
as
nc
import
rioxarray
as
rxr
import
rioxarray
as
rxr
import
os
import
time
class
GeoCube
:
class
GeoCube
:
...
@@ -71,6 +72,16 @@ class GeoCube:
...
@@ -71,6 +72,16 @@ class GeoCube:
self
.
dataset
=
xr
.
open_dataset
(
self
.
dataset
=
xr
.
open_dataset
(
f
"
/mnt/geodata/cams_global_emission/CAMS-GLOB-ANT_v4.2_nitrogen-oxides/CAMS-GLOB-ANT_v4.2_nitrogen-oxides_
{
self
.
year
}
.nc
"
,
f
"
/mnt/geodata/cams_global_emission/CAMS-GLOB-ANT_v4.2_nitrogen-oxides/CAMS-GLOB-ANT_v4.2_nitrogen-oxides_
{
self
.
year
}
.nc
"
,
decode_times
=
False
)
decode_times
=
False
)
self
.
dataset
=
self
.
dataset
[
"
sum
"
].
sel
(
lon
=
slice
(
self
.
lon
-
3
,
self
.
lon
+
3
),
lat
=
slice
(
self
.
lat
-
3
,
self
.
lat
+
3
)).
to_dataset
()
self
.
dataset
.
load
()
m2_to_km2
=
1e6
s_to_year
=
60
*
60
*
24
*
365.25
self
.
dataset
=
self
.
dataset
.
mean
(
dim
=
"
time
"
)
self
.
dataset
=
self
.
dataset
*
m2_to_km2
*
s_to_year
self
.
xarray
=
True
self
.
xarray
=
True
lat
=
self
.
dataset
[
"
lat
"
][:]
lat
=
self
.
dataset
[
"
lat
"
][:]
...
...
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