Effacer les filtres
Effacer les filtres

Collect several satellite images from the INPE/CPTEC collection

1 vue (au cours des 30 derniers jours)
I have this script below to download ONLY ONE satellite image from channel 11 (infrared) for 11/10/2022 at 19:20 GMT.
QUESTION 1
But what I really want now is to download ALL of his imagesfrom 00:00 GMT to 23:50 GMT.
QUESTION 2
Another code I want is to specify the times, being for the same day but from 00:00 UTC to 02:00 UTC.
% Website below with the collection of images from INPE/CPTEC
% http://satelite.cptec.inpe.br/acervo/goes16.formulario.logic
% The script below downloads only an image from the INPE/CPTEC collection
% Specify the filename (URL).
filename = 'http://satelite.cptec.inpe.br/repositoriogoes/goes16/goes16_web/ams_ret_ch11_baixa/2022/11/S11635384_202211011920.jpg';
% Read it in to a variable in my m-file.
rgbImage = imread(filename);
% Display the image.
imshow(rgbImage);
% Save the image to a file on my local hard drive.
imwrite(rgbImage, 'satellite image.jpg'); % imwrite(rgbImage, 'satellite image.png')
Best regards,
AP

Réponse acceptée

Mathieu NOE
Mathieu NOE le 14 Nov 2022
hello Augusto
try this code
as far as I could find out there are pictures available with a time delta of 10 minutes
choose the option to get the result for question Q1 or Q2 :
%% options
option = 1 % : to download ALL of his images from 00:00 GMT to 23:50 GMT
% option = 2 % : to download images from 00:00 UTC to 02:00 UTC
all the best
full code :
% GMT stands for Greenwich Mean Time. UTC is known as Universal Time. UTC is 0 hours ahead of GMT.
% So, when it is 11:00 am GMT it will be 11:00 am UTC
% in short : Coordinated Universal Time is the same as in Greenwich Mean Time
% date and time intervals
day_date = '20221101';
% images are available by 10 minutes interval
%% options
option = 1 % : to download ALL of his images from 00:00 GMT to 23:50 GMT
% option = 2 % : to download images from 00:00 UTC to 02:00 UTC
httpsUrl = "http://satelite.cptec.inpe.br/repositoriogoes/goes16/goes16_web/ams_ret_ch11_baixa/2022/11/S11635384_";
%% loop every 10 minutes name
mm = 00; % start minutes at 00
hh = 00; % start hours at 00
iter = 0;
while 1 % indeed there are 145 pictures distant of 10 minustes in one day (from 00:00 GMT to 23:50 GMT)
iter = iter + 1;
if mm == 60
mm = 00;
hh = hh+1; % update hours
end
%% option 1
if option == 1 && hh == 24
break
end
%% option 2 : to download images from 00:00 UTC to 02:00 UTC
if option == 2 && hh == 02 && mm == 10
break
end
if hh<10
str_hh = ['0' num2str(hh)];
else
str_hh = num2str(hh);
end
if mm<10
str_mm = ['0' num2str(mm)];
else
str_mm = num2str(mm);
end
hh_mm_str = [str_hh str_mm];
mm = mm+10; % update minutes
%%%%%%%%%%%%%%%%%%%% main code %%%%%%%%%%%%%%%%%%
filename = ['S11635384_' day_date hh_mm_str '.jpg'];
disp(strcat(filename, " is processed"));
filename_url = ['http://satelite.cptec.inpe.br/repositoriogoes/goes16/goes16_web/ams_ret_ch11_baixa/2022/11/' filename];
% Read it in to a variable in my m-file.
rgbImage = imread(filename_url);
% % Display the image.
% imshow(rgbImage);
% Save the image to a file on my local hard drive.
imwrite(rgbImage,filename);
end
  2 commentaires
Augusto Gabriel da Costa Pereira
thank you Mathieu
your code worked perfectly.
Mathieu NOE
Mathieu NOE le 15 Nov 2022
as always, my pleasure !

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by