Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabrocca78 authored Jun 6, 2019
1 parent 9bb402a commit f503602
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Binary file added Matlab_example_Npoints.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions extract_Npoints_SM2RAINASCAT.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
clc,clear,close all
lonlat_ext=load('lonlat_ext.txt');

lon_=ncread(['SM2RAIN_ASCAT_0125_2018.nc'],'Longitude');
lat_=ncread(['SM2RAIN_ASCAT_0125_2018.nc'],'Latitude');

ID=knnsearch([lon_,lat_],lonlat_ext);
D=(datenum('1-jan-2007'):datenum('31-dec-2018'))';
Psim_SM2RASC=[];
for ii=2007:2018
ii
PP=ncread(['SM2RAIN_ASCAT_0125_',num2str(ii),'.nc'],'Rainfall');
Psim_SM2RASC=[Psim_SM2RASC,PP(:,ID)'];
end

% Plotting the figure
plot(D,Psim_SM2RASC)
grid on, box on
datetick
ylabel('rainfall [mm/day]')
title(['SM2RAIN-ASCAT ',num2str(size(lonlat_ext,1)),' points'])
3 changes: 3 additions & 0 deletions lonlat_ext.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
12.5 42.5
40.0 5.0
5.0 45.0

0 comments on commit f503602

Please sign in to comment.