Обновление
This commit is contained in:
@@ -61,20 +61,7 @@ for i=1:str
|
||||
end
|
||||
end
|
||||
|
||||
function extract_data_fun(sattelite, year, month, type_sensor)
|
||||
foldername=['DATA/f' num2str(sattelite) '/' type_sensor '/' num2str_new(year,4) '/' num2str_new(month,2)];
|
||||
target=ls(foldername);
|
||||
[str row]=size(target);
|
||||
for i=1:str
|
||||
if target(i,end-2:end)=='.gz'
|
||||
message=['Распаковка:',target(i,:),'\n'];
|
||||
fprintf(message);
|
||||
gunzip([foldername,'/',target(i,:)],foldername);
|
||||
message=['Распакован\n'];
|
||||
fprintf(message);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function download_fun(sattelite, year, month, type_sensor)
|
||||
% https://satdat.ngdc.noaa.gov/dmsp/data/f18/ssies/2020/05/
|
||||
@@ -93,10 +80,13 @@ for i=1:length(url)
|
||||
url_file = [url_site url(i).file];
|
||||
filename = ['DATA/f' num2str(sattelite) '/' type_sensor '/' num2str_new(year,4) '/' num2str_new(month,2) '/' url(i).file];
|
||||
mkdir(['DATA/f' num2str(sattelite) '/' type_sensor '/' num2str_new(year,4) '/' num2str_new(month,2)])
|
||||
outfilename = websave(filename,url_file);
|
||||
message='скачано\n';
|
||||
fprintf(message);
|
||||
|
||||
if ~exist(filename,'file')
|
||||
outfilename = websave(filename,url_file);
|
||||
message='скачано\n';
|
||||
else
|
||||
message='уже есть\n';
|
||||
end
|
||||
fprintf(message);
|
||||
end
|
||||
|
||||
a=1;
|
||||
|
||||
Reference in New Issue
Block a user