-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDatasetLoader.php
More file actions
27 lines (18 loc) · 791 Bytes
/
DatasetLoader.php
File metadata and controls
27 lines (18 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
// 1. Unzip dataset.zip to a folder called dataset
// 2. Run this script to import the datasets into your local emoncms installation
$dir = getcwd();
$userid = 1;
$emoncms_dir = "/var/www/emoncms/";
$dataset = "solar2";
require "ModelHelper.php";
$data = new ModelHelper($emoncms_dir,false,false);
$result = $data->feed->create($userid,"model",$dataset,1,5,json_decode('{"interval":10}'));
print json_encode($result)."\n";
if ($result["success"]) {
$feedid = $result["feedid"];
print "copy $dir/dataset/$dataset.meta $phpfinadir"."$feedid.meta\n";
copy("$dir/dataset/$dataset.meta","$phpfinadir"."$feedid.meta");
print "copy $dir/dataset/$dataset.meta $phpfinadir"."$feedid.meta\n";
copy("$dir/dataset/$dataset.dat","$phpfinadir"."$feedid.dat");
}