Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
aqdl
blobs
cli
era5spo
Commits
445d9a92
Commit
445d9a92
authored
May 09, 2022
by
Jean-Marie Lepioufle
Browse files
typo
parent
b41bdbe7
Changes
1
Hide whitespace changes
Inline
Side-by-side
era5spo.R
View file @
445d9a92
...
...
@@ -119,7 +119,8 @@ era5 <- hello$ts(fromDateTime=fromDateTime,
cat
(
"-- mean agregation and time difference since the beginning of the study \n"
)
era5
<-
cbind
(
era5
,
era5
[,
.
(
data.table
::
IDateTime
(
date
))])
era5
[,
`:=`
(
diff_s
=
as.numeric
(
as.POSIXct
(
idate
,
itime
,
tz
=
"UTC"
)
-
as.POSIXct
(
fromDateTime
,
tz
=
"UTC"
)))]
#era5[,`:=`(diff_s = as.numeric(as.POSIXct(idate,itime,tz="UTC")-as.POSIXct(fromDateTime,tz="UTC")))]
era5
[,
`:=`
(
diff_s
=
as.numeric
(
base
::
difftime
(
as.POSIXct
(
idate
,
itime
,
tz
=
"UTC"
),
as.POSIXct
(
"1970-01-01 00:00:00"
,
tz
=
"UTC"
),
units
=
"secs"
)))]
study
<-
switch
(
timeAggregation
,
"hourly"
=
era5
[,
.
(
value
=
mean
(
values
,
na.rm
=
TRUE
),
diff_sec
=
max
(
diff_s
,
na.rm
=
TRUE
)),
by
=
list
(
ID
=
SamplingPoint
,
variable
=
variable
,
level
=
level
,
year
=
data.table
::
year
(
idate
),
month
=
data.table
::
month
(
idate
),
doy
=
data.table
::
yday
(
idate
),
dom
=
data.table
::
mday
(
idate
),
hour
=
data.table
::
hour
(
itime
))],
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment