

# Create an initial dataset

using NveData
using DataFrames
using Dates

stat_list = ["2.11","2.28","2.32","2.142","2.145","2.265","2.268","2.279", "2.291","2.323","2.439","2.463","2.479",
            "2.604","2.614","2.633","2.634","3.22","6.10","6.71","8.2","8.6","12.70","12.97","12.114","12.150","12.171",
            "12.178","12.192","12.193","12.209","12.215","12.286","12.290","15.15","15.21","15.49","15.53","15.53",
            "15.79","15.79","15.174","16.66","16.75","16.122","16.132","16.140","16.193","18.10","19.107","20.2",
            "21.47","22.4","22.16","22.16","22.22","24.8","24.9","25.24","25.32","26.20","26.26","26.26","26.29",
            "27.16","27.24","28.7","35.16","36.9","41.1","42.2","46.9","48.1","48.5","50.1","50.13","50.13","55.4",
            "55.5","62.5","62.10","62.10","62.18","72.5","73.27","75.23","76.5","76.5","77.3","78.8","79.3","82.4",
            "82.4","83.2","84.11","84.11","86.12","87.10","88.4","97.1","98.4","103.1","103.40","104.23","105.1",
            "107.3","109.9","109.29","109.42","112.8","121.20","122.9","122.11","122.17","123.31","124.2","127.11",
            "127.13","133.7","138.1","139.15","139.35","148.2","151.15","152.4","156.10","157.3","160.7","161.7",
            "163.5","165.6","168.2","173.8","174.3","174.11","177.4","191.2","196.35","200.4","203.2","206.3",
            "208.3","212.10","212.27","212.49","223.2","230.1","234.13","234.18","247.3","311.6","311.460","313.10"]

stat_list = unique(stat_list)

time_vec = floor(now()-Day(20), Day):Day(1):floor(now()-Day(10), Day)

save_folder = "/home/jmg/temp"

init_dataset(stat_list, time_vec, save_folder)

# Update an existing dataset

using NveData
using DataFrames

save_folder = "/home/jmg/temp/"

stat_list = readdir(save_folder)
stat_list = [replace(x, "_data" => "") for x in stat_list]
stat_list = [replace(x, "_" => ".") for x in stat_list]

update_dataset(stat_list, save_folder)

