Currently in SAM, for sunrise/sunset hours, power is translated to energy for the entire hour, not just the portion of the hour where the sun is actually up. This was possibly an ok assumption when most irradiance data was hour-averaged, but using instantaneous data, this may be more inaccurate. There's very little documentation from other pv tools as far as what they are assuming to go from power to energy for these hours.