euroargodev / User-Acceptance-Test-Python-version-of-the-OWC-tool

BODC Argo team with consultation with other Argo partners took initiative to convert the OWC software from Matlab to Python. This initiative has been undertaken based on the output from the international survey about the methods and tools used in DMQC core data. The following repository is dedicated for User Acceptance Testing.
1 stars 0 forks source link

Different size and not correct numbers in fcoef variable in cal_<WMO>.mat #22

Closed kamwal closed 4 years ago

kamwal commented 4 years ago

I found that in Python output, in cal_.mat the "fcoef" variable has size 1x4. All of these four values in the row have the same number. That is in disagreement with output from Matlab, where the size of "fcoef" in 1x2 and these two values have different number.

WMO: 1901847 Reference data: CTD_for_DMQC_2019V01 WMO boxes: wmo_boxes_ctd.mat set_calseries:

` # Config calseries parameters

    breaks = []
    max_breaks = 4  # 0 for linear trend, -1 for offset
    calseries = np.ones((1, no_profiles)).flatten()
    # example for splitting time series at profile 33
    # calseries = np.concatenate((np.ones((1, 33)), 2 * np.ones(1,no_profiles - 33)))
    calib_profile_no = profile_no
    use_percent_gt = 0.5
    use_theta_lt = 0
    use_theta_gt = 0
    use_pres_lt = 0
    use_pres_gt = 0`

Canfiguration: ` # Objective Mapping Parameters #

    # max number of historical casts used in objective mapping
    'CONFIG_MAX_CASTS': 300,

    # 1=use PV constraint, 0=don't use PV constraint, in objective mapping
    'MAP_USE_PV': 0,

    # 1=use SAF separation criteria, 0=don't use SAF separation criteria, in objective mapping
    'MAP_USE_SAF': 0,

    # spatial decorrelation scales, in degrees
    'MAPSCALE_LONGITUDE_LARGE': 8,
    'MAPSCALE_LONGITUDE_SMALL': 4,
    'MAPSCALE_LATITUDE_LARGE': 4,
    'MAPSCALE_LATITUDE_SMALL': 2,

    # cross-isobath scales, dimensionless, see BS(2005)
    'MAPSCALE_PHI_LARGE': 0.1,
    'MAPSCALE_PHI_SMALL': 0.02,

    # temporal decorrelation scale, in years
    'MAPSCALE_AGE_LARGE': 20,
    'MAPSCALE_AGE_SMALL': 5,

    # exclude the top xxx dbar of the water column
    'MAP_P_EXCLUDE': 100,

    # only use historical data that are within +/- yyy dbar from float data
    'MAP_P_DELTA': 200
}`
edsmall-bodc commented 4 years ago

@kamwal Can you also just attach the outputs that disagree? Just in a comment, so I have the actual numbers too. Thanks.

kamwal commented 4 years ago

Matlab output from right (fcoef), Python output from left (fcoef_py)

image

edsmall-bodc commented 4 years ago

Just a note, the above images are the wrong way round: python output on the right, matlab output on the left.

kamwal commented 4 years ago

In the zip file I included source and mapped file

1901847.zip

edsmall-bodc commented 4 years ago

Problem with calculation:

A[0] = A[0] * y_scale * y_0 should be A[0] = A[0] * y_scale + y_0

edsmall-bodc commented 4 years ago

Fixed in https://github.com/euroargodev/argodmqc_owc/pull/40

@kamwal the branch is set up so that you can just run the analysis with the float that caused the issue. When it is confirmed as fix, I will remove the float from the branch before merging