Git Product home page Git Product logo

Comments (25)

kurtisanstey avatar kurtisanstey commented on August 21, 2024 1

First, will try to replicate GM spectrum in other papers, using their input parameters (f, N, B, j*, etc.), to test validity of the code I'm using.

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024 1

"somehow it now seems to line up" is too mysterious. Something must have changed. I note that your value of N is very low, and looking at your N2 plot, I'm not sure how you get such a low value from the data. You use "round" to format the data, please don't do that, rather format in the f-string '{N2:1.2e}'. But if that is not the problem, I'm not sure what is. density appears to go from 1027.5 to 1031 or so, so dr/dz *g/r = 3.7e-5, not 1.0e-5.

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024 1

Yes - KE = u^2+v^2 so if you are showing u^2 and v^2 separately you need to reduce the spectrum appropriately. The 1/2 assumes that the internal waves are isotropic which of course may not be the case for your location, but 1/2 is what you would compare to.

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

The GM spectrum now appropriately maps between the inertial and buoyancy frequencies. Data for the GM spectrum is pulled from the GM folder in the main project directory, specifically gm.ipynb:
https://github.com/kurtisanstey/project/blob/master/GM/gm.ipynb

However, the GM spectrum is on average an order of magnitude higher than the ADCP spectrum. This does not appear to be the case in my reading, where the PSD at topography is similar or more energetic than the GM spectrum, which is designed for open ocean cases. I would expect there to be more energy in the spectrum, near topography, though I'm not positive on that. See the following figure:
https://github.com/kurtisanstey/project/blob/master/psd_plots/psd_slope_2017.pdf

Removing the factor of 2pi from the amplitude of the GM spectrum sets it perfectly with the PSD, but it seems appropriate for the code (as the freq range is divided by 2pi to convert to Hz) and I can't just remove that factor without justification. Perhaps the GM spectrum is higher?

I have also found no mention of a rotary GM spectrum, as of yet.

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024
  • bad input parameter?
  • Hz rad/s issues?
  • data could be wrong?

Debug steps:

  • other papers?

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

I believe I've got it. It wasn't replicating GM spectra I could find in papers, so I went back through the variables and re-ran all of my calculations, and nothing happened. So I started everything from scratch from the GM test code example and somehow it now seems to line up! I still need to check it one more time versus a test case from a paper, to make sure.

See an example, here:
https://github.com/kurtisanstey/project/blob/master/psd_plots/psd_slope_2017.pdf

I also found a mistake in my depth average spectra, while scouring my other code to see if my PSD are wrong, so that's good news, too. Its effects appear to be negligible, anyways.

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

Certainly, something must have changed. The version I was using before must have had a mistake that I couldn't find, though I thought I scoured it.

I did check my N^2 code and it seemed appropriate, and the Seawater package seems reputable and trustworthy, but I will definitely do it again to make sure.

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024

OK but the numbers have to make sense with the density profile....

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

Hi Jody. I'm not picking up on any mistakes as I recheck, but you may be able to pick up on something if I describe my process:

  • Import pressure, temperature, salinity data, and these are in appropriate units.
  • Latitude is correct.
  • Calculate rho through depth, using Seawater, and the profile looks OK when plotted, though I could be missing something here regarding the profile.
  • Calculate N2 at mid-depths, using Seawater, generating the profile that appears OK to me when compared to other papers, though they aren't necessarily for Barkley Canyon.
  • Take the lower depth average of N2 (-200 m to -900 m), which gives 1.038e-5 (rad/s)^2. If I instead take -100 m to -900 m, corresponding to my ADCP range, the depth average only changes to 1.663e-5 (rad/s)^2.
  • Take the square root of this lower depth average for the GM process.
  • Approximate the surface N from the uppermost N2 value (GM process uses 'extrapolated surface N'), though I could just use the value from the test GM case where they use 5.2e-3 rad/s. Is this supposed to be at the surface interface, or just below it?

This is also only for one season (summer 2013), though results do not vary much between seasons and years.

*** All I can think of is that using the lower depth average in the GM process isn't a good idea, as the GM process specifically uses -1000 m depth for their N value. Any insight on this? ***

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024

@kurtisanstey can you show all this somehow rather than just telling me? N^2 is linear so <N^2>_{-900}^{+200} should be pretty close to g/\rho (\sigma_theta_900 - \sigma_theta_200}/700 m. What are you plotting in that figure I saw? rho or sigma_theta? If rho, then please (also?) plot sigma_theta.

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

@jklymak , I certainly can. I have to bike to campus now for our meeting and then class, but that can be next on the to-do list. Plotted in the figure is density, but I will plot sigma-theta as soon as I can. Thanks for your help!

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

N^2
Replot and rescale density and buoyancy data.

