frost_create_ObsTimestamp: get observation timestamps for Frost data

frost_create_ObsTimestampR Documentation

get observation timestamps for Frost data

Description

Create observation timestamps for data dowmnloaded using the Frost API https://frost.met.no.

Usage

frost_create_ObsTimestamp(frost_data=NULL)

Arguments

frost_data

data frame such as the frost_data list element returned by gibson_frost. The used fields are timeResolution, timeOffset and referenceTime.

Details

Observations associated to elements with hourly timeResolution have the timestamp equals to referenceTime.

Observations associated to elements with daily timeResolution have the timestamp that is the day derived from referenceTime plus timeOffset hours. In general, a daily value represets an aggregated value over 24 hours and the timestamp marks the end of the aggregation period. However, if timeOffset is equal to 00 hours then the timestamp indicates that the observed value represent the aggregation over the day in the timestamp and one should think at the end of the aggregation period as 23:59 UTC (hours:minutes) of the day.

Value

A vector of class=c("POSIXct", "POSIXt") with the same number of elements of frost_data.

Author(s)

Cristian Lussana

See Also

gibson_frost frost_assembler

Examples


# load libraries
library(gibson)
#
auth<-put_your_ClientID_here
#
frost<-gibson_frost(client_id=auth,oldElementCodes=c("RR_1","TAMRR"), sources="ALL",start_date="2018-03-02T08:00",stop_date="2018-03-04T13:00",format="%Y-%m-%dT%H:%M",countries="NO",stationholders="MET.NO",url.show=T)
timestamp<-frost_create_ObsTimestamp(frost$frost_data)


metno/gibson documentation built on Feb. 12, 2024, 7:25 a.m.