def _getcalday(instcal, date):
    """
    Get index of row for current night in instrument calendar table.
    """
    for i in range(len(instcal['date'])):
        if instcal['date'][i] in date:
            return i
    print('\n Date '+date+' not found in instrument configuration calendar.')
    raise ValueError('Date '+date+' not found in instrument configuration calendar.')