-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,404 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
function [Gout] = ADDfd2gage(Gin,Riv,ST,svnm); | ||
CL=shaperead(fullfile('C:\Users\coss.31\Documents\MATH\OSU_RA_Toolbox2018\CenterLines',strcat(Riv,'_centerline.shp'))); | ||
%unpack CL | ||
Xline = [CL.X]; | ||
Yline = [CL.Y]; | ||
Xg=Gin.Lon;Yg=Gin.Lat; | ||
FD = CL.Flow_Dist; | ||
%reproject center;ine | ||
ZONE = utmzone(Yline, Xline); | ||
mstruct = defaultm('utm'); | ||
mstruct.zone = ZONE; | ||
mstruct.geoid = almanac('earth','wgs84','meters'); | ||
mstruct = defaultm(mstruct); | ||
[Xline,Yline]=mfwdtran(mstruct,Yline,Xline); | ||
Xline = smooth(Xline); | ||
Yline = smooth (Yline); | ||
[Xg,Yg]=mfwdtran(mstruct,Yg,Xg); | ||
[blork DX]= min(abs(sqrt(( Xg-Xline).^2 + ( Yg- Yline).^2 ))); | ||
Gout=Gin; | ||
Gout.GageFLdist=CL(DX).Flow_Dist; | ||
Gout.RIVER=Riv; | ||
Cut1=ST(length(Riv)+1:end); | ||
Cut2=Cut1(1:end-6); | ||
Gout.Station=Cut2; | ||
DATE=Gout.DATE; | ||
Lat=Gout.Lat; | ||
Lon=Gout.Lon; | ||
stage=Gout.stage; | ||
GageFLdist=Gout.GageFLdist; | ||
RIVER=Gout.RIVER; | ||
Station=Gout.Station; | ||
if isfield(Gout,'flags') | ||
flags=Gout.flags; | ||
ice=Gout.ice; | ||
save(svnm,'DATE','Lat','Lon','flags','ice','stage','GageFLdist','RIVER','Station'); | ||
else | ||
save(svnm,'DATE','Lat','Lon','stage','GageFLdist','RIVER','Station'); | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
clear all | ||
|
||
R0e=785e3; %Envisat = 785; jason-2 = 1336 | ||
R0j=1336e3; | ||
Re=6371*1000; % km x 1000 = m | ||
c=3e8; %m/s | ||
tau=3.125e-9; %pulse length | ||
Hw=0:15; | ||
|
||
re=((c.*tau + 2.*Hw).*R0e./(1+R0e./Re)).^.5; | ||
rj=((c.*tau + 2.*Hw).*R0j./(1+R0j./Re)).^.5; | ||
|
||
plot(Hw,re./1000,Hw,rj./1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
%read in shapefile and change field names for new alt | ||
clc; clear all; close all; | ||
Newdir=0 | ||
ONEriv='Ayeyarwada' | ||
INalt='Jason3' | ||
INorbit='Jason' | ||
INdr='C:\Users\coss.31\Documents\MATH\OSU_RA_Toolbox2018\INshapes' | ||
RIVdir='C:\Users\coss.31\Documents\MATH\OSU_RA_Toolbox2018\INDB' | ||
EULERdir='C:\Users\coss.31\Documents\MATH\EULER_OUT' | ||
Rivers=load(fullfile(RIVdir,'Rivlist.mat')); | ||
%rate! | ||
RATE(1).N = 'Topex'; | ||
RATE(1).R = '10hz'; | ||
RATE(2).N = 'Jason1'; | ||
RATE(2).R='20hz'; | ||
|
||
if isempty(ONEriv) | ||
R=Rivers.World; | ||
else | ||
R={ONEriv}; | ||
end | ||
|
||
for i=1:length(R) | ||
if strcmp(INorbit,'Jason') | ||
if isfile(fullfile(INdr,strcat(R{i},'_','Jason2V2.shp'))); | ||
BaseFile=shaperead(fullfile(INdr,strcat(R{i},'_','Jason2V2.shp'))) | ||
Ofile=BaseFile; | ||
for j=1:length(BaseFile) | ||
%id | ||
Ofile(j).Station_ID=strcat(R{i},'_',INalt,'_',num2str(BaseFile(j).Id)); | ||
%rate | ||
% NRD=strfind([RATE.N],INalt); | ||
% NEWrate=RATE(NRD).R; | ||
% Ofile(j).rate= NEWrate; | ||
end | ||
if Newdir | ||
mkdir(EULERdir,strcat(R{i},'_',INalt)) | ||
shapewrite(Ofile,fullfile(EULERdir,strcat(R{i},'_',INalt),strcat(R{i},'_',INalt,'.shp'))); | ||
else | ||
shapewrite(Ofile,fullfile(INdr,strcat(R{i},'_',INalt,'.shp'))); | ||
end | ||
%shapeinfo(fullfile(INdr,strcat(R{i},'_',INalt,'.shp'))); | ||
end | ||
end | ||
if strcmp(INorbit,'Envisat') | ||
if isfile(fullfile(INdr,strcat(R{i},'_','EnvisatV2.shp'))); | ||
BaseFile=shaperead(fullfile(INdr,strcat(R{i},'_','EnvisatV2.shp'))) | ||
Ofile=BaseFile; | ||
for j=1:length(BaseFile) | ||
Ofile(j).Station_ID=strcat(R{i},'_',INalt,'_',num2str(BaseFile(j).Id)); | ||
end | ||
shapewrite(Ofile,fullfile(INdr,strcat(R{i},'_',INalt,'.shp'))); | ||
%shapeinfo(fullfile(INdr,strcat(R{i},'_',INalt,'.shp'))); | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
%run Chan's USGS reader here on the rivers in Toggle | ||
function RUNgh(Toggle) | ||
%identify relevant gages by river name | ||
[NUM,TXT,RAW]=xlsread(fullfile(Toggle.USGSlistdir,'USGS_Selected_Site.xlsx'),1); | ||
k=1; | ||
for i = 1:length(Toggle.Curriv) | ||
for j = 1:length(TXT) | ||
if strcmp(Toggle.Curriv(i),cell2mat(TXT(j,6))) | ||
check(k)=j; | ||
k=k+1; | ||
end | ||
end | ||
end | ||
if exist('check','var'); | ||
CHKdb=RAW(check,:); | ||
for i = 1:length(CHKdb) | ||
RIV=cell2mat(CHKdb(i,6)); | ||
gh(strcat(num2str(cell2mat(CHKdb(i,1))),'.xml'),Toggle,RIV); | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.