close all
clear all

stn = {'ISFS1','ISFS2','ISFS3','ISFS4','ISFS5','ISFS6','ISFS7'};
id  = {'ISFS1','ISFS2','ISFS3','ISFS4','ISFS5','ISFS6','ISFS7'};
data = {};
loc = {};

for i = 1:length(stn)

disp(stn(i))
    
temp = webread(char(strcat('http://api.mesowest.net/v2/stations/', ...
    'timeseries?stid=',stn(i),'&start=201101020000&end=201101100000', ...
    '&token=1234567890')));

data_temp = {temp.STATION.OBSERVATIONS.date_time, ...
    temp.STATION.OBSERVATIONS.net_radiation_sw_set_1, ...
    temp.STATION.OBSERVATIONS.net_radiation_lw_set_1};

data = [data; data_temp];

loc = [loc; {temp.STATION.LATITUDE, temp.STATION.LONGITUDE}];

end

save('station_data_flux.mat','loc','data')