This is raised by @AminFazlKazemi. Let's resolve it one by one.
Any way, I have also another request.
There is also another method for calculating LWA on isentropic surface :
Local Finite-Amplitude Wave Activity as a Diagnostic for Rossby Wave Packets
PAOLO GHINASSI, GEORGIOS FRAGKOULIDIS, AND VOLKMAR WIRTH
Institute for Atmospheric Physics, Johannes Gutenberg University Mainz,
Mainz, Germany
(Manuscript received 26 February 2018, in final form 20 August 2018)
DOI: 10.1175/MWR-D-18-0068.1.
I tried hard to modify you code to this end but in vain.
First : we need to equipartition dm = sigma * ds m being mass .
eqipartitioning of mass not area!
Second we need to integrate (q-Q) sigmads . It is necessary since
Isentropic coordinates will differ peressure sharply (maybe an isentrope is
very low altitude at equator and very high altitude at poles.
This isentropic calculation will add other properties to the resultant LWA.
I would be thankful if you can add this feature to your code.
I see your concern now. You are trying to find the equivalent latitude encompassing the same mass as associated PV contour. I read the Ghinassi's paper. I guess you can try:
calculate a discretized mass-PV relation using cal_integral_within_contour, denoted as Mi(Qi);
calculate a discretized mass-Lat relation also using cal_integral_within_contour denoted as Mi(Lati) (using latitude contours);
Interpolate to remove Mi and get Lati(Qi).
The second point you raised is straighforward when you find Lati(Qi) through Eq. (8) in 2018 paper.
This is raised by @AminFazlKazemi. Let's resolve it one by one.
I see your concern now. You are trying to find the equivalent latitude encompassing the same mass as associated PV contour. I read the Ghinassi's paper. I guess you can try:
cal_integral_within_contour
, denoted as Mi(Qi);cal_integral_within_contour
denoted as Mi(Lati) (using latitude contours);The second point you raised is straighforward when you find Lati(Qi) through Eq. (8) in 2018 paper.