Skip to content

Commit 4bdb716

Browse files
author
Nick Forfinski-Sarkozi
committed
fixed sort_index() omision in output_tpu_to_las_extra_bytes()
1 parent b1eb183 commit 4bdb716

File tree

4 files changed

+56
-14
lines changed

4 files changed

+56
-14
lines changed

CBlueApp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@
5353
str(now.minute).zfill(2),
5454
str(now.second).zfill(2))
5555

56-
#logging.basicConfig(format='%(asctime)s:%(message)s',
57-
# level=logging.DEBUG)
56+
logging.basicConfig(filename=log_file,
57+
format='%(asctime)s:%(message)s',
58+
level=logging.DEBUG)
5859

5960
from Subaerial import SensorModel, Jacobian
6061
from GuiSupport import DirectorySelectButton, RadioFrame

Tpu.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,28 @@ def output_tpu_to_las_extra_bytes(self, las, data_to_output):
269269
extra_byte_df = pd.DataFrame(tpu_data[:, 0:num_extra_bytes],
270270
index=tpu_data[:, num_extra_bytes],
271271
columns=extra_byte_dimensions.keys())
272+
273+
print(f'extra_byte_df')
274+
print(extra_byte_df)
275+
276+
print(f'las.num_file_points')
277+
print(las.num_file_points)
278+
279+
print('las.t_argsort')
280+
print(las.t_argsort)
272281

273282
if extra_byte_df.shape[0] == las.num_file_points:
274283
extra_byte_df = extra_byte_df.sort_index()
284+
print(f'extra_byte_df --------- sort.index()')
285+
print(extra_byte_df)
275286
else:
276-
'''fill data points for which TPU was not calculated
277-
with no_data_value (also sorts by index, or t_idx)'''
287+
logging.info("""
288+
filling data points for which TPU was not calculated
289+
with no_data_value (also sorting by index, or t_idx)
290+
""")
278291
no_data_value = -1
279-
extra_byte_df = extra_byte_df.reindex(las.t_argsort,
280-
fill_value=no_data_value)
292+
extra_byte_df = extra_byte_df.reindex(las.t_argsort,
293+
fill_value=no_data_value).sort_index()
281294

282295
logging.debug('populating extra byte data for total_thu...')
283296
out_las.total_thu = extra_byte_df['total_thu']
@@ -337,12 +350,13 @@ def write_metadata(self, las):
337350
def run_tpu_multiprocess(self, num_las, sbet_las_generator):
338351
"""runs the tpu calculations using multiprocessing
339352
340-
This methods initiates the tpu calculations using the pathos multiprocessing
341-
framework (https://pypi.org/project/pathos/). Whether the tpu calculations
342-
are done with multiprocessing or not is currently determined by which
343-
"run_tpu_*" method is manually specified in the tpu_process_callback()
344-
method of the CBlueApp class. TODO: Include
345-
a user option to select single processing or multiprocessing
353+
This methods initiates the tpu calculations using the pathos
354+
multiprocessing framework (https://pypi.org/project/pathos/).
355+
Whether the tpu calculations are done with multiprocessing or not is
356+
currently determined by which "run_tpu_*" method is manually specified
357+
in the tpu_process_callback() method of the CBlueApp class.
358+
359+
TODO: Include user option to select single processing or multiprocessing
346360
347361
:param sbet_las_generator:
348362
:return:
@@ -351,7 +365,8 @@ def run_tpu_multiprocess(self, num_las, sbet_las_generator):
351365
print('Calculating TPU (multi-processing)...')
352366
p = pp.ProcessPool(2)
353367

354-
for _ in tqdm(p.imap(self.calc_tpu, sbet_las_generator), total=num_las, ascii=True):
368+
for _ in tqdm(p.imap(self.calc_tpu, sbet_las_generator),
369+
total=num_las, ascii=True):
355370
pass
356371

357372
return p

cblue_configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"directories": {"tpu": "D:/JeromesCreek/tpu_dir", "sbet": "D:/JeromesCreek", "las": "D:/JeromesCreek"}, "subaqueous_LUTs": {"RIEGL": "./lookup_tables/Riegl_look_up_fit_HG0995_1sig.csv", "ECKV": "./lookup_tables/ECKV_LUT_HG0995_1sig.csv"}, "multiprocess": true, "number_cores": 4, "cBLUE_version": "v2.2.1", "sensor_model": "Riegl VQ-880-G", "water_surface_ellipsoid_height": 2.0}
1+
{"directories": {"tpu": "D:/RSD_PROJECTS/FL1604-TB-N-880_MarcoIsland_p", "sbet": "D:/RSD_PROJECTS/FL1604-TB-N-880_MarcoIsland_p/tpu_sbet", "las": "D:/RSD_PROJECTS/FL1604-TB-N-880_MarcoIsland_p"}, "subaqueous_LUTs": {"RIEGL": "./lookup_tables/Riegl_look_up_fit_HG0995_1sig.csv", "ECKV": "./lookup_tables/ECKV_LUT_HG0995_1sig.csv"}, "multiprocess": true, "number_cores": 4, "cBLUE_version": "v2.2.1", "sensor_model": "Riegl VQ-880-G", "water_surface_ellipsoid_height": -23.0}

lidar_sensors.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"Reigl VQ-880-G": {
3+
"sensor_model": {
4+
"sensor_type": "cBLUE (generic with polynomial error correction)",
5+
"a_std_dev": 0.02,
6+
"b_std_dev": 0.02,
7+
"std_rho": 0.025
8+
},
9+
"subaqueous_LUTs": {
10+
"RIEGL": "./lookup_tables/Riegl_look_up_fit_HG0995_1sig.csv",
11+
"ECKV": "./lookup_tables/ECKV_LUT_HG0995_1sig.csv"
12+
}
13+
},
14+
"Leica Chiroptera 4X": {
15+
"sensor_model": {
16+
"sensor_type": "cBLUE (generic with polynomial error correction)",
17+
"a_std_dev": 0.02,
18+
"b_std_dev": 0.02,
19+
"std_rho": 0.025
20+
},
21+
"subaqueous_LUTs": {
22+
"RIEGL": "",
23+
"ECKV": ""
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)