% PREP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Rough coordinates of Rome
rome=[41.905 12.474];

% Identify the filename as stored in ~/Documents/MATLAB
fnam='data_stream-oper.nc';
% Read the data for the requested variables
% Temperature at 2m (var167)
[T,t,closestnode]=readVariableFromNetCDF(fnam,'t2m',rome);

% SELECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Select the first week of August of 2024, making the logical array
sel=sum(day(t)==[1:7],2) & month(t)==8 & year(t)==2024;
% Select the times and refer them to the first hour
tsel=t(sel);
tsel=hours(tsel-tsel(1));
% Select the temperatures and convert them to degrees Celsius
Tsel=T(sel)-273;

