# _compat

<table class=".origin_table">
    <tr>
        <td style="text-align: left; border-style: hidden">*module*  of [dascore.io.dasdae](`dascore.io.dasdae`)</td>
        <td style="text-align: right; border-style: hidden">[source](https://github.com/DASDAE/dascore/blob/dev/dascore/io/dasdae/_compat.py#L1-L177)</td>
    </tr>
</table>


Backward compatibility for legacy DASDAE metadata.

Older DASDAE files mixed coordinate metadata into the patch attr namespace:
coord summaries were stored as a (sometimes pickled) ``coords`` attr, and
flat keys such as ``time_min`` or ``d_time`` lived alongside true patch
attrs. They also stored unit companions (``gauge_length_units``) beside
values that patch attrs now record in the inventory's fixed units. Files
written after attrs and coords were fully separated carry the
``__attrs_coords_separate__`` root marker and store only true attrs.

This module is private to ``dascore.io.dasdae``; nothing else in DASCore may
import it. Attrs and coords are independent everywhere else, so all knowledge
of the old mixed shapes is quarantined here.

## Functions

<table class="table">
  <thead>
    <tr>
            <th scope="col"> Name</th>
            <th scope="col"> Description</th>
    </tr>
  </thead>
  <tbody>
        <tr>
            <td>[strip_legacy_coord_fields](`dascore.io.dasdae._compat.strip_legacy_coord_fields`)</td>
            <td>Remove legacy flat coordinate metadata from an attr mapping.</td>
        </tr>
        <tr>
            <td>[translate_legacy_attrs](`dascore.io.dasdae._compat.translate_legacy_attrs`)</td>
            <td>Normalize legacy DASDAE attr payloads to flat coord metadata.</td>
        </tr>
  </tbody>
</table>

