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

Qc tests adjustments part3 #732

Merged
merged 23 commits into from
Apr 14, 2021
Merged

Qc tests adjustments part3 #732

merged 23 commits into from
Apr 14, 2021

Conversation

ocehugo
Copy link
Contributor

@ocehugo ocehugo commented Apr 1, 2021

See commit msgs. This is part3 of the next release.

  1. Includes several utilities around given the refactoring done in some QC tests.
  2. Fix a compatibility bug
  3. Tests and small fixes.

Avoid errors when trying to move files
with the same source/destination names.
The updates are to support quick testing
and to avoid the UI being broken
by a certain datasets with some missing fields.
This fix a bug for downlooking adcp
introduced when we changed the interpolation function
and cleanup a variable not used.

A constraint for the interpolation function is that
the values along all dimensions should be increasing.

This fix just shift the value within the function closure
so we can perform interpolation of downlooking bins.
In a recent commit, the memory saving option to
use memory mapped files was commented out.
This turn the feature on for good.
This fix a compatibility problem introduced recently
by using the de2bi function.
This function may not be avaiable to everyone. Hence,
the old bit wrangling was restore for all variables affected.
This commit introduces functionality
to allow easy update to Property/Mapping
files while keeping their
comment structure.

`Util/detectMappingsDelimiter` detects
the delimiter of a Parameter/Mapping file.

`Util/callerName.m` detects the function
calling it from the current workspace.

`Util/updateMappings` perform the update for
a given configuration name and value.

`Util/+IMOS/+resolve/function_parameters` automatically
resolve/load the parameters of the current running function.
This function substitutes `readProperty.m`.

`Util/+IMOS/+update/function_parameters` as above,
but update the file with parameters as arguments.
This function, in particular, is not used yet
but may be a good substitute to `writeProperty.m`.

For usage examples, see imosEchoIntensitySetQC,
imosSurfaceDetectionByDepthSetQC, and associated
tests.
`IMOS.variables_with_dimensions` implements
a filterby/groupby action on variables based
on dimensions names, in order.
This provide some basic adcp query functions.

`IMOS.adcp.beam_height` - computes the total beam height/length of adcp.

`IMOS.adcp.bin_in_water` - computes the points of the adcp profile
that are within the water, based on the beam_face config, beam_height,
instrument depth, and local bathymetry.

`IMOS.adcp.contains_adcp_dimensions` - check if a dataset contains
typical adcp dimensions.

`IMOS.adcp.is_along_beam` - check if the data is collected in beam
coordinates.

`IMOS.adcp.number_of_beams` - return the number of beams based on
variable content.
Includes some repeatable patterns of query/meta data access.

`IMOS.meta.beam_face_config` - discover the beam face config of an ADCP.
`IMOS.meta.site_bathymetry` - discover the local bathymetry.
`IMOS.meta.velocity_variables` - discover all velocity variables in a
dataset.
This implements a simple function based schema validation
for PP/QC routines. The idea is to externalise some long
verification calls and inspections of individual routines
and turn the actual code that perform the PP/QC cleaner.

The schemas must be named exactly as functions within the
`+schema` folder.

`IMOS.validate_dataset` perform a schema validation of a function.

For practical examples, see
imosEchoIntensitySetQC & imosSurfaceDetectionByDepthSetQC.
This re-implements the EchoIntensityQC test with the
objective of deprecating EchoIntensityVelocitySetQC.

The major advantages are a cleaner code and customisable behaviour:

1. Propagate - to propagate a echo gradient further down the beam.
2. Bound by index - to limit markings by bin index.
3. Bound by depth - to limit markings by depth value.

See also tests and documentation.
The `imosSurfaceDetectionByDepthSetQC` function
implements a simple surface detection based on
the instrument depth and the beam height of the adcp.

Supports both up-looking and down-looking adcps.
This was actually a very old code imported
when we merged the 675 branch.

Current QC functions like `EchoIntensityVelocity`,
the reimplemented one `EchoIntensity`, or the new
`SurfaceDetectionByDepth` may achieve equivalent results.
This clean up the function from the license
block and fix enu detection in the test
given the changes done at the workhorseParse
function.
@ocehugo ocehugo requested a review from lbesnard April 1, 2021 06:11
@ocehugo ocehugo mentioned this pull request Apr 14, 2021
@lbesnard lbesnard merged commit 5fa0045 into master Apr 14, 2021
@lbesnard lbesnard deleted the qc_tests_adjustments_part3 branch April 14, 2021 02:42
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

Successfully merging this pull request may close these issues.

2 participants