twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
2 stars 2 forks source link

Error in `get_cross_corr_emissions_from_buff()` after switching days #113

Open ubdbra001 opened 8 months ago

ubdbra001 commented 8 months ago

When moving from one day to the next an error is thrown when get_cross_corr_emissions_from_buff() is reached for the first time:

Exception has occurred: UnboundLocalError
local variable 'vel_glob_err' referenced before assignment

File "C:\Users\Daniel\Projects\PyCamPermanent\pycam\so2_camera_processor.py", line 2909, in get_cross_corr_emissions_from_buff
    res['flow_glob']._velo_eff_err.append(vel_glob_err)

https://github.com/twVolc/PyCamPermanent/blob/952b65ead4365f17a87bcbfc3864700a63098ba2/pycam/so2_camera_processor.py#L2867-L2901

cross_corr_buff only has a single data point from the previous day and so vel_glob and vel_glob_err are not retrieved and assigned (vel_glob = None by default, hence why the error is not thrown a line earlier)

ubdbra001 commented 8 months ago

May be because:

Or could be a combination of the two.