ices-eg / wg_WGACOUSTICGOV

Working Group on Acoustic Trawl Data Portal Governance
http://ices.dk/community/groups/Pages/WGacousticgov.aspx
5 stars 1 forks source link

Create check: Species Category Number = Subsample Number * Subsample Factor #61

Open HjalteParner opened 3 months ago

HjalteParner commented 3 months ago

If species category number, subsample number and subsample factor are reported, then species category number = susbample number * subsample factor should be the same.

HjalteParner commented 3 months ago

108 889 catch records where species category number, subsample number and subsample factor are reported.

30 463 catch records of above where ABS([SubsampledNumber] [SubsamplingFactor] - [SpeciesCategoryNumber]) > 1 i.e. SELECT [Cruise].[LocalID], [SpeciesCategoryNumber], [SubsampledNumber], [SubsamplingFactor], [SubsampledNumber][SubsamplingFactor] AS 'SpeciesCategoryNumberCalculated' FROM [Catch] INNER JOIN [Haul] ON [Catch].[HaulID] = [Haul].[ID] INNER JOIN [Cruise] ON [Haul].[CruiseID] = [Cruise].[ID] WHERE [SpeciesCategoryNumber] IS NOT NULL AND [SubsampledNumber] IS NOT NULL AND [SubsamplingFactor] IS NOT NULL AND ABS([SubsampledNumber] * [SubsamplingFactor] - [SpeciesCategoryNumber]) > 1

76 cruise records where ABS([SubsampledNumber] [SubsamplingFactor] - [SpeciesCategoryNumber]) > 1 i.e. SELECT DISTINCT [Cruise].[LocalID] FROM [Catch] INNER JOIN [Haul] ON [Catch].[HaulID] = [Haul].[ID] INNER JOIN [Cruise] ON [Haul].[CruiseID] = [Cruise].[ID] WHERE [SpeciesCategoryNumber] IS NOT NULL AND [SubsampledNumber] IS NOT NULL AND [SubsamplingFactor] IS NOT NULL AND ABS([SubsampledNumber] [SubsamplingFactor] - [SpeciesCategoryNumber]) > 1

Of the 30 463 catch records some are clearly have the wrong numbers while others also being wrong seems to be misunderstandings of the format.

Please see extract attached

AcousticBioticCarchSpeciesCategoryNumbersWrong.csv

elorsepp commented 2 months ago

@HjalteParner to send out some trial balloons (daenglish dialect) to different institutes see if we are nailing this