def get_measurement_lag(gt_id):
    """Returns the number of days of lag (e.g., the number of days over
    which a measurement is aggregated plus the number of days late that
    a measurement is released) for a given ground truth data measurement
    """
    # Every measurement is associated with its start date, and measurements
    # are aggregated over one or more days, so, on a given date, only the measurements
    # from at least aggregation_days ago are fully observed.
    # Most of our measurements require 14 days of aggregation
    aggregation_days = 14
    # Some of our measurements are also released a certain number of days late
    days_late = 0
    if gt_id.endswith("mjo"):
        # MJO uses only a single day of aggregation and is released one day late
        aggregation_days = 1
        days_late = 1
    elif "sst" in gt_id:
        # SST measurements are released one day late
        days_late = 1
    elif gt_id.endswith("mei"):
        # MEI measurements are released at most 30 days late
        # (since they are released monthly) but are not aggregated
        aggregation_days = 0
        days_late = 30
    elif "wind" in gt_id:
        # Wind measurements are released one day late
        days_late = 1
    elif "icec" in gt_id:
        days_late = 1
    elif ("slp" in gt_id or "pr_wtr.eatm" in gt_id or "rhum.sig995" in gt_id or
          "pres.sfc.gauss" in gt_id or "pevpr.sfc.gauss" in gt_id):
        # NCEP/NCAR measurements are released one day late
        days_late = 1
    return aggregation_days + days_late