@@ -354,12 +354,6 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
354354 ... grid_overrides={"HasDuplicates": True},
355355 ... )
356356 """
357- from datetime import datetime
358- import time
359-
360- start_time = datetime .fromtimestamp (time .time ())
361- print (f"Starting SEG-Y to MDIO conversion at: { start_time .strftime ('%H:%M:%S.%f' )} " )
362-
363357 index_names = index_names or [f"dim_{ i } " for i in range (len (index_bytes ))]
364358 index_types = index_types or ["int32" ] * len (index_bytes )
365359
@@ -383,8 +377,6 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
383377 binary_header = segy .binary_header
384378 num_traces = segy .num_traces
385379
386- print (f"SEG-Y file opened with { num_traces } traces at: { datetime .fromtimestamp (time .time ()).strftime ('%H:%M:%S.%f' )} " )
387-
388380 # Index the dataset using a spec that interprets the user provided index headers.
389381 index_fields = []
390382 for name , byte , format_ in zip (index_names , index_bytes , index_types , strict = True ):
@@ -402,8 +394,6 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
402394 grid_density_qc (grid , num_traces )
403395 grid .build_map (index_headers )
404396
405- print (f"Grid built and mapped at: { datetime .fromtimestamp (time .time ()).strftime ('%H:%M:%S.%f' )} " )
406-
407397 # Check grid validity by ensuring every trace's header-index is within dimension bounds
408398 valid_mask = np .ones (grid .num_traces , dtype = bool )
409399 for d_idx in range (len (grid .header_index_arrays )):
@@ -451,8 +441,6 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
451441 )
452442 config = MDIOCreateConfig (path = mdio_path_or_buffer , grid = grid , variables = [var_conf ])
453443
454- print (f"Starting MDIO file creation at: { datetime .fromtimestamp (time .time ()).strftime ('%H:%M:%S.%f' )} " )
455-
456444 root_group = create_empty (
457445 config ,
458446 overwrite = overwrite ,
@@ -469,8 +457,6 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
469457 # Build a ChunkIterator over the live_mask (no sample axis)
470458 from mdio .core .indexing import ChunkIterator
471459
472- print (f"Starting live mask creation at: { datetime .fromtimestamp (time .time ()).strftime ('%H:%M:%S.%f' )} " )
473-
474460 chunker = ChunkIterator (live_mask_array , chunk_samples = False )
475461 for chunk_indices in chunker :
476462 # chunk_indices is a tuple of N–1 slice objects
@@ -508,9 +494,6 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
508494 write_attribute (name = "text_header" , zarr_group = meta_group , attribute = text_header .split ("\n " ))
509495 write_attribute (name = "binary_header" , zarr_group = meta_group , attribute = binary_header .to_dict ())
510496
511- local_time = datetime .fromtimestamp (time .time ())
512- print (f"The livemask was written at time: { local_time .strftime ('%H:%M:%S.%f' )} " )
513-
514497 # Clean up live mask related variables
515498 del live_mask_array
516499 del chunker
@@ -521,8 +504,6 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
521504 import gc
522505 gc .collect ()
523506
524- print (f"Starting trace writing at: { datetime .fromtimestamp (time .time ()).strftime ('%H:%M:%S.%f' )} " )
525-
526507 # Write traces
527508 stats = blocked_io .to_zarr (
528509 segy_file = segy ,
@@ -536,8 +517,3 @@ def segy_to_mdio( # noqa: PLR0913, PLR0915
536517 write_attribute (name = key , zarr_group = root_group , attribute = value )
537518
538519 zarr .consolidate_metadata (root_group .store )
539-
540- end_time = datetime .fromtimestamp (time .time ())
541- print (f"SEG-Y to MDIO conversion completed at: { end_time .strftime ('%H:%M:%S.%f' )} " )
542- duration = end_time - start_time
543- print (f"Total conversion time: { duration .total_seconds ():.2f} seconds" )
0 commit comments