Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TMD 2.5 to TMD 3.0 question #20

Closed
lnferris opened this issue Dec 21, 2023 · 8 comments
Closed

TMD 2.5 to TMD 3.0 question #20

lnferris opened this issue Dec 21, 2023 · 8 comments

Comments

@lnferris
Copy link

lnferris commented Dec 21, 2023

This is part of JOSS review and related to Issue 11.

This is testing a function call (tmd_extract_HC()) used in a common tidal preparation for ROMS (otps2frc_v5.m). I get that u_phase and uPh are not pseudo-equivalent. Is there a units mismatch going on?

filename='/Users/lnferris/TMD_Matlab_Toolbox_v2.5-master/TMD/DATA/Model_tpxo7.2';
[z_amp,z_phase,Depth,conList]=tmd_extract_HC(filename,lat,lon,'z',[]);
[u_amp,u_phase,~,~]=tmd_extract_HC(filename,lat,lon,'u',[]);

con = 1; % m2 from conList
figure
subplot(3,2,1)
pcolor(lon,lat,squeeze(z_amp(con,:,:)));
shading flat
colorbar
subplot(3,2,2)
pcolor(lon,lat,squeeze(z_phase(con,:,:)));
shading flat
colorbar
subplot(3,2,3)
pcolor(lon,lat,Depth);
shading flat
colorbar
subplot(3,2,4)
pcolor(lon,lat,squeeze(u_amp(con,:,:))./100);  %cm/s to m/s
shading flat
colorbar
subplot(3,2,5)
pcolor(lon,lat,squeeze(u_phase(con,:,:))); 
shading flat
colorbar

%% TMD 3.0

addpath(genpath('/Users/lnferris/Desktop/Tide-Model-Driver-main'));
filename = '/Users/lnferris/Desktop/TPXO9_atlas_v5.nc';
conList = tmd_conlist(filename);
hAm = tmd_interp(filename,'hAm',lat,lon);
hPh = tmd_interp(filename,'hPh',lat,lon);
uAm = tmd_interp(filename,'uAm',lat,lon);
uPh = tmd_interp(filename,'uPh',lat,lon);
wct = tmd_interp(filename,'wct',lat,lon);

con = 4; % m2 from conList
figure
subplot(3,2,1)
pcolor(lon,lat,squeeze(hAm(:,:,con)));
shading flat
colorbar
subplot(3,2,2)
pcolor(lon,lat,squeeze(hPh(:,:,con)));
shading flat
colorbar
subplot(3,2,3)
pcolor(lon,lat,wct);
shading flat
colorbar
subplot(3,2,4)
pcolor(lon,lat,squeeze(uAm(:,:,con)));
shading flat
colorbar
subplot(3,2,5)
pcolor(lon,lat,squeeze(uPh(:,:,con)));
shading flat
colorbar
@lnferris
Copy link
Author

Also this isn't an issue, but the TMD 3.0 code block is 3x faster; nice job.

@chadagreene
Copy link
Owner

@lnferris I don't have quite enough to replicate your code, and I'm not sure what difference you're seeing between the two results. Can you please upload the resulting figures or describe the differences you're seeing?

@kthyng
Copy link

kthyng commented Jan 2, 2024

@lnferris Can you respond here?

@lnferris
Copy link
Author

lnferris commented Jan 3, 2024

lat.csv
lon.csv
2 5
3 0

chadagreene added a commit that referenced this issue Jan 8, 2024
Specifying phase units in the documentation in response to Issue #20.
@chadagreene
Copy link
Owner

Ahh, okay, so it's just a matter of radians vs degrees. I see now that I hadn't included the angle units in the documentation.

I've just updated all the documentation to be clear that the angle units are radians. Thanks for catching this.

@lnferris
Copy link
Author

Can you mention this in your table because a subtle units change has the potential to break people's tools? I agree that radians is better but had to dig to find this difference.

@lnferris
Copy link
Author

@chadagreene you can close this issue after editing the table, I have nothing more on this issue.

chadagreene added a commit that referenced this issue Jan 10, 2024
Closing Issue #20.
@chadagreene
Copy link
Owner

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants