-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use a generic time-series for downscaling? #13
Comments
Hi Matteo. There is not such a wrapper. However, you can access the internal atomic functions to deal with raw data, named as the methods. However, the proper handling of dates, members and other metadata can't be guaranteed, and that is the main reason this application is discouraged in general and therefore not documented. In any case, just let us know in case we can help with some specific application. |
Hi Joaquin. I would like to downscale using as target a time-series of renewable energy generation (wind and hydropower data). Currently, I am using a station data structure, replacing the Data field with the data I have. This would be easier having more details on which fields (and metadata) are needed and which are optional, to avoid inconsistencies and strange error while using |
Hi Matteo, sorry for my slow response this time. Usually the most important metadata are related with date information (dates need to be unequivocally defined, and consistency between time zones must be ensured). Also, geolocation is important in many cases to find nearest neighbors and so on... If you find problems with your data just let me know. You can mail me to discuss the particularities of your datasets to see if we can help or if additional functionalities should be added to climate4R. Cheers. |
No worries. That is more of less the information I would need to 'wrap' a
time-series: which fields are needed and which ones are optional? I already
assumed the dates were important, I will also take into account the
geolocation. It is common to use as target variables for the downscaling
time-series not coming from meteorological datasets, for example
electricity data, so my approach is to "transform" the time-series
(normally in a data frame) into a station suitable for climate4R. I hope to
share an example soon.
…On Tue, Jan 19, 2021 at 10:00 AM Joaquin Bedia ***@***.***> wrote:
Hi Matteo, sorry for my slow response this time. Usually the most
important metadata are related with date information (dates need to be
unequivocally defined, and consistency between time zones must be ensured).
Also, geolocation is important in many cases to find nearest neighbors and
so on... If you find problems with your data just let me know. You can mail
me to discuss the particularities of your datasets to see if we can help or
if additional functionalities should be added to climate4R. Cheers.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQQYASNTSCOCR7NIUADZM3S2VCZLANCNFSM4VIBESLQ>
.
--
Matteo
|
Great, thanks Matteo. Yes, the "station" ASCII data format can actually work with any target variable stored as a time series, so it seems a good idea, and a nice example to include in the documentation. Best. |
Can you tell me if there is something missing or something not needed? # Define time vector -----------------------------------------
timebase = seq(
from = lubridate::make_datetime(2010, 1, 1, 0, 0, 0),
to = lubridate::make_datetime(2012, 1, 1, 0, 0, 0),
by = 'month'
)
# Create base list -------------------------------------------
custom_stn <- list()
# Create variable --------------------------------------------
custom_stn$Variable <- list(
varName = 'myVarName',
level = NULL
)
# Coordinates ------------------------------------------------
# X and Y are coordinates, here is a structure with 2 stations
custom_stn$xyCoords <- data.frame(x = c(0,0), y = c(0,0))
attr(custom_stn$xyCoords, 'resX') <- 0
attr(custom_stn$xyCoords, 'resY') <- 0
# Dates ------------------------------------------------------
# Dates must be character
custom_stn$Dates <- list(
start = timebase %>%
as.character() %>%
str_c(' 00:00:00'),
end = (timebase+months(1)) %>%
as.character()%>%
str_c(' 00:00:00')
)
# Data -------------------------------------------------------
# Data is a matrix with time steps as rows and station as columns
custom_stn$Data <- matrix(rnorm(length(timebase) * 2), ncol = 2) %>%
unname()
attr(custom_stn$Data, 'dimensions') <- c('time', 'loc')
# Metadata ---------------------------------------------------
custom_stn$Metadata <- list(
station_id = c('a', 'b'),
name = c('a', 'b')
)
# This seems working
visualizeR::temporalPlot(custom_stn) |
I cannot find anything in the documentation, do we have an official way to load (wrap) generic time-series into an object that can be used with downscaleR?
The text was updated successfully, but these errors were encountered: