r2r_ctd.accessors ================= .. py:module:: r2r_ctd.accessors .. autoapi-nested-parse:: Adds an .r2r accessor to the xarray.Dataset objects in use within this software. Mostly these are wrappers around functions in :py:mod:`r2r_ctd.derived` for nice syntax. Instead of writing:: get_longitude(ds) I could write:: ds.r2r.longitude While that example isn't very short, some of the more involved derived products benefit nicely from this e.g.:: get_or_write_derived_file(ds, "con_report", make_con_report) Makes the configuration report, with the accessor pattern, this becomes as simple as getting the longitude:: d2.r2r.con_report All that complexity is hidden from me. Does it need to be that complex? Probably, since that function checks the cache, and if missed, runs a while routing within the companion container to get the results. Attributes ---------- .. autoapisummary:: r2r_ctd.accessors.logger Classes ------- .. autoapisummary:: r2r_ctd.accessors.R2RAccessor Module Contents --------------- .. py:data:: logger .. py:class:: R2RAccessor(xarray_obj: xarray.Dataset) .. py:attribute:: _obj .. py:property:: __geo_interface__ .. py:property:: name Get the "name" of this station, basically the hex file name with the .hex removed .. py:property:: latitude :type: float | None Simple wrapper around :py:func:`~r2r_ctd.derived.get_latitude` .. py:property:: longitude :type: float | None Simple wrapper around :py:func:`~r2r_ctd.derived.get_longitude` .. py:property:: lon_lat_valid :type: bool Caching wrapper around :py:func:`~r2r_ctd.checks.check_lon_lat_valid` .. py:property:: time :type: datetime.datetime | None Simple wrapper around :py:func:`~r2r_ctd.derived.get_time` .. py:property:: time_valid :type: bool Caching wrapper around :py:func:`~r2r_ctd.checks.check_time_valid` .. py:property:: all_three_files :type: bool Caching wrapper around :py:func:`~r2r_ctd.checks.check_three_files` .. py:method:: time_in(dt_range: r2r_ctd.breakout.Interval) -> bool Caching wrapper around :py:func:`~r2r_ctd.checks.check_dt` .. py:method:: lon_lat_in(bbox: r2r_ctd.breakout.BBox) -> bool Caching wrapper around :py:func:`~r2r_ctd.checks.check_lon_lat` .. py:property:: con_report :type: str | None Caching wrapper around :py:func:`~r2r_ctd.derived.make_con_report` .. py:property:: cnv_24hz :type: str | None Caching wrapper around :py:func:`~r2r_ctd.derived.make_cnvs` Will generate the :py:meth:`cnv_1db` as a side effect if not already done. .. py:property:: cnv_1db :type: str | None Caching wrapper around :py:func:`~r2r_ctd.derived.make_cnvs` Will generate the :py:meth:`cnv_24hz` as a side effect if not already done. .. py:property:: bottles_fired :type: bool This cast has bottle trip records in its bl file. A trip record has 5 components: * sequence (int) * carrousel position (int) * timestamp (time string) * scan start (int) * scan end (int) This works by checking each line to see if any of the 4 "int" components parse as ints and returning true if any of them can. The bl file records every attempt to close a bottle and does not necessarily reflect how many bottles actually closed .. py:method:: write_con_report(breakout: r2r_ctd.breakout.Breakout) -> None Actually write the configuration report files to disk. .. py:method:: write_cnv(breakout: r2r_ctd.breakout.Breakout, cnv: Literal['cnv_24hz', 'cnv_1db']) -> None Actually write the derived cnv files to disk.