.:debug:home
Debugging ADPAA Processing Scipts
Hopefully, ADPAA will work to process data files. However, ADPAA is not designed to check for all cases so occasionally new data occur that ADPAA can not handle. Additionally, code that worked in the past may have broken due to an unrelated update. The idea is that problems in the ADPAA code should be easy to fix and changes/updates/problems are documented.
Debugging Process
There are two items to understand when debugging ADPAA scripts. 1.) You need to understand the https://adpaa.sourceforge.io/wiki/index.php/.:scripts:home#Hierarchical_Processing_Scripts and how to obtain information on where the error occurs. To obtain error information, run a compiled version of ADPAA and obtain verbose output by setting the verbose_mode and virtual_machine system variables. For example, in a terminal window:
verbose_mode=1 virtual_machine=0 export verbose_mode virtual_machine
Additional Debugging Information
Many scripts have -d* or verbose (-v) options to provide additional debugging information from print statements that help with debugging the code when things do not work or when there is an error generated. For example, the process_raw script has -ddd option, which gives the most output, including information on every header read, is useful to determine which data block (instrument) is causing the error. If a data block is not read correctly, following data blocks can be incorrectly read. The system variable "verbose_mode" controls output of data to the terminal; hence, to receive debugging information, verbose_mode needs to be equal to one, which can be set in the terminal using: "export verbose_mode=1"
While most ADPAA modules only contain one level of debugging information, the Level 1 processing script process_raw has three debugging levels to aid problem solving. These levels are:
- -d - first level debug information: ERROR messages only
- -dd - second level debug information: ERROR and WARNING messages
- -ddd - third level debug information: .sea file data header information and ERROR and WARNING messages
Debugging Example
First create an error to find in ADPAA
In ${ADPAA_DIR}/Level1/process_raw/GPSGenerator.pro, add print x[2] to start of the program ->
PRO GPSGenerator,DataDir,GPS_Altitude,flight_date,unit_GPSAircraft,sfm, $ AircraftType,ProjectName,Comments
print x[2]
Run ADTAE IPHEX testing Code
First make sure system variables are correct ->
verbose_mode=1 virtual_machine=0 export verbose_mode virtual_machine
Run testing IPHEX scripts -> ${ADTAE_DIR}/TestPrograms/test_project_iphex.bash
Results should be ->
'******* Testing Standard Processing for the IPHEX project *******'
--Cleaning up old files in TESTING_DIR .......................... Done
--Coping files to TESTING_DIR ................................... Done
Processing the 14_04_29_15_21_03.sea file ....................... ERROR
Creating 14_04_29_15_21_03.serial.GPS.10sec ..................... Done
Processing the 14_04_29_15_21_03.serial.GPS.raw file ............ Done
SODA2 Processing ................................................ Skipped
Creating 2DS-HVPS3 merge spectra file ........................... Skipped
ERROR (process_nevzorov): twods_data_dir not set. Exiting.
diff: /home/delene/TESTING/FlightData/20140429_152103/PostProcessing/14_04_29_15_21_03.iphex: No such file or directory
!!Valided: No difference found in output file.
'**** Finished (test_project_iphex) ******************************'
Now need to know what script is being call so look at process_all_iphex ->
which calls process_all, which calls process_raw that creates the error.
Now run process_raw on the 14_04-29_1521_03.sea file in the ~/TESTING/FlightData/20140429_152103/PostProcessing/ directory ->
process_raw to get ->
% Attempt to call undefined procedure: 'GPSGENERATOR'.
% Execution halted at: PROCESS_WMI 1116 /home/delene/CoPAS/ADPAA/src/Level1/process_raw/process_WMI.pro
% PROCESS_RAW 598 /home/delene/CoPAS/ADPAA/src/Level1/process_raw/process_raw.pro
% START_PROCESS_RAW 97 /home/delene/CoPAS/ADPAA/src/Level1/process_raw/start_process_raw.pro
% $MAIN$
Looking at the compile of GPSGENERATOR ->
print x[2]
% Syntax error. At: /home/delene/CoPAS/ADPAA/src/Level1/process_raw/GPSGenerator.pro, Line 55
So the error is in line 55 of GPSGenerator, which needs to be remove to fit.