Commit 8bb7a8c7 authored by renzo's avatar renzo

beta 1.3

parent 5f20c05a
function []=filtro_ARGENTINA(output_path)
clear all
close all
clc
%%
%%
......@@ -270,6 +267,6 @@ function []=filtro_ARGENTINA(output_path)
fechas=[datenum(fecha4); datenum(fecha3);datenum(fecha2);datenum(fecha1);datenum(fecha0)];
save(strcat(output_path, sprintf('%1$sArgentina.mat',today)),'fechas','Atalaya','BuenosAires','LaPlata','MardelPlata','Oyarvide','PiloteNorden','SanFernando','SanClemente','SantaTeresita')
save(strcat(output_path, "/", sprintf('%1$sArgentina.mat',today)),'fechas','Atalaya','BuenosAires','LaPlata','MardelPlata','Oyarvide','PiloteNorden','SanFernando','SanClemente','SantaTeresita')
delete fileSHN_4 % Borra el CSV más antiguo ya que no volverá a ser utilizado
stop_logging
\ No newline at end of file
end
\ No newline at end of file
function []=procesar_Hycom(output_path)
%%
clc
clear
close all
%%
......@@ -76,7 +73,7 @@ function []=procesar_Hycom(output_path)
%sshcat=cat(3,sshcat,sshData1(lat_i:lat_f,lon_i:lon_f)');
%Datecat=[Datecat;DateData1];
stop_logging
end
......@@ -99,7 +96,7 @@ function []=procesar_Hycom(output_path)
Date(i+49)=DateData1;
MT(i+49)=MTData1;
stop_logging
end
......@@ -143,7 +140,7 @@ function []=procesar_Hycom(output_path)
sss(:,:,i+1)=sssData(lat_i:lat_f,lon_i:lon_f)';
%dens(:,:,i+1)=layer_densityData(lat_i:lat_f,lon_i:lon_f)';
stop_logging
end
......@@ -165,10 +162,10 @@ function []=procesar_Hycom(output_path)
sss(:,:,i+49)=sssData(lat_i:lat_f,lon_i:lon_f)';
%dens(:,:,i+49)=layer_densityData(lat_i:lat_f,lon_i:lon_f)';
stop_logging
end
save(strcat(output_path,num2str(date_file),'fn.mat'),'date_file','ssh','u_diag','v_diag','XX','YY','Date','MT','u','v','sst','sss')
save(strcat(output_path, "/", num2str(date_file),'fn.mat'),'date_file','ssh','u_diag','v_diag','XX','YY','Date','MT','u','v','sst','sss')
lugar=0;
save('lugar','lugar');
......@@ -241,7 +238,7 @@ function []=procesar_Hycom(output_path)
save(strcat(output_path,num2str(date_file),'estaciones.mat'),'LPa','MdP','MVD','PTE','StT','TOy','fecha')
save(strcat(output_path, "/", num2str(date_file),'estaciones.mat'),'LPa','MdP','MVD','PTE','StT','TOy','fecha')
%%
%Borrar *.nc
......@@ -259,4 +256,4 @@ function []=procesar_Hycom(output_path)
delete lugar.mat
delete recortar4.m
stop_logging
end
function []=procesar_copernicus(output_path)
clear all
close all
clc
%%
%%
%Obtencion de series en estaciones, Copernicus GLOBAL_ANALYSIS_FORECAST_PHY_001_024
%Obtenlion de series en estaciones, Copernicus GLOBAL_ANALYSIS_FORECAST_PHY_001_024
%Estaciones: La Paloma, Mar del Plata, Montevideo,
% Punta del Este, Santa Teresita, Torre Oyarvide
% LPa, MdP, MVD, PTE, StT, TOy
clear all
close all
clc
FILES=dir('*.nc');
file_name=FILES.name;
ncdisp(file_name);
......@@ -43,7 +35,7 @@ function []=procesar_copernicus(output_path)
for i=1:t
sshData1(:,:,i)=sshData(:,:,i)';
stop_logging
end
sshData=sshData1;
clear sshData1
......@@ -52,7 +44,7 @@ function []=procesar_copernicus(output_path)
for i=1:t
tempData1(:,:,i)=tempData(:,:,i)';
stop_logging
end
tempData=tempData1;
clear tempData1
......@@ -62,7 +54,7 @@ function []=procesar_copernicus(output_path)
for i=1:t
u1(:,:,i)=u(:,:,i)';
stop_logging
end
u=u1;
clear u1
......@@ -71,17 +63,12 @@ function []=procesar_copernicus(output_path)
for i=1:t
v1(:,:,i)=v(:,:,i)';
stop_logging
end
v=v1;
clear v1
save(strcat(output_path, num2str(name),'fnaCOP.mat'),'name','fecha','XX','YY','sshData','tempData','u','v')
%%
save(strcat(output_path, "/", num2str(name),'fnaCOP.mat'),'name','fecha','XX','YY','sshData','tempData','u','v')
clear all
close all
clc
FILES=dir('*fnaCOP.mat');
file_name=FILES.name;
......@@ -118,8 +105,8 @@ function []=procesar_copernicus(output_path)
TOy=squeeze(sshData(IndAproxLAT,IndAproxLON,:));
save(strcat(output_path, num2str(name),'estacionesCOP.mat'),'LPa','MdP','MVD','PTE','StT','TOy','fecha')
save(strcat(output_path, "/", num2str(name),'estacionesCOP.mat'),'LPa','MdP','MVD','PTE','StT','TOy','fecha')
delete *-1.nc
%delete Estaciones_Copernicus1.m
stop_logging
\ No newline at end of file
end
\ No newline at end of file
function []=procesar_noaa(output_path, day, nctoolbox_path)
clear all
close all
clc
%%
run(nctoolbox_path)
formatted_date = datestr(now, 'yyyymmdd');
......@@ -92,7 +87,7 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
for i=10:99
url=strcat('gfs.t00z.pgrb2.0p25.f0',num2str(i),'');
......@@ -125,7 +120,7 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
for i=100:120
url=strcat('gfs.t00z.pgrb2.0p25.f',num2str(i),'');
......@@ -158,14 +153,14 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
%datevec(fecha)
save(strcat(output_path, formatted_date,'noaa00.mat'),'date','fecha','lat','lon','h','u_10','v_10','P_sup','hora')
save(strcat(output_path, "/", formatted_date,'noaa00.mat'),'date','fecha','lat','lon','h','u_10','v_10','P_sup','hora')
if day == "yesterday"
......@@ -252,7 +247,7 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
for i=10:99
url=strcat('gfs.t06z.pgrb2.0p25.f0',num2str(i),'');
......@@ -285,7 +280,7 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
for i=100:120
url=strcat('gfs.t06z.pgrb2.0p25.f',num2str(i),'');
......@@ -318,14 +313,14 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
%datevec(fecha)
save(strcat(output_path, formatted_date,'noaa06.mat'),'date','fecha','lat','lon','h','u_10','v_10','P_sup','hora')
save(strcat(output_path, "/", formatted_date,'noaa06.mat'),'date','fecha','lat','lon','h','u_10','v_10','P_sup','hora')
%%
......@@ -410,7 +405,7 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
for i=10:99
url=strcat('gfs.t12z.pgrb2.0p25.f0',num2str(i),'');
......@@ -443,7 +438,7 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
for i=100:120
url=strcat('gfs.t12z.pgrb2.0p25.f',num2str(i),'');
......@@ -476,14 +471,14 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
%datevec(fecha)
save(strcat(output_path, formatted_date,'noaa12.mat'),'date','fecha','lat','lon','h','u_10','v_10','P_sup','hora')
save(strcat(output_path, "/", formatted_date,'noaa12.mat'),'date','fecha','lat','lon','h','u_10','v_10','P_sup','hora')
......@@ -571,7 +566,7 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
for i=10:99
url=strcat('gfs.t18z.pgrb2.0p25.f0',num2str(i),'');
......@@ -604,7 +599,7 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
for i=100:120
url=strcat('gfs.t18z.pgrb2.0p25.f',num2str(i),'');
......@@ -637,20 +632,20 @@ function []=procesar_noaa(output_path, day, nctoolbox_path)
fecha(i+1)=datenum(date)+datenum(0,0,0,hora(i+1),0,0);
stop_logging
end
%datevec(fecha)
save(strcat(output_path, formatted_date,'noaa18.mat'),'date','fecha','lat','lon','h','u_10','v_10','P_sup','hora')
save(strcat(output_path, "/", formatted_date,'noaa18.mat'),'date','fecha','lat','lon','h','u_10','v_10','P_sup','hora')
% [XX,YY]=meshgrid(lon,lat);
% figure;contourf(XX(:,:),YY(:,:),P_sup(:,:,1))
% set(gca,'xlim',[-60,-50])
% set(gca,'ylim',[-40,-30])
stop_logging
end
nc=[];
delete gfs*
stop_logging
\ No newline at end of file
end
\ No newline at end of file
import os
import subprocess
from datetime import date, timedelta
import re
import shutil
import metadata
import main
from shutil import copy
......@@ -31,7 +27,7 @@ def create_matlab_call(script_name, source, optional_args):
# Get Matlab call arguments that match signature
args = ""
for param in signature:
if param in optional_args:
if param in optional_args and optional_args[param]:
args += " " + optional_args[param]
elif hasattr(metadata, source) and param in getattr(metadata, source):
args += " " + getattr(metadata, source)[param]
......@@ -41,10 +37,11 @@ def create_matlab_call(script_name, source, optional_args):
raise RuntimeError("El script de Matlab " + script_name + " recibe los parámetros " + str(signature)
+ ", pero " + param + " no se ha proporcionado al llamar al script, ni se encuentra"
"en el archivo de configuración del proyecto")
return "matlab - nodisplay - nosplash - r \"try, " + script_name + args \
+ ", catch me, fprintf('%s / %s\n',me.identifier,me.message), exit(1), stop_logging, exit(0)\""
# ARRANCAR DESDE ACA
return "matlab -nodisplay -nosplash -r \"try, " + script_name + args \
+ ", catch me, fprintf('%s / %s\\n',me.identifier,me.message), exit(1), end, exit(0)\""
def process(source, optional_args):
config = getattr(metadata, source)
for script in config["process"]:
......@@ -70,4 +67,4 @@ def clean(root):
break
for path in delete:
if path != root:
shutil.rmtree(path)
shutil.rmtree(path)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment