Does anyone have the codes from the webinar video "Using Machine Learning and Deep Learning for Energy Forecasting with MATLAB" ?

2 visualizaciones (últimos 30 días)
Hi All,
I was able to replicate the load-related code of this video. However, the presenter does not show how the weather data was retrieved.
Only the load command is shown in the video.
Can anyone share the weather acquisition part of the webinar, please?
Thank you in advance/

Respuesta aceptada

Prasanna
Prasanna el 28 de Oct. de 2024
Hi Jorge,
The weather data acquisition for the above webinar is done from the New York ISO dataset. To retrieve historical weather load real-time data from the New York ISO, the following MATLAB code can be used. This code downloads the data, unzips it, and saves it for further processing.
% Create a directory for storing the downloaded data
if ~exist('.\Data\Sample\','dir')
mkdir('.\Data\Sample\')
end
% define the date range for data retrieval
dates = (datetime('2005-Feb-01'):calmonths(1):datetime('2006-Jan-01'));
% use parfor to download files in parallel
parfor i = 1:length(dates)
filename = [datestr(dates(i),'yyyymmdd') 'pal_csv.zip'];
url = ['http://mis.nyiso.com/public/csv/pal/' filename];
file_destination = ['Data\Sample\HistLoad' datestr(dates(i), 'yyyymmdd') '.csv.zip'];
fprintf('Downloading %d of %d. %s \n', i, length(dates), filename)
websave(file_destination, url);
end
% create a directory for unzipped files
if ~exist('.\Data\Sample\HistLoad', 'dir')
mkdir('.\Data\Sample\HistLoad');
end
% unzip the downloaded files
for i = 1:length(dates)
unzip(['Data\Sample\HistLoad', datestr(dates(i),'yyyymmdd'), '.csv.zip'], 'Data\Sample\HistLoad');
end
The above code creates a target directory, downloads the required files from the New York ISO dataset, and unzips the files into a specified directory for further analysis. For more information regarding the dataset, and the functions used in the script, refer the following resources:

Más respuestas (0)

Categorías

Más información sobre Weather and Atmospheric Science en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by