# source: https://github.com/hadley/otters

version: 0.1.0
tables:
  otters:
    description: >
      Morphometric measurements and pregnancy/dependency status from sea otters
      captured or collected in Alaska, 1947-2019 by the U.S. Geological Survey
      (USGS) and the U.S. Fish and Wildlife Service (USFWS).
    details: >
      Source: <https://doi.org/10.5066/P9Q5PD3Y>
    source:
      parquet: otters.parquet
    columns:
      - name: otter_no
        type: string
        constraints: [required, primary_key]
        description: >
          Unique identifier of each individual measured otter. Assigned by
          researchers with a variety of naming conventions across locations
          and time.
        examples: ["67001", "70066", "90-044", "KOD-04-135", "SW-155"]

      - name: recap
        type: enum
        values:
          0: Captured only once
          1: Recaptured at least one time
        description: >
          Whether the measured otter was captured only once or recaptured at
          least one time.

      - name: date
        type: date
        range: [1947-05-02, 2019-05-30]
        description: >
          Date of capture or collection.

      - name: location
        type: string
        description: >
          Place name of location of capture or collection. Derived from local
          geographic place names.
        examples: [adak, chiniak bay, kiska, SE - whale bay, yukon island]

      - name: region
        type: enum
        values:
          west aleutians: Western Aleutian Islands
          east aleutians: Eastern Aleutian Islands
          AK peninsula: Alaska Peninsula
          kodiak: Kodiak Island
          lower cook inlet: Lower Cook Inlet
          PWS: Prince William Sound
          SE: Southeast Alaska
        description: >
          Region within the state of capture or collection (may encompass
          multiple areas).

      - name: area
        type: enum
        values:
          near islands: Near Island group
          rats: Rat Island group
          delarofs: Delarof Island group
          andreanofs: Andreanof Island group
          fox islands: Fox Island group
          WAP: Western Alaska Peninsula
          EAP: Eastern Alaska Peninsula
          shuyak: Shuyak Island
          afognak: Afognak Island
          kodiak: Kodiak Island
          kachemak: Kachemak Bay
          WPWS: Western Prince William Sound
          EPWS: Eastern Prince William Sound
          NSE: Northern Southeast Alaska
          CSE: Central Southeast Alaska
          SSE: Southern Southeast Alaska
        description: >
          Area within the state of capture or collection.

      - name: lat
        type: number(quantity)
        range: [51.37, 60.70]
        description: >
          Latitude of capture or collection location in decimal degrees
          (WGS84).

      - name: long
        type: number(quantity)
        range: [-178.96, 179.40]
        description: >
          Longitude of capture or collection location in decimal degrees
          (WGS84).

      - name: sex
        type: enum
        values: {M: Male, F: Female, U: Unknown}
        description: >
          Sex of otter.

      - name: weight
        type: number(quantity)
        range: [0.8, 45.4]
        description: >
          Weight of otter in kilograms.

      - name: tail_lgth_1
        type: number(quantity)
        range: [0, 313.8]
        description: >
          Length of tail in centimeters; first replicate measurement.

      - name: tail_lgth_2
        type: number(quantity)
        range: [21.5, 37.0]
        description: >
          Length of tail in centimeters; second replicate measurement.

      - name: tail_lgth_3
        type: number(quantity)
        range: [22.0, 37.0]
        description: >
          Length of tail in centimeters; third replicate measurement.

      - name: mean_tail_lgth
        type: number(quantity)
        range: [15.5, 172.9]
        description: >
          Mean of replicate tail length measurements in centimeters.

      - name: lgth1
        type: number(quantity)
        range: [40.2, 155.9]
        description: >
          Length of otter including tail in centimeters; first replicate
          measurement.

      - name: lgth2
        type: number(quantity)
        range: [90.0, 146.5]
        description: >
          Length of otter including tail in centimeters; second replicate
          measurement.

      - name: lgth3
        type: number(quantity)
        range: [102.2, 143.7]
        description: >
          Length of otter including tail in centimeters; third replicate
          measurement.

      - name: curvilinear_correction
        type: enum
        values:
          1: No correction (standard length)
          0.974: Correction for curvilinear length
        description: >
          Correction factor for lengths measured as curvilinear instead of
          standard length.

      - name: mean_lgth
        type: number(quantity)
        range: [40.2, 155.9]
        description: >
          Mean of replicate otter length measurements in centimeters.

      - name: true_standard_lgth
        type: number(quantity)
        range: [40.2, 151.9]
        description: >
          Mean length multiplied by curvilinear correction factor, in
          centimeters.

      - name: body_lgth
        type: number(quantity)
        range: [-43.4, 115.2]
        description: >
          Body length not including tail (true_standard_lgth -
          mean_tail_lgth) in centimeters.

      - name: curve_lgth1
        type: number(quantity)
        range: [47.0, 160.0]
        description: >
          Curvilinear length of otter including tail in centimeters; first
          replicate measurement.

      - name: curve_lgth2
        type: number(quantity)
        range: [111.5, 166.0]
        description: >
          Curvilinear length of otter including tail in centimeters; second
          replicate measurement.

      - name: girth1
        type: number(quantity)
        range: [29.5, 96.5]
        description: >
          Circumference of chest at xiphoid in centimeters; first replicate
          measurement.

      - name: girth2
        type: number(quantity)
        range: [74.5, 78.0]
        description: >
          Circumference of chest at xiphoid in centimeters; second replicate
          measurement.

      - name: mean_girth
        type: number(quantity)
        range: [29.5, 96.5]
        description: >
          Mean of replicate girth measurements in centimeters.

      - name: paw
        type: number(quantity)
        range: [34.0, 63.0]
        description: >
          Width of front paw at widest point in millimeters.

      - name: w_pup
        type: enum
        values:
          N: Not with dependent pup
          U: Unknown
          D: The individual is the dependent pup
          Y: With dependent pup
        description: >
          Whether an adult female was with a dependent pup at capture or
          collection.

      - name: pup_number
        type: string
        description: >
          Unique identifier of pup, if present and marked.
        examples: ["67002", "92-198", "KOD_04_121", "SO-08-20", "SO-98-50a"]
        constraints: [unique]

      - name: pup_sex
        type: enum
        values: {F: Female, M: Male, U: Unknown}
        description: >
          Sex of pup.

      - name: pup_wght
        type: number(quantity)
        range: [0.9, 28.0]
        description: >
          Weight of pup in kilograms.

      - name: pup_lgth
        type: number(quantity)
        range: [45.8, 113.5]
        description: >
          Length of pup in centimeters.

      - name: pup_curvlgth
        type: number(quantity)
        range: [47.0, 113.0]
        description: >
          Curvilinear length of pup in centimeters.

      - name: fetus_pres
        type: enum
        values:
          N: No fetus present
          Y: Fetus present
          M: Multiple fetuses present
        description: >
          Whether fetus was present at time of collection.

      - name: fetus_num
        type: number(quantity)
        range: [0, 3]
        description: >
          Number of fetuses present.

      - name: fetus_sex
        type: enum
        values: {M: Male, F: Female, U: Unknown}
        description: >
          Sex of fetus.

      - name: fetus_wt
        type: number(quantity)
        range: [0, 2112.0]
        description: >
          Weight of fetus in grams.

      - name: fetus_lth
        type: number(quantity)
        range: [0.3, 65.0]
        description: >
          Length of fetus in centimeters.

      - name: fe_rep_con
        type: enum
        values:
          IMP: Implanted pregnant
          UNI: Unimplanted pregnant
          ANE: Anestrous
          EST: In estrous
          POS: Undocumented
          PRO: Undocumented
          FAI: Undocumented
        description: >
          Female reproductive condition.

      - name: fe_rep_sta
        type: enum
        values: {N: Nulliparous, M: Multiparous, P: Primiparous}
        description: >
          Female reproductive state (collections only).

      - name: pregnancy_status
        type: enum
        values:
          NP: Not pregnant at collection or capture
          U: Unknown
          NPP: Not palpably pregnant at capture
          P: Fetus present at collection or palpably pregnant at capture
          PP: Undocumented
          TT: Undocumented
        description: >
          Pregnancy status.

      - name: can_dia
        type: number(quantity)
        range: [2.9, 11.1]
        description: >
          Diameter of canine tooth at gum line (widest dimension) in
          millimeters.

      - name: final_age
        type: number(ordinal)
        range: [0, 23]
        description: >
          Age of otter at time of capture or collection in years, based on
          known age, tooth cementum age, or field age estimate.

      - name: age_category
        type: enum
        values:
          0: Less than 1 year
          1.5: 1-2 years
          7: 3-10 years
          13: Greater than 10 years
        description: >
          Age category of otter.

      - name: bacula_lgth
        type: number(quantity)
        range: [2.2, 163.4]
        description: >
          Baculum length in centimeters (males only).

      - name: comments
        type: string
        examples:
          - "CL (ventral) 119 cm, CL (foetal) 138 cm"
          - "died in capture net"
          - "pupped 10 wks later"
          - "originally 84-001"
        description: >
          Notes about the capture or collection event.
        examples: ["given 92-114", "died summer 1997", "originally 84-001", "given number SO-97-40 in 1997 capture", "pup < 8 wks later but preg missed at capture"]

      - name: cause_of_death_capture_method
        type: enum
        values:
          0: Typical live capture
          1: Collected via harvest
          4: Measured after some time in captivity
          5: Captured off a beach
        description: >
          Cause of death or capture method.

relationships:
  - description: >
      Links a female otter to her dependent pup's own record. Not all pups
      have their own row (221 of 389 pup_number values match an otter_no).
    cardinality: one-to-many
    join: otters.otter_no = otters.pup_number

glossary:
  curvilinear length: >
    Length measured along the curve of the back as the otter lay on its
    stomach, used primarily during experimental harvests (1967-1971).
  standard length: >
    Straight-line length measured as the otter lay on its back, used during
    early studies (1947-1963) and more recent live captures (1986-2019).
  true standard length: >
    Curvilinear length corrected by a factor of 0.974 to make it comparable
    to standard length measurements.
  experimental harvest: >
    Controlled collection of sea otters primarily conducted in the 1960s and
    1970s for research purposes.
  nulliparous: >
    A female that has never given birth.
  primiparous: >
    A female that has given birth once.
  multiparous: >
    A female that has given birth multiple times.
  baculum: >
    A bone found in the penis of male otters, measured as a way to estimate
    age class.
  xiphoid: >
    The lower portion of the sternum (breastbone), used as a landmark for
    girth measurements.
