diff --git a/bifacial_radiance/main.py b/bifacial_radiance/main.py index 5ae244c6..b597eb5e 100644 --- a/bifacial_radiance/main.py +++ b/bifacial_radiance/main.py @@ -4228,7 +4228,7 @@ def _checkSensors(sensors): xstartfront = x1 + x2 + x3 + originx xstartback = x1 + x2 + x4 + originx - + ystartfront = y1 + y2 + y3 + originy ystartback = y1 + y2 + y4 + originy @@ -4291,10 +4291,22 @@ def _checkSensors(sensors): firstsensorxstartfront = xstartfront+xinc_front firstsensorxstartback = xstartback+xinc_back - firstsensorystartfront = ystartfront+yinc_front - firstsensorystartback = ystartback+yinc_back - firstsensorzstartfront = zstartfront + zinc_front - firstsensorzstartback = zstartback + zinc_back + # check to make sure sensorsy don't line up with gaps in between cellModule + if ((getattr(scene.module, 'cellModule', None)) and + (sensorsy_front == scene.module.cellModule.numcellsy-1)): + firstsensorystartfront = ystartfront+yinc_front/2 + firstsensorzstartfront = zstartfront + zinc_front/2 + else: + firstsensorystartfront = ystartfront+yinc_front + firstsensorzstartfront = zstartfront + zinc_front + if ((getattr(scene.module, 'cellModule', None)) and + (sensorsy_back == scene.module.cellModule.numcellsy-1)): + firstsensorystartback = ystartback+yinc_back/2 + firstsensorzstartback = zstartback + zinc_back/2 + else: + firstsensorystartback = ystartback+yinc_back + firstsensorzstartback = zstartback + zinc_back + ## Correct positions for sensorsx other than 1 # TODO: At some point, this equations can include the case where diff --git a/docs/sphinx/source/whatsnew/pending.rst b/docs/sphinx/source/whatsnew/pending.rst index 5f341b33..198beb94 100644 --- a/docs/sphinx/source/whatsnew/pending.rst +++ b/docs/sphinx/source/whatsnew/pending.rst @@ -29,6 +29,7 @@ Bug fixes * Fixed a leap year bug in :py:func:`~bifacial_radiance.RadianceObj.readWeatherFile` that crashed if epwfiles are loaded that include leap year data (like Feb. 28 2020). (:issue:`552`) * Bug fix in :py:func:`bifacial_radiance.load.cleanResult` that wouldn't work with files created when front and rear scan are different lengths. (:issue:`419`) * GUI bug fixes where the sensorsy was not loading correctly, module .rad file was not being re-written, and an invalid default timestamp is used. +* Bug fix in :py:func:`bifacial_radiance.AnalysisObj.moduleAnalysis` when sensorsY equals numCellsy-1 and the scan lines up in the gaps between cells. shift scan by half a cell. Documentation ~~~~~~~~~~~~~~