def _get_calendar(var):
    """
    Get the proper calendar string from a netcdf file

    Parameters
    ----------
    var : netCDF4.variable

    Returns
    -------
    calendar type: string,
      The type of calendar system used
    convert : bool
      True if the calendar needs to be converted to datetime
    """
    # Set up the mapping for calendars
    default = 1
    calendar_conv = [False, False, False,
                     True, True, True, False, False, False]
    calendar_types = ['standard', 'gregorian', 'proleptic_gregorian', 'noleap',
                      'julian', 'all_leap', '365_day', '366_day', '360_day']
    cals = {v: v for v in calendar_types}
    cals['gregorian_proleptic'] = 'proleptic_gregorian'

    # Load the calendar type. If it is incorrectly specified (*cough* ROMS),
    # change it
    for cal in ('calendar', 'calendar_type'):
        if hasattr(var, cal):
            cal = cals.get(str(getattr(var, cal)).lower(),
                           calendar_types[default])
            return cal, calendar_conv[calendar_types == cal]
    return calendar_types[default], calendar_conv[default]