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

Standardize use of sonar metadata as Sonar global attributes vs (for EK80 only) variables #992

Merged
merged 3 commits into from
Mar 17, 2023

Conversation

emiliom
Copy link
Collaborator

@emiliom emiliom commented Mar 16, 2023

Addresses all tasks in #681 involving sonar metadata in the Sonar group as implemented in echopype vs in the SONAR-netCDF convention.

Nearly all the changes are to EK80, where the main issue was the presence of some sonar metadata as variables rather than global attributes. Specifically:

  • Changed sonar_software_name and sonar_software_version to be global attributes rather than variables
  • Renamed the custom (non-convention) variable serial_number to transducer_serial_number (@leewujung please confirm if this is accurate; see Varying variables in Sonar group amongst sensors #681 (comment))
  • Added a long_name attribute to variables sonar_serial_number, transducer_serial_number and transducer_name

For AZFP, Set sonar_software_name to "AZFP" instead of "Based on AZFP Matlab Toolbox".

emiliom added 2 commits March 16, 2023 13:28
…on; add long_name to other sonar metadata variables, and rename one such var
@emiliom emiliom added the data format Anything about data format label Mar 16, 2023
@emiliom emiliom added this to the 0.7.0 milestone Mar 16, 2023
@emiliom emiliom requested a review from leewujung March 16, 2023 20:37
@emiliom emiliom self-assigned this Mar 16, 2023
Comment on lines 240 to 259
"transducer_name": (["channel"], var["transducer_name"]),
"sonar_serial_number": (["channel"], var["channel_id_short"]),
"sonar_software_name": (
"sonar_serial_number": (
["channel"],
var["application_name"],
), # identical for all channels
"sonar_software_version": (
var["channel_id_short"],
{
"long_name": "Sonar serial number",
},
),
"transducer_serial_number": (
["channel"],
var["serial_number"],
{
"long_name": "Transducer serial number",
},
),
"transducer_name": (
["channel"],
var["application_version"],
), # identical for all channels
var["transducer_name"],
{
"long_name": "Transducer name",
},
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something is not quite right with these changes.

  • channel_id_short are the transducer model plus serial number
  • transducer_name contains the transducer model.
  • serial_number contains the transceiver serial number (transceivers are things like GPT and WBT).

See #212 (comment) for example printouts, I think you could see how these numbers are combined to become what's in channel_id

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, my changes in the block you're commenting on amount to just two things:

  • Rename serial_number to transducer_serial_number
  • Add a long_name attribute with values that are just the variable name spelled out.

I'm not sure what changes you're proposing. But since transducer_name and serial_number are variable names from echopype, not the convention, we can rename them as we see fit. Are you proposing we rename them to transducer_model and transceiver_serial_number, respectively?

As for sonar_serial_number, that's defined as a global attribute in the convention and as a variable by echopype, for EK80 only b/c it varies with channel. In your examples in #212, it's "0" in one case (which I interpret as not available / known) and "202" in another (a suspiciously short value for a serial number, IMHO). Should we use that parameter instead of channel_id_short? In #212 (comment) you had equated transducer serial number with channel_id_short.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment above is to clarify what each of the variables are coming out from the parser, and that transceiver and transducer are different things.

I think sonar_serial_number is ill-defined since it can mean too many things.

Below is what I propose:

  • store the parsed transducer_name as transducer_name in echopype (ie. no change), so that it is easy for folks familiar with EK80 raw data know what they are
  • store the parsed serial_number as transceiver_serial_number in echopype, so that it is specific that it is not the transducer serial number
  • store the parsed transducer_serial_number as transducer_serial_number in echopype (ie. no change), for clarify
  • do not store sonar_serial_number for EK80: This is marked as recommended and not mandatory in the convention. I think it is confusing what it is in this context. And, not populating it makes it consistent with EK60. 😬

channel_id_short seems a combination of transducer_name and transducer_serial_number, so I am thinking that we can safely ignore it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a commit that implements this:

  • sonar_serial_number is an empty global attribute, no longer a variable
  • variables:
    • transducer_name, based on parser transducer_name parameter
    • transducer_serial_number, based on parser transducer_serial_number parameter
    • transceiver_serial_number, based on parser serial_number parameter

That follows what you recommended, but please review.

Copy link
Member

@leewujung leewujung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emiliom : thanks for looking into this.I think there's something needing changes in the EK80 block. Please see my comments below.

…mber will be an empty attribute; clarify transceiver_serial_number vs transdicer_serial_number variables
@emiliom emiliom requested a review from leewujung March 17, 2023 19:34
@leewujung
Copy link
Member

Looks great, please feel free to merge. Thanks for putting in comments about the sonar_serial_number. I checked the counterpart in EK60 and was happy to find that it is in there too! :)

@emiliom
Copy link
Collaborator Author

emiliom commented Mar 17, 2023

Thanks! Will merge.

@emiliom emiliom merged commit da0a9e9 into OSOceanAcoustics:dev Mar 17, 2023
@emiliom emiliom deleted the sonar-attrs branch March 17, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data format Anything about data format
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants