def get_num_days(dataset):
	"""
	Parse the time:calendar attribute of a dataset and get the number of days a year has
	"""
	if "time" in dataset:
		# get the max days from calendar
		calendar = dataset["time"].attrs['calendar']
		max_days = int(calendar.replace("_day", ""))
		return max_days
	else:
		return len(dataset["doy"])