Giter VIP home page Giter VIP logo

Comments (10)

willaguiar avatar willaguiar commented on September 16, 2024 1

Hi Fabio

Doesn't np.arange skips the last instance of the count? perhaps the second argument of the np.arange should be something like u_along_da_seasons_masked.lon[-1]+(lon_bin/2)

from asc_and_heat_transport.

willaguiar avatar willaguiar commented on September 16, 2024

Hi! Even tho the midpoints are 0.25deg apart, the first binning process have a bin width of 3 degs. so -278.5 mid_point covers [-280 -277]. So the westernmost corner should be covered.....

on another note..... Im not sure tho why the last bin ends on 78.25 instead of 78.5 tho, ... let me check and return the answer

from asc_and_heat_transport.

adele-morrison avatar adele-morrison commented on September 16, 2024

from asc_and_heat_transport.

willaguiar avatar willaguiar commented on September 16, 2024

I see - I'm happy to add the halos, or with the idea of changing the weight on the edges!

Although I'm not really sure I understand the issue... if the 20deg lon_bins are defined as in:
for a lon_mid -270, the bin would cover [-280 to -260], wouldn't they have the same amount of points since the edge of the bins are set to the edge of the grid? or am I missing something?

from asc_and_heat_transport.

adele-morrison avatar adele-morrison commented on September 16, 2024

from asc_and_heat_transport.

fabiobdias avatar fabiobdias commented on September 16, 2024

The 20deg bins weighting assumes a constant number of points per bins (80 in this case). I just checked the counting and it seems this is true for all the bins. Here is the the counting of number of gridpoints per bin (row) per regime (columns):

array([[80., 0., 0.],
[80., 0., 0.],
[39., 0., 41.],
[39., 0., 41.],
[30., 8., 42.],
[68., 0., 12.],
[80., 0., 0.],
[80., 0., 0.],
[28., 52., 0.],
[ 3., 77., 0.],
[ 0., 80., 0.],
[ 0., 4., 76.],
[55., 0., 25.],
[80., 0., 0.],
[80., 0., 0.],
[80., 0., 0.],
[60., 0., 20.]])

However, for 20deg bins we only have 17 bins (I would expect one more, as 360/20 = 18), so I think I missed something there. It seems to me we're ignoring the last eastern bin between 61.5-80° (I'm runnning these again to double-check)...

from asc_and_heat_transport.

adele-morrison avatar adele-morrison commented on September 16, 2024

from asc_and_heat_transport.

fabiobdias avatar fabiobdias commented on September 16, 2024

Hmm... I'm not sure tbh. This is how I do the binning:

lon_bin=20 #deg
bin_edges = np.arange(u_along_da_seasons_masked.lon[0], u_along_da_seasons_masked.lon[-1], lon_bin)

print(bin_edges)
array([-278.5, -258.5, -238.5, -218.5, -198.5, -178.5, -158.5, -138.5,
       -118.5,  -98.5,  -78.5,  -58.5,  -38.5,  -18.5,    1.5,   21.5,
         41.5,   61.5])

so there's 18 edges but only 17 bins. Then I just do

ds = u_along_da_mean_masked
u_along_da_mean_binned = ds.groupby_bins('lon', bins=bin_edges).mean()

from asc_and_heat_transport.

fabiobdias avatar fabiobdias commented on September 16, 2024

Ok, I think we can fix that by re-defining the bin_edges and don't limit the max longitude to lon[-1] (which is 78.25°, so it doesn't fit another 20° bin).

If we do that, the counting (for the weighting) shows that the last bin has a total 68 points ([25., 0., 43.], sfc/rev/deep regimes).

Should I proceed to generated the new statistics?

from asc_and_heat_transport.

fabiobdias avatar fabiobdias commented on September 16, 2024

I finally got to test two different ways to including the last bin missing on previous analyses (with 20deg bins):

  • Test 1 defines bin edges between -280 and 80. In this case, the first and last bins have less points (n=74) than the other bins (n=80), so the weights are applied accordingly (i.e., taking in account the max number of points for each bin).

  • Test 2: define bin edges between -278.5 and 81.5. Originally the last bin have less gridpoints (n=68) than all the others, but here we applied a halo in the eastern side, repeating the first 12 points on the western side.
    (longitudes are updates so the groupby gets these points on the correct bin; changing from
    lon =[278.5 , -278.25, -278. , -277.75, -277.5 , -277.25, -277. , -276.75, -276.5 , -276.25, -276. , -275.75]
    to:
    lon = [78.5 , 78.75, 79. , 79.25, 79.5 , 79.75, 80. , 80.25, 80.5 , 80.75, 81. , 81.25]).
    This makes the last bin in test 2 (with edges between 61.5-81.5) to have also n=80.

Bottomline is that both tests 1 and 2 have similar results. But they decrease the high r^2 in the deep regime/monthly climatology (from ~0.8 to ~0.6).

I'm posting below the statistics for the 3 tests, where test 3 is the original one (which is missing the last bin, and is what we used in this comparison).

I've generated the new netcdf files with these statistics here:

/g/data/hh5/tmp/access-om/fbd581/ASC_project/statisctic_lonbin/

Test 1:
layer_wise_CSHT_vs_U_corr_20degBins_wavg_test1

Test 2:
layer_wise_CSHT_vs_U_corr_20degBins_wavg_test2

Test 3
layer_wise_CSHT_vs_U_corr_20degBins_wavg_test3
:

from asc_and_heat_transport.

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.