Skip to content

Commit 7a39afc

Browse files
committed
add more verbose statements
1 parent 195cb00 commit 7a39afc

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

pycurrents_ADCP_processing/ADCP_processing_L1.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,11 +1005,9 @@ def make_dataset_from_subset(
10051005
for attr, attr_val in ds[var].attrs.items():
10061006
# Recalculate data min and max
10071007
if attr == 'data_min':
1008-
dsout[var].attrs[attr] = np.nanmin(
1009-
dsout[var].data)
1008+
dsout[var].attrs[attr] = np.nanmin(dsout[var].data)
10101009
elif attr == 'data_max':
1011-
dsout[var].attrs[attr] = np.nanmax(
1012-
dsout[var].data)
1010+
dsout[var].attrs[attr] = np.nanmax(dsout[var].data)
10131011
# Update sensor depth for each segment
10141012
elif attr == 'sensor_depth':
10151013
dsout[var].attrs[attr] = instrument_depth
@@ -1100,6 +1098,9 @@ def split_ds_by_pressure(input_ds: xr.Dataset, segment_starts: list, segment_end
11001098

11011099
# Iterate through all the segments and create a netCDF file from each
11021100
for st_idx, en_idx, i in zip(segment_starts, segment_ends, range(num_segments)):
1101+
if verbose:
1102+
print(f'Segment {i + 1}: index {st_idx} to {en_idx}')
1103+
11031104
# Generate as many file names as there are segments of data
11041105
# only use the "date" part of the datetime and not the time portion
11051106
# format the depth to 4 string characters by adding zeros if necessary
@@ -1580,7 +1581,8 @@ def nc_create_L1(in_file, file_meta, dest_dir, time_file=None, verbose=False):
15801581
out.attrs['orientation'], sensor_dep, out.distance.data
15811582
)
15821583

1583-
print(out) # for testing
1584+
if verbose:
1585+
print(out) # for testing
15841586

15851587
# -----------------Split dataset by pressure changes if any--------------
15861588

0 commit comments

Comments
 (0)