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

high deep value test line 465 #6

Open
catsch opened this issue Apr 7, 2023 · 3 comments
Open

high deep value test line 465 #6

catsch opened this issue Apr 7, 2023 · 3 comments

Comments

@catsch
Copy link

catsch commented Apr 7, 2023

if (np.nanmedian(BBPmf1[iDEEP]) > C_DEEP_BBP700_THRESH) & (len(BBPmf1[iDEEP]) >= C_N_of_ANOM_POINTS):

I think this part is not correct len(BBPmf1[iDEEP]) >= C_N_of_ANOM_POINTS, assuming that you are counting points deeper than the Pressure threshold and not anomalous points deeper than the Pressure threshold

grgdll added a commit that referenced this issue Apr 11, 2023
@grgdll
Copy link
Collaborator

grgdll commented Apr 11, 2023

Thanks for spotting this bug: I (think I) have now fixed it.

@grgdll grgdll closed this as completed Apr 11, 2023
@catsch
Copy link
Author

catsch commented Apr 12, 2023

iDEEP = np.where(PRES > C_DEPTH_THRESH)[0] # find deep part of the profile
if np.nanmedian(BBPmf1[iDEEP]) > C_DEEP_BBP700_THRESH: # this is the test 
    # find how many points fail the test
    iPointsBelow700dbar = len(iDEEP) # indices of points that fail test
    if iPointsBelow700dbar >= C_N_of_ANOM_POINTS: # check if we have enough points at depth 
        ISBAD = np.where(BBPmf1)[0] # flag entire profile

into (not sure about python syntax and how to deal with nan values)

iDEEP = np.where(PRES > C_DEPTH_THRESH)[0] # find deep part of the profile
iPointsBelow700dbar = np.where(BBPmf1[iDEEP]) > C_DEEP_BBP700_THRESH) # find how many deep points fail the test
if len(iPointsBelow700dbar) >= C_N_of_ANOM_POINTS: # check if we have enough points at depth
ISBAD = np.where(BBPmf1)[0] # flag entire profile

as BBPmf1 is already the median filtered value ?

@catsch catsch reopened this Apr 12, 2023
@grgdll
Copy link
Collaborator

grgdll commented Apr 13, 2023

I think the issue is in how the test was described in v1 of the manuscript. In fact the test checks if the median value of the median-filteredf BBP values below C_DEPTH_THRESH is > C_DEEP_BBP700_THRESH. But we should also check that we have enough points below C_DEPTH_THRESH.

So I have update the revised manuscript and the flow chart. Please let me know if you see other problems.

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

2 participants