rte-antares-rpackage / antaresRead

Import, manipulate and explore the results of an Antares simulation
https://rte-antares-rpackage.github.io/antaresRead/
13 stars 6 forks source link

readInputTS(hydroStorage) : time differ between Antares and readInputTS #58

Closed pvictor closed 6 years ago

pvictor commented 7 years ago

Hi, I want to read the hydro storage time series for a given area, but the timestamp between Antares and readInputTS is not the same :

TS1 TS2
January 1 13
February 2 14
March 3 15
April 4 16
May 5 17
June 6 18
July 7 19
August 8 20
September 9 21
October 10 22
November 11 23
December 12 24
readInputTS(hydroStorage = "fr" , timeStep = "monthly")
# 'antaresDataTable' object with dimension 24 x 6
#     area timeId    time month tsId hydroStorage
#  1:   fr      1 2017-07   JUL    1            1
#  2:   fr      2 2017-08   AUG    1            2
#  3:   fr      3 2017-09   SEP    1            3
#  4:   fr      4 2017-10   OCT    1            4
#  5:   fr      5 2017-11   NOV    1            5
#  6:   fr      6 2017-12   DEC    1            6
#  7:   fr      7 2018-01   JAN    1            7
#  8:   fr      8 2018-02   FEB    1            8
#  9:   fr      9 2018-03   MAR    1            9
# 10:   fr     10 2018-04   APR    1           10
# 11:   fr     11 2018-05   MAY    1           11
# 12:   fr     12 2018-06   JUN    1           12
# 13:   fr      1 2017-07   JUL    2           13
# 14:   fr      2 2017-08   AUG    2           14
# 15:   fr      3 2017-09   SEP    2           15
# 16:   fr      4 2017-10   OCT    2           16
# 17:   fr      5 2017-11   NOV    2           17
# 18:   fr      6 2017-12   DEC    2           18
# 19:   fr      7 2018-01   JAN    2           19
# 20:   fr      8 2018-02   FEB    2           20
# 21:   fr      9 2018-03   MAR    2           21
# 22:   fr     10 2018-04   APR    2           22
# 23:   fr     11 2018-05   MAY    2           23
# 24:   fr     12 2018-06   JUN    2           24
#     area timeId    time month tsId hydroStorage

A solution could be to copy and modify getOption("antares")$start before calling .importInputTS here

Or sort timeRange by months num here if inputTimeStep is monthly.

Victor

jalazawa commented 6 years ago

@pvictor , I think now it's ok on develop. I will send the new version to CRAN in may. You can test if you want...

jalazawa commented 6 years ago

done