-
Notifications
You must be signed in to change notification settings - Fork 1
/
createDataSetStatus_FunctionReport.m
68 lines (60 loc) · 2.21 KB
/
createDataSetStatus_FunctionReport.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
%% Writting Report
%Read previous report
FileNameInforme=strcat(PaginaWebDir,'/data/report',DataSetName,'Status.mat');
if exist(FileNameInforme,'file')>0
InformeOld=load(FileNameInforme);
Incremento=DataArgoEs.iactiva-InformeOld.iactiva;
else
Incremento=0;
end
%Last Profiles
PUD=find(DataArgoEs.FechaUltimoPerfil>=now-DiasAnalisis);
PUDT=[];
for ipud=1:length(PUD)
PUDT=[PUDT sprintf(' https://www.argoespana.es/float/%7d.html\n',DataArgoEs.WMO(PUD(ipud)))];
end
%Write the new report
if Incremento==0
Informe1=sprintf('%sStatusGraficos - Activos (%d) \n',DataSetName,DataArgoEs.iactiva);
Informe5='';
elseif Incremento>0
IWMO=setdiff(DataArgoEs.WMO,InformeOld.WMO);
IT=[];
for idif=1:length(IWMO)
IT=[IT sprintf('%d ',IWMO(idif))];
end
Informe1=sprintf('%sStatusFloats - Activos (%d,+%d)\n',DataSetName,DataArgoEs.iactiva,Incremento);
Informe5=sprintf(' New active: %s\n',IT);
elseif Incremento<0 && DataArgoEs.iactiva>0
IWMO=setdiff(DataArgoEs.WMO,InformeOld.WMO);
IT=[];
for idif=1:length(IWMO)
IT=[IT sprintf('%d ',IWMO(idif))];
end
Informe1=sprintf('%sStatus Floats - Activos (%d,-%d)\n',DataSetName,DataArgoEs.iactiva,Incremento);
Informe5=sprintf(' New inactive: %s\n',IT);
else
Informe1=sprintf('%sStatusGraficos - Activos (%d) \n',DataSetName,DataArgoEs.iactiva);
Informe5='';
end
Informe2=sprintf(' Ultimo perfil %s\n',datestr(DataArgoEs.FechaUltimoPerfil(1)));
if ~isempty(PUDT)
Informe3=sprintf(' Ultimos perfiles \n%s',PUDT);
else
Informe3='';
end
if strcmp(DataSetName,'ArgoEs')
if isnan(nanmin(DataArgoEs.UltimoVoltaje(DataArgoEs.activa==1)))==0
Informe4=sprintf(' Voltaje minimo %4.2f v\n https://www.argoespana.es/float/%7d.html\n',nanmin(DataArgoEs.UltimoVoltaje(DataArgoEs.activa==1)),DataArgoEs.WMO(find(DataArgoEs.UltimoVoltaje==nanmin(DataArgoEs.UltimoVoltaje(DataArgoEs.activa==1)),1)));
else
Informe4='';
end
else
Informe4='';
end
Informe6=sprintf(' Actualizado %s',datestr(now));
Informe=[Informe1 Informe2 Informe3 Informe4 Informe5 Informe6];
iactiva=DataArgoEs.iactiva;
WMO=DataArgoEs.WMO;
disp(Informe)
save(FileNameInforme,'Informe','iactiva','WMO')