Skip to content

Commit

Permalink
minor changes in commented log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Jul 16, 2024
1 parent 900186b commit e58565c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/bag_uncertainty_has_depth.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
logger = logging.getLogger(__name__)

# file_bag_0 = os.path.join(Helper.samples_folder(), "bdb_01.bag")
file_bag_0 = r"D:\google_drive\_ccom\QC Tools\data\survey\QC Tools 4\BAG_Checks\uncertainty_without_depth\unc_no_depth.bag"
file_bag_0 = r"D:\google_drive\_ccom\QC Tools\data\survey\BAG Checks\W00676_node-count-mismatch\W00676_MB_4m_MLLW_1of1.bag"

root_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
testing = Testing(root_folder=root_folder)
Expand Down
15 changes: 15 additions & 0 deletions examples/workground/open_bag_metadata_xml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from h5py import File
from lxml import etree, __version__ as lxml_version

bag_path = r"C:\code\cpp\BAG\examples\sample-data\sample-1.5.0.bag"

strip_x00 = True

print("lxml version: %s" % lxml_version)
print("libxml version: %s" % (etree.LIBXML_COMPILED_VERSION, ))

bag = File(bag_path, 'r')
xml = bag["BAG_root/metadata"][:].tobytes()
if strip_x00:
xml = xml.strip(b'\x00')
xml_tree = etree.fromstring(xml)
6 changes: 3 additions & 3 deletions hyo2/bag/bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def uncertainty_greater_than(self, th: float) -> list[list[int | float]]:

def uncertainty_has_depth(self) -> list[list[int | float]]:
rows, cols = self.uncertainty_shape()
# logger.debug('shape: %s, %s' % (rows, cols))
# logger.debug('shape: %s, %s (%d)' % (rows, cols, rows * cols))

self.populate_metadata()

Expand Down Expand Up @@ -361,9 +361,9 @@ def uncertainty_has_depth(self) -> list[list[int | float]]:
stop = rows

unc = self.uncertainty(row_range=slice(start, stop))
# logger.info(unc)
# logger.info("unc: %d, %d" % (np.isnan(unc).sum(), np.isfinite(unc).sum()))
dep = self.elevation(row_range=slice(start, stop))
# logger.info(dep)
# logger.info("dep: %d, %d" % (np.isnan(dep).sum(), np.isfinite(dep).sum()))
unc[np.isfinite(dep)] = np.nan
# logger.info(unc)
ijs = np.argwhere(np.isfinite(unc))
Expand Down

0 comments on commit e58565c

Please sign in to comment.