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

Issue in interpolation of data using the SAF #13

Open
kamwal opened this issue Jul 3, 2024 · 5 comments
Open

Issue in interpolation of data using the SAF #13

kamwal opened this issue Jul 3, 2024 · 5 comments

Comments

@kamwal
Copy link

kamwal commented Jul 3, 2024

In running the matlab_owc software for the float WMO: 1901877 I have encounter some error with the interpolation of data in the update salinity mapping block of calculations where the software use the SAF in the analysis. The error message refers to not unique sample points used for analysis.

Is there any way to avoid this error in the software other than disable SAF in the config file?

I am using combined, the most recent reference data CTD_for_DMQC_2024V01 and ARGO_for_DMQC_2023V03

The error message is as follows:

UPDATE_SALINITY_MAPPING: Working on profile 121
Error using matlab.internal.math.interp1
Sample points must be unique.

Error in interp1 (line 188)
VqLite = matlab.internal.math.interp1(X,V,method,method,Xqcol);

Error in frontalConstraintSAF (line 155)
T300=interp1(grid_pres(isok,i),temp,300);

Error in update_salinity_mapping (line 201)
frontalConstraintSAF(la_bhist_sal, la_bhist_ptmp, la_bhist_pres, la_bhist_lat, la_bhist_long, la_bhist_dates, la_bhist_Z, LAT, LONG, PRES, PTMP, SAL, po_system_configuration);

Error in ow_calibration_kamwal_v2 (line 39)
update_salinity_mapping( flt_dir, flt_name, lo_system_configuration )

@cabanesc
Copy link
Contributor

cabanesc commented Jul 4, 2024

Hi Kamila,

I may not have exactly the same configuration as you, but I was able to reproduce the same error on profile 108.
The error comes from a profile in the CTD_for_DMQC_2024V01 database where the pressure is not monotically increasing (box 5304, profile 261) (see plot below).
Possibly, we could add some sanity checks to frontalConstraintSAF.m to ensure that the pressure is monotically increasing before interpolating l155.
However, this CTD profile probably comes from raw CTD data and I am not sure it should be included in the reference CTD database.
@apswong and @coatanoan, what do you think?

5304_prof261

@apswong
Copy link

apswong commented Jul 8, 2024

Hi @cabanesc, I think if this is a reference dbase issue, then it should be dealt with within the reference dbase. This is because an inappropriate reference profile will cause problems in many places, and not just in frontalConstraintSAF. If we add sanity checks in the OWC code to exclude these inappropriate reference profiles, then it means we are not using them anyway, so it's best to exclude them from the reference base in the first place.

Hi @coatanoan, would it be possible to add a monotonically increasing pressure check to the reference profiles?

@coatanoan
Copy link

Hi (@cabanesc @kamwal @apswong ),
Yes this is indeed a reference database issue. I will identify the wrong profile and remove it from the box.
@apswong Yes I can try to set up an additional test to check for monotonically pressure increase

@kamwal
Copy link
Author

kamwal commented Jul 9, 2024

Thank you all for your quick response and taking a look on this! :)

@imab4bsh
Copy link

imab4bsh commented Jul 9, 2024

Hi everyone,
I did check for non monotonically increasing pressure during the big cleanup of the reference database.
https://github.com/euroargodev/clean_CTD-RDB_for2021v01release/blob/master/box_cleanprofiles.m
@coatanoan Maybe you can reuse this code.
Saludos
Ingrid

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

5 participants