-
Notifications
You must be signed in to change notification settings - Fork 1
/
createDataSetTable.m
122 lines (108 loc) · 4.17 KB
/
createDataSetTable.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
clear all;close all
%Crea la pagina argoesstatus.html con el google mapa de las posiciones de
%las boyas Argo-Es y las Argo-In
%% Read configuration
configWebPage
%CoberturaArgoGlobal, para calcular el porcentajes
CoberturaArgoGlobal=4000;
%CoberturaArgoMed
CoberturaArgoMed=100;
%% Begin
fprintf('>>>>> %s\n',mfilename)
% Read Data
DataArgoEs=load(strcat(PaginaWebDir,'/data/dataArgoSpain.mat'), ...
'activa','iactiva','iinactiva','inodesplegada','FechaUltimoPerfil','WMO','UltimoVoltaje','UltimoSurfaceOffset');
BoyasActivaArgoEs=DataArgoEs.iactiva;
%Numero total de perfiles medidos
NTotalPerfiles=0;
for ifloat=1:length(DataArgoEs.WMO)
FloatData=load(fullfile(DirArgoData,'Floats',num2str(DataArgoEs.WMO(ifloat))));
NTotalPerfiles=[NTotalPerfiles nanmax(FloatData.HIDf.cycle)'];
end
%Numero total de perfiles medidos en el Med
BoyasActivaArgoEsMed=0;
for ifloat=1:length(DataArgoEs.WMO)
FloatData=load(fullfile(DirArgoData,'Floats',num2str(DataArgoEs.WMO(ifloat))));
if strcmp(FloatData.MTDf.FLOAT_OWNER,'SOCIB')
BoyasActivaArgoEsMed = BoyasActivaArgoEsMed + 1;
end
end
%% Begin
fprintf('>>>>> %s\n',mfilename)
fid = fopen(FileTableArgoEsStatus,'w');
fprintf(' > Writting Google Earth file \n');
fprintf(fid,'<!DOCTYPE html> \n');
fprintf(fid,'<html> \n');
fprintf(fid,'<head> \n');
fprintf(fid,'<meta name="viewport" content="width=device-width, initial-scale=1"> \n');
fprintf(fid,'<style> \n');
fprintf(fid,'table { \n');
fprintf(fid,'text-align: center; \n');
fprintf(fid,'margin-left: auto; \n');
fprintf(fid,'margin-right: auto; \n');
fprintf(fid,'max-width: 100%%; \n');
fprintf(fid,'background-attachment: fixed; \n');
fprintf(fid,'font-weight: bold; \n');
fprintf(fid,'border-collapse: collapse; \n');
fprintf(fid,'font-family: Montserrat; \n');
fprintf(fid,'} \n');
fprintf(fid, '@font-face { font-family: "Arial"; src: url("https://fonts.googleapis.com/css?family=Arial"); }\n');
fprintf(fid,' h1 { \n');
fprintf(fid,'font-family: Arial \n');
fprintf(fid,'} \n');
fprintf(fid,'td { \n');
fprintf(fid,'border: 10px solid #00A2DD; \n');
fprintf(fid,'font-weight: bolder; \n');
fprintf(fid,'color:#FFFFFF; \n');
fprintf(fid,'font-weight: 700; \n');
fprintf(fid,'font-size: 14px; \n');
fprintf(fid,'text-align: center; \n');
fprintf(fid,'width: calc(20%%); padding: 10px; \n');
fprintf(fid,'overflow: hidden; \n');
fprintf(fid,'font-size: 1vw; /* <---- the viewport relative font-size */ \n');
fprintf(fid,'background-color: #00A2DD \n');
fprintf(fid,'} \n');
fprintf(fid,'th { \n');
fprintf(fid,'border: 10px solid #00A2DD; \n');
fprintf(fid,'color:#FFFFFF; \n');
fprintf(fid,'font-weight: 900; \n');
fprintf(fid,'font-size: 70px; \n');
fprintf(fid,'text-align: center; \n');
fprintf(fid,'width: calc(20%%); padding: 10px; \n');
fprintf(fid,'overflow: hidden; \n');
fprintf(fid,'font-size: 8vw; /* <---- the viewport relative font-size */ \n');
fprintf(fid,'background-color: #00A2DD \n');
fprintf(fid,'} \n');
fprintf(fid,'tr:nth-child(even) { \n');
fprintf(fid,'background-color: #00A2DD; \n');
fprintf(fid,'text-align: center; \n');
fprintf(fid,'} \n');
fprintf(fid,'</style> \n');
fprintf(fid,'</head> \n');
fprintf(fid,'<body> \n');
fprintf(fid,'<center> \n');
fprintf(fid,'<table> \n');
fprintf(fid,'<tr> \n');
fprintf(fid,' <th>%d</th> \n',BoyasActivaArgoEs);
fprintf(fid,' <th>%d</th> \n',sum(NTotalPerfiles));
fprintf(fid,' <th>%3.1f%%</th> \n',BoyasActivaArgoEs/CoberturaArgoGlobal*100);
fprintf(fid,' <th>%3.1f%%</th> \n',BoyasActivaArgoEsMed/CoberturaArgoMed*100);
fprintf(fid,'</tr> \n');
fprintf(fid,'<tr> \n');
fprintf(fid,'<td>PERFILADORES</td> \n');
fprintf(fid,'<td>PERFILES OCEANOGRÁFICOS</td> \n');
fprintf(fid,'<td>COBERTURA GLOBAL</td> \n');
fprintf(fid,'<td>COBERTURA MEDITERRÁNEA</td> \n');
fprintf(fid,'</tr> \n');
fprintf(fid,'</table> \n');
fprintf(fid,'</div> \n');
fprintf(fid,'</center> \n');
fprintf(fid,'</body> \n');
fprintf(fid,'</html> \n');
fclose(fid);
%% Ftp the file
fprintf(' > Uploading %s \n',FileTableArgoEsStatus);
ftpobj=FtpArgoespana;
var=cd(ftpobj,ftp_dir_html);
outftp=mput(ftpobj,FileTableArgoEsStatus);
fprintf('%s <<<<< \n',mfilename)