problem reading BinLength from 'User Configuration' header
If I understand the System Integrator Guide (page 31), bytes 37 and 38 of this hea\
der are meant to contain the bin length.
I am having problems reading this value from the binary file. (I am doing this in\
self-written code in the R language, not using the Nortek-supplied software.)
I have a setup in which the bin length is 0.04m, with 25 bins covering 1 metre. T\
hese values I know from the deployment plan, and from the .hdr file. The problem \
is that when I read these things, I get the value 1674.
I do not think I am reading the file incorrectly, because I am familiar with readi\
ng binary files and because my code reads correctly the quantities before and afte\
r the cell size.
QUESTION: Is this 1674 in some unit that I can convert to 0.04m?
PS. the code is as follows, in case anyone wants to try it in R. (You'll need you\
r own file, of course.)
<pre>
f <- file("sl08AQ01.prf","rb")
hardware <- readBin(f,n=48,size=1,what="raw")
head <- readBin(f,n=224,size=1,what="raw")
user <- readBin(f,n=512,size=1,what="raw")
cat("cell size=", readBin(user[37:38], "integer", n=1, size=2, endian="little"), "\
\n")
</pre>
Re: problem reading BinLength from 'User Configuration' header
Hi Dan,
Our apologies for the late reply. Here is the answer:
CS = (1674/256)*0.00675*cos(25) = 0.04 m, for a 2 MHz instrument
For a 1 MHz instrument you must multiply by twice the sampling distance, i.e. 0.0135 m
Best regards,
Sven Nylund
Re: problem reading BinLength from 'User Configuration' header
Previously Sven Nylund wrote:
Hi Dan,
Our apologies for the late reply. Here is the answer:
CS = (1674/256)*0.00675*cos(25) = 0.04 m, for a 2 MHz instrument
For a 1 MHz instrument you must multiply by twice the sampling distance, i.e. 0.0135 m
Best regards,
Sven Nylund
Since I've have the same question (with other numbers) your explanation isn't clear to me:
I've used a setup with a 2 MHz profiler with 35 bins with bin size = 0.10 m. The number I'm reading in the binary file is 1182. In the formula mentioned above I''m not sure what you mean with sampling distance and how this variable can be calculated from the parameters already present in the binary file. Is it possible to give a more detailed explanation?
Best regards,
Marco Schrijver
Re: problem reading BinLength from 'User Configuration' header
Hi Marco,
The above explanation is only valid for HR instruments. The regular profilers use a different sampling frequency (or distance).
For the regular Aquadopp Profilers you must substitute 0.00675 with
0.0956 for 2 MHz
0.0478 for 1 MHz
0.0797 for 600 kHz
0.1195 for 400 kHz
Best regards,
Sven Nylund
Re: problem reading BinLength from 'User Configuration' header
Previously Sven Nylund wrote:
Hi Marco,
The above explanation is only valid for HR instruments. The regular profilers use a different sampling frequency (or distance).
For the regular Aquadopp Profilers you must substitute 0.00675 with
0.0956 for 2 MHz
0.0478 for 1 MHz
0.0797 for 600 kHz
0.1195 for 400 kHzBest regards,
Sven Nylund
Hi Sven,
Since it's not a HR Profiler this is probably not the correct forum, apologies for that. We've setup a 2 MHz Aquadopp profiler, configured with a blanking distance of 0.1m and 35 bins with a bin size of 0.1 m. Current has been measured in shallow water, so with varying depth. This last effect is validated during post processing. When I use the given formula above 1182/256 * 0.00956 * cos(25), the result is: 0.44. Could you tell me what I'm doing wrong? Thanks.
Best regards,
Marco
Re: problem reading BinLength from 'User Configuration' header
Hi Marco,
My mistake, here is the corrected table with the value for 2 MHz changed:
0.0239 for 2 MHz
0.0478 for 1 MHz
0.0797 for 600 kHz
0.1195 for 400 kHz
Now you will get the correct cell size, 1182/256 * 0.0239 * cos(25) = 0.10 m
Best regards,
Sven
Re: problem reading BinLength from 'User Configuration' header
Hi Sven,
Can the same formula be used to derive blanking distance?
I suspect not, but is there a generic formula that will work for all Paradopp instruments? My specific need is for AWAC and Continental instruments.
Is it possible for a description of this calculation to be included in the next version of the System Integrator Manual?
Thanks,
Paul McCarthy.
Re: problem reading BinLength from 'User Configuration' header
Hi Paul,
For the AWAC the table for cell size looks like this:
0.0478 for 1 MHz
0.0797 for 600 kHz
And for the Continental:
0.0945 for 470 kHz
0.2221 for 190 kHz
To find the blanking distance you must first calculate the cell size as described above using the appropriate value from one of the tables. The blanking distance in meters can then be calculated from the T2 value (at offset 6) like this:
BD = T2*0.0229*cos(25) - CS
The formula for blanking distance applies to all profilers except the HR Profiler where the scaling parameter must be substituted by the same value as for the cell size, i.e. 0.00675 for 2 MHz and 0.0135 for 1 MHz.
Best regards,
Sven
Re: problem reading BinLength from 'User Configuration' header
Hi Sven,
Thanks for your response. I'm happy to use a lookup table as you suggest, but am curious as to the relationship between the head frequency, and the multiplication factor used to calculate the cell size. Is there a generic formula which can be used to automatically derive the factor from the frequency for any instrument? The formula I've come up with (too simplistic, I'm sure) is:
factor = 47.8 / frequency
which holds for all frequencies exceot the continental (190kHz and 470kHz). Are you able to shed any light on this?
Regards,
Paul McCarthy
Re: problem reading BinLength from 'User Configuration' header
Hi Sven,
In a previous post you gave the following numbers:
0.0239 for 2 MHz
0.0478 for 1 MHz
0.0797 for 600 kHz
0.1195 for 400 kHz
In your post to Paul the frequency is 0.0229 for the 2 MHz. Which is the correct one?
Thanks,
Marco
Previously Sven Nylund wrote:
Hi Paul,
For the AWAC the table for cell size looks like this:
0.0478 for 1 MHz
0.0797 for 600 kHzAnd for the Continental:
0.0945 for 470 kHz
0.2221 for 190 kHzTo find the blanking distance you must first calculate the cell size as described above using the appropriate value from one of the tables. The blanking distance in meters can then be calculated from the T2 value (at offset 6) like this:
BD = T2*0.0229*cos(25) - CSThe formula for blanking distance applies to all profilers except the HR Profiler where the scaling parameter must be substituted by the same value as for the cell size, i.e. 0.00675 for 2 MHz and 0.0135 for 1 MHz.
Best regards,
Sven
Re: problem reading BinLength from 'User Configuration' header
Hi Marco,
The only place I find the number 0.0229 is for calculating the blanking distance (BD), so this is for a different parameter than the cell size (CS).
Best regards,
Sven
Re: problem reading BinLength from 'User Configuration' header
For an HR-Profiler, 2Mhz and transducer faces 30 degrees from the horizontal (instead of the usual 25 deg), am I correct to use the following:
The configuration was to have 15mm bins, and I've inserted decimal equivalents from the user configuration (a500....). Can you give any guidance on rounding? I want to then determine the range to each bin.
<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-1610611985 1073750091 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} a:visited, span.MsoHyperlinkFollowed {mso-style-noshow:yes; mso-style-priority:99; color:purple; mso-themecolor:followedhyperlink; text-decoration:underline; text-underline:single;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText {mso-style-priority:99; mso-style-link:"Plain Text Char"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; font-family:Consolas; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} span.PlainTextChar {mso-style-name:"Plain Text Char"; mso-style-priority:99; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Plain Text"; mso-ansi-font-size:10.5pt; mso-bidi-font-size:10.5pt; font-family:Consolas; mso-ascii-font-family:Consolas; mso-hansi-font-family:Consolas;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->CS = (628/256)*0.00675*cos(30) ~ 0.01548 m
<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-1610611985 1073750091 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; mso-themecolor:hyperlink; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {mso-style-noshow:yes; mso-style-priority:99; color:purple; mso-themecolor:followedhyperlink; text-decoration:underline; text-underline:single;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText {mso-style-priority:99; mso-style-link:"Plain Text Char"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; font-family:Consolas; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} span.PlainTextChar {mso-style-name:"Plain Text Char"; mso-style-priority:99; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Plain Text"; mso-ansi-font-size:10.5pt; mso-bidi-font-size:10.5pt; font-family:Consolas; mso-ascii-font-family:Consolas; mso-hansi-font-family:Consolas;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->BD = 19*0.00675*cos(30)-0.015 ~ 0.0960 m
By the way, in the .hdr file it says 20mm for the cell size. Is it rounding to the nearest cm? Similarly, blanking distance in .hdr is 0.10 m...is it rounding to the nearest cm?
<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-1610611985 1073750091 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; mso-themecolor:hyperlink; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {mso-style-noshow:yes; mso-style-priority:99; color:purple; mso-themecolor:followedhyperlink; text-decoration:underline; text-underline:single;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText {mso-style-priority:99; mso-style-link:"Plain Text Char"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; font-family:Consolas; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} span.PlainTextChar {mso-style-name:"Plain Text Char"; mso-style-priority:99; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Plain Text"; mso-ansi-font-size:10.5pt; mso-bidi-font-size:10.5pt; font-family:Consolas; mso-ascii-font-family:Consolas; mso-hansi-font-family:Consolas;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->Re: problem reading BinLength from 'User Configuration' header
Re: problem reading BinLength from 'User Configuration' header
Hi Reyna,
CS = (628/256)*0.00675*cos(30) ~ 0.01548 m
The expression is correct but there seems to be a miscalculation there, the result is 0.01434 m. Since the transducer angle is larger than normal the vertical extent of the cells will be smaller so you end up with a slightly smaller cell size than in the nominal case with 25 degree angles.
BD = 19*0.00675*cos(30)-0.015 ~ 0.0960 m
Since the blanking distance only gives you a fixed offset for all cells this is less important, but to be perfectly accurate the blanking distance should also take into account the actual cell size along the vertical. So with the above calculation of the cell size we get:
BD = 19*0.00675*cos(30)-0.01434 ~ 0.0967 m
I am afraid the current software version rounds off these values to the nearest cm, also for the cell size where it is output in mm. We will try to get that fixed in the next software release.
Best regards,
Sven Nylund
Re: problem reading BinLength from 'User Configuration' header
Does the Blanking Distance refer to the distance to the start of the first bin, or the middle of the first bin?
Re: problem reading BinLength from 'User Configuration' header
Dear Reyna,
The blanking distance is the distance from the sensor head to the start of the first measurement cell.
Best regards
Jonas Røstad
Re: problem reading BinLength from 'User Configuration' header
Hi, I am having trouble getting the correct values for a few of our Nortek Aquadopp Profilers. The HR-Profilers work fine.
The HEX of the binary characters for cell size is 14 17, which is 5908. For 2 MHz profiler, we use
CS = (5908/256)*0.0956*cos(25) ~ 1.9996 m
But it should be 0.5m.
Even more surprising, I have a completely different Profiler with the same value. I'm using BinLength from the user configuration, but it happens to be the same for these bytes even though they are configured with different bin lengths. They're hdr files are correct. Here's how one of the user configurations start
a5 00 00 01 5c 00 31 00 18 00 d3 01 00 02 17 00 01 00 03 00 00 00 60 00 00 00 00 00 00 00 01 00 02 00 0a 00 14 17 0a 00 00 00 00 00 00 00 ....
What am I missing!?
Re: problem reading BinLength from 'User Configuration' header
I found my mistake. I was using the wrong factor (hadn't seen the corrected values further in this thread).

