Skip to content

Commit

Permalink
Merge pull request #1201 from dwcaress/caress-tmp
Browse files Browse the repository at this point in the history
Mblist, mbvoxelclean, mbnavadjust, mbm_histplot, formats 232 & 233
  • Loading branch information
dwcaress authored May 7, 2021
2 parents b8d6179 + c555699 commit 2c8fab9
Show file tree
Hide file tree
Showing 19 changed files with 3,680 additions and 2,769 deletions.
14 changes: 14 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Distributions that do not include "beta" in the tag name correspond to the major
announced releases. The source distributions associated with all releases, major
or beta, are equally accessible as tarballs through the Github interface.

- Version 5.7.9beta07 May 7, 2021
- Version 5.7.9beta06 March 24, 2021
- Version 5.7.9beta05 March 8, 2021
- Version 5.7.9beta04 February 21, 2021
Expand Down Expand Up @@ -385,6 +386,19 @@ or beta, are equally accessible as tarballs through the Github interface.
--
### MB-System Version 5.7 Release Notes:
--
#### 5.7.9beta07 (May 7, 2021)

mbm_histplot: Fixed the use of the -C option to specify cellwidth for the
histogram to be plotted.

Formats 232 (MBF_3DWISSLR) and 233 (MBF_3DWISSLP): Changed so that MB_FLAG_SECONDARY
is no longer used for multiple picks per laser pulse.

MBnavadjust and MBnavadjustmerge: Restructured the code so that more capability
of mbnavadjust can be duplicated in the command line tool mbnavadjust merge.
Working to add ability to reimport surveys into a project.

MBvoxelclean: Added --neighborhood option and fixed amplitude range options.

Mblist: Fixed function of the -O%fnv and -O%FNV commands to produce *.fnv files.

Expand Down
22 changes: 11 additions & 11 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for mbsystem 5.7.9beta06.
# Generated by GNU Autoconf 2.69 for mbsystem 5.7.9beta07.
#
# Report bugs to <http://listserver.mbari.org/sympa/arc/mbsystem>.
#
Expand Down Expand Up @@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='mbsystem'
PACKAGE_TARNAME='mbsystem'
PACKAGE_VERSION='5.7.9beta06'
PACKAGE_STRING='mbsystem 5.7.9beta06'
PACKAGE_VERSION='5.7.9beta07'
PACKAGE_STRING='mbsystem 5.7.9beta07'
PACKAGE_BUGREPORT='http://listserver.mbari.org/sympa/arc/mbsystem'
PACKAGE_URL='http://www.mbari.org/data/mbsystem/'

