def sg_period_to_hour(period_str):
    """Singapore electricity markets are split into 48 periods.
    Period 1 starts at 00:00 Singapore time. Period 9 starts at 04:00.
    This function returns hours since midnight, possibly with 0.5 to indicate 30 minutes."""
    return (float(period_str) - 1) / 2.0