vandersat / vds-api-client

API client for the VanderSat API
MIT License
3 stars 18 forks source link

columns mixed up in output from gen_time_series_requests #58

Closed joostbeckers closed 9 months ago

joostbeckers commented 9 months ago

The output from gen_time_series_requests is erroneous. Values in the daily and clim columns are mixed up.

Data source: VanderSat      
Creation date: 2024-01-16      
Copyright: 2024 VanderSat B.V.    
Documentation: https://docs.vandersat.com/      
Contact information: https://vandersat.com/contact/      
Unit m3/m3      
date SM.ER-SMAP-L-DESC_V2.0_100 SM.ER-SMAP-L-DESC_V2.0_100 AVG SM.ER-SMAP-L-DESC_V2.0_100 CLIM
07/01/17 0.0897 0.1371  
07/02/17 0.0942 0.0869 0.137
07/03/17 0.093 0.0869 0.1372
07/04/17 0.0869 0.1369  
07/05/17 0.0957 0.0869 0.1351
07/06/17 0.0869 0.1337  
07/07/17 0.087 0.1337  
07/08/17 0.0981 0.087 0.1328
07/09/17 0.087 0.1321  
07/10/17 0.0854 0.0862 0.1319
07/11/17 0.0882 0.0862 0.131
07/12/17 0.0862 0.1308  
07/13/17 0.0949 0.0862 0.1308
07/14/17 0.0862 0.13  
teije01 commented 9 months ago

Could you provide more details on which request was made here?

I'll try if I can reproduce it then.

Could you also attach the csv file to the issue?

joostbeckers commented 9 months ago

getTimeseriesVDS.txt roi-ts_SM-SMAP-L-DESC_V5.0_1000_2015-04-01T000000_2023-12-31T000000_810454_136a4.csv

teije01 commented 9 months ago

In the attached csv file, I cannot observe the same behavior as shown in the table you placed in the top. See e.g.

csv_fn = "roi-ts_SM-SMAP-L-DESC_V5.0_1000_2015-04-01T000000_2023-12-31T000000_810454_136a4.csv"
df = pd.read_csv(csv_fn, index_col=0, parse_dates=True, dayfirst=True, comment="#")

image

This was a different csv than yours though (or something went wrong while reading). Could you provide me the csv on which you based the table on the top? Or perhaps try the read settings for the csv (like in this comment).

teije01 commented 9 months ago

In-fact, I requested all three downloads and none of them have any data for 2017. The following 3 requests were made using gen_time_series_requests exactly how you made them (except I'm using impersonation). I can only detect valid csv files.

https://maps.vandersat.com/api/v2/products/SM-SMAP-L-DESC_V5.0_1000/roi-time-series?start_time=2015-04-01&end_time=2023-12-31&roi_id=810452&format=csv&avg_window_days=20&avg_window_direction=center&include_masked_data=false&climatology=true&provide_coverage=false

https://maps.vandersat.com/api/v2/products/SM-SMAP-L-DESC_V5.0_1000/roi-time-series?start_time=2015-04-01&end_time=2023-12-31&roi_id=810453&format=csv&avg_window_days=20&avg_window_direction=center&include_masked_data=false&climatology=true&provide_coverage=false

https://maps.vandersat.com/api/v2/products/SM-SMAP-L-DESC_V5.0_1000/roi-time-series?start_time=2015-04-01&end_time=2023-12-31&roi_id=810454&format=csv&avg_window_days=20&avg_window_direction=center&include_masked_data=false&climatology=true&provide_coverage=false

If you still think that one of the csv files is malformed, please share it in a comment.

joostbeckers commented 9 months ago

After a conda update, I get the correct results. Sorry about the trouble. I think the error was on my side.

teije01 commented 9 months ago

Glad you found it, and always happy to help