r2r_ctd.checks ============== .. py:module:: r2r_ctd.checks .. autoapi-nested-parse:: The basic check functions that are done on files or paths. The original intent was that all the functions that produce the 4 element stoplight report would live here and be 1-1 with each check in that report. It became clear that this was not going to work well pretty early as most of those report elements are from an aggregate over all the stations. Additionally, some checks serve as a sieve, for example, stations where :py:func:`is_deck_test` returns true aren't checked or considered in the report at all. The first check in the qa report is just checking that the breakout itself is valid before anything else happens. That check is over in :py:obj:`r2r_ctd.breakout.Breakout.manifest_ok`. Attributes ---------- .. autoapisummary:: r2r_ctd.checks.logger Functions --------- .. autoapisummary:: r2r_ctd.checks.is_deck_test r2r_ctd.checks.check_three_files r2r_ctd.checks.check_lon_lat_valid r2r_ctd.checks.check_time_valid r2r_ctd.checks.check_lon_lat r2r_ctd.checks.check_dt Module Contents --------------- .. py:data:: logger .. py:function:: is_deck_test(path: pathlib.Path) -> bool Check if the given path "looks like" a deck test This method matches the pathname against a list of strings that are common to desk tests. .. py:function:: check_three_files(ds: xarray.Dataset) -> bool Check that each hex file has both an xmlcon and hdr files associated with it. Stations are, at a minimum, expected to have a .hex, .xmlcon, and .hdr file all next to each other. For example, a ``00101.hex`` should have a ``00101.hdr`` and ``00101.xmlcon`` file also present. In practice, this files need to be found in a case insensitive way, for example, the associated ``.xmlcon`` for a ``rr1608_01.hex`` file might be named ``RR1608_01.XMLCON``. The underlying odf.sbe library takes care of these details for us. The input dataset is expected conform output of odf.sbe.read_hex. This dataset is then checked to see if it has all the correct keys. .. py:function:: check_lon_lat_valid(ds: xarray.Dataset) -> bool Checks if a valid lat/lon can even be extracted from the hex/header .. py:function:: check_time_valid(ds: xarray.Dataset) -> bool Checks if a valid time can even be extracted from the hex/header .. py:function:: check_lon_lat(ds: xarray.Dataset, bbox: BBox | None) -> bool Checks that the lon lat of the cast are within the cruise bounding box .. py:function:: check_dt(ds: xarray.Dataset, dtrange: Interval | None) -> bool Checks that the time of the cast are within the cruise interval