-
Notifications
You must be signed in to change notification settings - Fork 77
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
Conversation
…on; add long_name to other sonar metadata variables, and rename one such var
echopype/convert/set_groups_ek80.py
Outdated
"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", | ||
}, | ||
), |
There was a problem hiding this comment.
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 numbertransducer_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
There was a problem hiding this comment.
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
totransducer_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
.
There was a problem hiding this comment.
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
astransducer_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
astransceiver_serial_number
in echopype, so that it is specific that it is not the transducer serial number - store the parsed
transducer_serial_number
astransducer_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.
There was a problem hiding this comment.
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 parsertransducer_name
parametertransducer_serial_number
, based on parsertransducer_serial_number
parametertransceiver_serial_number
, based on parserserial_number
parameter
That follows what you recommended, but please review.
There was a problem hiding this 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
Looks great, please feel free to merge. Thanks for putting in comments about the |
Thanks! Will merge. |
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:
sonar_software_name
andsonar_software_version
to be global attributes rather than variablesserial_number
totransducer_serial_number
(@leewujung please confirm if this is accurate; see Varying variables inSonar
group amongst sensors #681 (comment))long_name
attribute to variablessonar_serial_number
,transducer_serial_number
andtransducer_name
For AZFP, Set
sonar_software_name
to "AZFP" instead of "Based on AZFP Matlab Toolbox".