Expand Down Expand Up @@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures mbsystem 5.7.9beta06 to adapt to many kinds of systems.
\`configure' configures mbsystem 5.7.9beta07 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1560,7 +1560,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of mbsystem 5.7.9beta06:";;
short | recursive ) echo "Configuration of mbsystem 5.7.9beta07:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1728,7 +1728,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
mbsystem configure 5.7.9beta06
mbsystem configure 5.7.9beta07
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2385,7 +2385,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by mbsystem $as_me 5.7.9beta06, which was
It was created by mbsystem $as_me 5.7.9beta07, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -2734,7 +2734,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu



$as_echo "#define VERSION_DATE \"24 March 2021\"" >>confdefs.h
$as_echo "#define VERSION_DATE \"7 May 2021\"" >>confdefs.h


$as_echo " "
Expand Down Expand Up @@ -4693,7 +4693,7 @@ fi

# Define the identity of the package.
PACKAGE='mbsystem'
VERSION='5.7.9beta06'
VERSION='5.7.9beta07'


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -24546,7 +24546,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by mbsystem $as_me 5.7.9beta06, which was
This file was extended by mbsystem $as_me 5.7.9beta07, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -24613,7 +24613,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
mbsystem config.status 5.7.9beta06
mbsystem config.status 5.7.9beta07
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ dnl See README file for copying and redistribution conditions.
dnl--------------------------------------------------------------------

dnl Initialize and set version and version date
AC_INIT([mbsystem],[5.7.9beta06],[http://listserver.mbari.org/sympa/arc/mbsystem],[mbsystem],[http://www.mbari.org/data/mbsystem/])
AC_DEFINE(VERSION_DATE, ["24 March 2021"], [Set VERSION_DATE define in mb_config.h])
AC_INIT([mbsystem],[5.7.9beta07],[http://listserver.mbari.org/sympa/arc/mbsystem],[mbsystem],[http://www.mbari.org/data/mbsystem/])
AC_DEFINE(VERSION_DATE, ["7 May 2021"], [Set VERSION_DATE define in mb_config.h])

AS_ECHO([" "])
AS_ECHO(["------------------------------------------------------------------------------"])
Expand Down
4 changes: 2 additions & 2 deletions libtool
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Generated automatically by config.status (mbsystem) 5.7.9beta06
# Libtool was configured on host mbari1716.shore.mbari.org:
# Generated automatically by config.status (mbsystem) 5.7.9beta07
# Libtool was configured on host tharp.local:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.

# Provide generalized library-building support services.
Expand Down
108 changes: 60 additions & 48 deletions src/macros/mbm_histplot
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
# macro.
#
# Basic Usage:
# mbm_histplot -Ifile [-Btickinfo -Gfill -H
# mbm_histplot -Ifile [-Btickinfo -C[xmin/xmax/]cellwidth -Gfill -H
# -Jprojection[/scale | width]
# -Ltitle -Oroot
# -Ppagesize -Uorientation -Q
# -Rw/e/s/n -V -Wpen -X]
# -Rxmin/xmax/fmin/fmax -V -Wpen -X]
#
# Miscellaneous Options:
# [ -MIErresolution -MITtype ]
Expand Down Expand Up @@ -146,7 +146,7 @@ $current_working_dir = `pwd`;
$command_line = "@ARGV";
&MBGetopts('B:b:C:c:G:g:HhI:i:J:j:L:l:M+m+O:o:P:p:QqR:r:U:u:VvW:w:Xx:');
$tick_info = ($opt_B || $opt_b);
$cellwidth = ($opt_C || $opt_c);
$cellwidthraw = ($opt_C || $opt_c);
$fill = ($opt_G || $opt_g || "gray");
$help = ($opt_H || $opt_h);
$file_data = ($opt_I || $opt_i);
Expand Down Expand Up @@ -257,57 +257,71 @@ if (!$root)
$root = $file_data;
}

# use user defined bounds
if ($bounds)
{
if ($bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
# open and read the file for xmin xmax
open(F,$file_data) || die "Cannot open input file: $file_data\n$program_name aborted.\n";
$count = 0;
while ($data=<F>) {
if ($count == 0 || $data < $xmind)
{
($xmin,$xmax,$ymin,$ymax) = $bounds =~
/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
$bounds_plot = $bounds;
$xmind = $data;
}
if ($count == 0 || $data > $xmaxd)
{
$xmaxd = $data;
}
$count++;
}
close(F);
if ($count <= 0)
{
die "Input file: $file_data appears to contain no data.\n$program_name aborted.\n";
}

# get limits of file.
if (!$bounds)
# use user defined bounds
if ($bounds && $bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
{
# open and read the file for xmin xmax
open(F,$file_data) || die "Cannot open input file: $file_data\n$program_name aborted.\n";
$count = 0;
while ($data=<F>) {
if ($data < $xmin || $count == 0)
{
$xmin = $data;
}
if ($data > $xmax || $count == 0)
{
$xmax = $data;
}
$count++;
}
close(F);
if ($count <= 0)
{
die "Input file: $file_data appears to contain no data.\n$program_name aborted.\n";
}
($xmin,$xmax,$ymin,$ymax) = $bounds =~
/(\S+)\/(\S+)\/(\S+)\/(\S+)/;
$bounds_plot = $bounds;
}
else
{
$xmin = $xmind;
$xmax = $xmaxd;
}

# if needed set cell bounds
if (!$cellwidth)
# parse -C argument
if ($cellwidthraw)
{
if ($cellwidthraw =~ /^\S+\/\S+\/\S+$/)
{
$cellwidth = ($xmax - $xmin) / 10;
}
($xmin,$xmax,$cellwidth) = $cellwidthraw =~ /^(\S+)\/(\S+)\/(\S+)$/;
}
else
{
$cellwidth = $cellwidthraw;
}
}

# make cells
$ncell = floor(($xmax - $xmin) / $cellwidth) + 5;
$nxmin = floor($xmin / $cellwidth) - 1;
$xmin = ($nxmin - 0.5) * $cellwidth;
$xmax = $xmin + $cellwidth * $ncell;
for ($i=0;$i<$ncell;$i++)
{
push(@cellcount, 0);
}
# if needed set cell bounds
if (!$cellwidth)
{
$cellwidth = ($xmax - $xmin) / 10;
}

# open and read the file for ymin ymax
# make cells
$ncell = floor(($xmax - $xmin) / $cellwidth) + 5;
$nxmin = floor($xmin / $cellwidth) - 1;
$xmin = ($nxmin - 0.5) * $cellwidth;
$xmax = $xmin + $cellwidth * $ncell;
for ($i=0;$i<$ncell;$i++)
{
push(@cellcount, 0);
}

# open and read the file for ymin ymax
if (!$bounds || !$bounds =~ /^\S+\/\S+\/\S+\/\S+$/)
{
open(F,$file_data) || die "Cannot open input file: $file_data\n$program_name aborted.\n";
while ($data=<F>) {
$i = floor(($data - $xmin) / $cellwidth);
Expand Down Expand Up @@ -752,8 +766,6 @@ $gmt_def = "COLOR_FOREGROUND/white";
push(@gmt_macro_defs, $gmt_def);
$gmt_def = "COLOR_NAN/white";
push(@gmt_macro_defs, $gmt_def);
$gmt_def = "FORMAT_GEO_MAP/$degree_format";
push(@gmt_macro_defs, $gmt_def);

# open the shellscript file
if (!open(FCMD,">$cmdfile"))
Expand Down Expand Up @@ -876,7 +888,7 @@ printf FCMD "gmt pshistogram $file_data \\\n\t";
printf FCMD "-J\$MAP_PROJECTION\$MAP_SCALE \\\n\t";
printf FCMD "-R\$MAP_REGION \\\n\t";
printf FCMD "$axes \\\n\t";
printf FCMD "-W$cellwidth -Z1 \\\n\t";
printf FCMD "-T$xmin/$xmax/$cellwidth -Z1 \\\n\t";
if ($pen)
{
printf FCMD "-L$pen \\\n\t";
Expand Down
8 changes: 4 additions & 4 deletions src/mbio/mb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
#define PACKAGE_NAME "mbsystem"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "mbsystem 5.7.9beta06"
#define PACKAGE_STRING "mbsystem 5.7.9beta07"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "mbsystem"
Expand All @@ -113,7 +113,7 @@
#define PACKAGE_URL "http://www.mbari.org/data/mbsystem/"

/* Define to the version of this package. */
#define PACKAGE_VERSION "5.7.9beta06"
#define PACKAGE_VERSION "5.7.9beta07"

/* Build tools using PCL */
/* #undef PCLTOOLS_ENABLED */
Expand All @@ -128,10 +128,10 @@
#define TEST_ENABLED 1

/* Version number of package */
#define VERSION "5.7.9beta06"
#define VERSION "5.7.9beta07"

/* Set VERSION_DATE define in mb_config.h */
#define VERSION_DATE "24 March 2021"
#define VERSION_DATE "7 May 2021"

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
Expand Down
3 changes: 2 additions & 1 deletion src/mbio/mb_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ const char *unknown_notice_msg[] = {"Unknown notice identifier"};
#define mb_beam_check_flag_sonar(F) ((int)((F & MB_FLAG_SONAR) && (F & MB_FLAG_FLAG)))
//#define mb_beam_check_flag_gt_1x_iho(F) ((int)((F & MB_FLAG_GT_1X_IHO) && (F & MB_FLAG_FLAG)))
//#define mb_beam_check_flag_gt_2x_iho(F) ((int)((F & MB_FLAG_GT_2X_IHO) && (F & MB_FLAG_FLAG)))
#define mb_beam_check_flag_unusable(F) ((int)((F == MB_FLAG_NULL) || ((F & MB_FLAG_FLAG) && ((F & MB_FLAG_INTERPOLATE) || (F & MB_FLAG_SECONDARY)))))
//#define mb_beam_check_flag_unusable(F) ((int)((F == MB_FLAG_NULL) || ((F & MB_FLAG_FLAG) && ((F & MB_FLAG_INTERPOLATE) || (F & MB_FLAG_SECONDARY)))))
#define mb_beam_check_flag_unusable(F) ((int)((F == MB_FLAG_NULL) || ((F & MB_FLAG_FLAG) && ((F & MB_FLAG_INTERPOLATE)))))
#define mb_beam_set_flag_null(F) (0x01)
#define mb_beam_set_flag_none(F) (0x00)
#define mb_beam_set_flag_manual(F) (F | 0x05)
Expand Down
28 changes: 12 additions & 16 deletions src/mbio/mbsys_3ddwissl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3699,6 +3699,15 @@ int mbsys_3ddwissl_calculatebathymetry
pulse = (struct mbsys_3ddwissl_pulse_struct *)&store->pulses[ipulse];
int isounding_largest = -1;
short amplitude_largest = 0;
for (int isounding=0; isounding<store->soundings_per_pulse; isounding++)
{
sounding = &pulse->soundings[isounding];
if (sounding->range > 0.001 && sounding->amplitude > amplitude_largest)
{
amplitude_largest = sounding->amplitude;
isounding_largest = isounding;
}
}
for (int isounding=0; isounding<store->soundings_per_pulse; isounding++)
{
sounding = &pulse->soundings[isounding];
Expand Down Expand Up @@ -3732,7 +3741,9 @@ int mbsys_3ddwissl_calculatebathymetry

/* set beamflag */
if (sounding->amplitude * amplitude_factor >= amplitude_threshold)
sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_SECONDARY;
sounding->beamflag = MB_FLAG_NONE;
else if (isounding_largest == isounding)
sounding->beamflag = MB_FLAG_FLAG + MB_FLAG_SONAR;
else
sounding->beamflag = MB_FLAG_NULL;

Expand All @@ -3750,13 +3761,6 @@ int mbsys_3ddwissl_calculatebathymetry
sounding->alongtrack = xx * sin(DTR * phi) + head_offset_y_m
+ angle_el_sign * pulse->offset_el
+ pulse->alongtrack_offset;

/* check for largest amplitude */
if (sounding->amplitude > amplitude_largest)
{
amplitude_largest = sounding->amplitude;
isounding_largest = isounding;
}
}
else
{
Expand All @@ -3767,14 +3771,6 @@ int mbsys_3ddwissl_calculatebathymetry
sounding->alongtrack = 0.0;
}
}

/* reset beam flags */
if (isounding_largest >= 0)
{
sounding = &pulse->soundings[isounding_largest];
if (sounding->beamflag != MB_FLAG_NULL)
sounding->beamflag = MB_FLAG_NONE;
}
}

/* set flag indicating that bathymetry has been calculated */
Expand Down
Loading

0 comments on commit 2c8fab9

Please sign in to comment.