Rotary GM
Find a process to compare GM to rotary spectra.

  • Gregg & Kunze ~1991, Santa Monica Basin. Use this for a GM reference guide (convert energy > shear/strain; Jody's GM toolbox may be useful for conversion). However, all of their plotted spectra are based on wavenumber k.
  • Determine how they created a rotary GM spectrum, ask Jody if can't determine. Figure 9 caption says it comes from Hickey's mooring in 1989, but the reference for Hickey (1991) doesn't seem to contain this information. It doesn't appear to be in the GM76 reference for Cairns and Williams (1976), or the Garrett and Munk (1975) reference, either. However, it's possible that information in these was enough for Gregg and Kunze to develop their own process, and I just don't understand it enough to see where. I'll keep looking through the references.
  • Alford 2012 simply plots the normal GM76 spectrum against the two rotary spectra; see comparison plot, below.

GM mistakes
Build a case why my new GM process is working correctly.

  • I cannot find the mistake. I cannot access past checkpoints using Jupyter Notebook. I assume that N was input in Hz instead of rad/s, or as N2, or with an incorrect exponent for the scientific notation (other values were standard for theory and f lined up when plotted).
  • Ask Jody about Jupyter extension to auto-save as a Python file, as checkpoints don't work.
  • Compare with Alford et al., 2012, in gm-check.ipynb. My GM81 process lines up very close to the GM76 plotted GM spectrum in Alford 2012. However, they are not absolutely perfect; the slope for GM76 appears slightly more negative than for my GM81 (GM76 intersects the x-axis at ~1.1e1 cpd, while GM81 intersects at ~2.1e1 cpd). As the slope is a crucial component of the GM spectrum, I believe this is quite problematic; however, this difference could be due to subtle changes between GM76 and GM79 (which GM81 is based on), or specific values used by Alford that are not mentioned in the paper that differ from the standard values in the GM79 documentation. Notably, a slightly lower value of N can alter this slope, as it was assumed that from the paper was used for the GM spectrum, but this may not be the case. See plot:
    https://github.com/kurtisanstey/project/blob/master/GM/gm_compare.png

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024

https://journals.ametsoc.org/jpo/article/32/11/3166/9941/A-Modification-of-the-Garrett-Munk-Internal-Wave

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024
  • 10.1029/2010rg000329 Polzin Lvov

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024

https://github.com/mwouts/jupytext for keeping jupyter notebook as markdown

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024

Bathy: http://cproof.uvic.ca/gliderdata/bathy/british_columbia_3_msl_2013.nc

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024
  • Apply Jupytext extension for future troubleshooting.
  • Plot potential temperature, not temperature. Sample plot:
    https://github.com/kurtisanstey/project/blob/master/N2_plots/N2_lower_Summer_2013.pdf
  • Only plot KE spectrum for GM, this helps line things up with Alford, but it's still off by a factor of 2. I cannot find a paper with explicit parameters for their GM spectrum; I checked about 30.
  • Read Levine 2002 and Polzin 2010 for GM rotary spectra, and check references if needed. Compare to Gregg and Kunze 1991.

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

@jklymak for my individual cross- or along-slope PSD plots, is the GM spectrum also halved (as in the rotary case)? I would assume so, as they must be added together for the total kinetic energy.

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

@jklymak some GM and rotary GM stuff, for today. Working on getting 55 kHz Axis data properly formatted.

Question: I believe I should find another rotary GM case to compare with, but I believe that the Levine method is more appropriate since it was also used in Gregg & Kunze. What do you think?

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

@jklymak not sure if I add a tag to an edited post if it flags you. See the above post for details.

Summary: GM spectra lining up with comparisons, now. Rotary GM spectra are coming along, but Levine and Polzin do it differently. I believe the Levine one is better, as it lines up better Gregg & Kunze 1991.

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024
  • Use 1D vector arrays processes instead of loops, when possible.
  • Levine 1986, Levine 1997, Levine 2002, and Polzin 2011 all reference the (omg-f)^2 and (omg+f)^2 relationship for the ratio between CCW and CW components of velocity spectra. However, they all use a modified GM process that has adjusted slope and variance for "better fit" (mine is based on standard GM79, so it doesn't line up with theirs perfectly). I found many other rotary spectra in papers, but absolutely no luck finding anything that also plots a GM rotary spectra. I'm surprised it isn't more common.
  • Summary: Somehow most plots (Polzin, and Gregg & Kunze) match closer with the non-squared process, but all of the Levine and Polzin theory agrees on the squared relationship. I feel that the squared relationship is the accepted form, but I have no way to confirm that what I'm doing is correct, or why the non-squared form seems to provide better fits.
    Example: https://github.com/kurtisanstey/project/blob/master/archive/GM/test/polzin_comparison.png

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

@jklymak see this GM issue, along with the canyon flow issue, for this week's updates. Unfortunately, I've run into some trouble with both.

from internal_waves_barkley_canyon.

jklymak avatar jklymak commented on August 21, 2024

https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/JC083iC01p00479

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024
  • Finish reading IWEX paper (above) for rotary details. They use the relationship (w+f/w-f)^2.
  • Use current rotary GM process to being analysing rotary spectra.

from internal_waves_barkley_canyon.

kurtisanstey avatar kurtisanstey commented on August 21, 2024

Using rotary GM process to begin analysing general rotary spectra. Consistency relation confirmed as S+/S- = (w-f / w+f)^2, from IWEX and other sources (see Nelson et al., 2019, p. 6).

from internal_waves_barkley_canyon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.