hydro.discoverability ===================== .. py:module:: hydro.discoverability .. autoapi-nested-parse:: Functions for adding ACDD/discoverability attributes to datasets based on their contents Functions --------- .. autoapisummary:: hydro.discoverability.flag_histogram hydro.discoverability.min_max hydro.discoverability.temporal hydro.discoverability.geospatial hydro.discoverability.add_discoverability_attributes Module Contents --------------- .. py:function:: flag_histogram(ds) For flag variables, create a histogram of how many times each flag value appears .. py:function:: min_max(ds) Set min/max attributes on all the numeric data variables including flags This will use two "made up" attribute names of: * actual_max * actual_min The more well known attributes of "valid_min" and "valid_max" apply to the packed data, so if there are add_offset and scale_factor attributes, any valid_* attributes would apply to the data before scaling/multiplying. Additionally, generic applications should mask any values outside the "valid" ranges. CF defines an attribute "actual_range" that includes both min and max values of the unpacked data. For JSON-LD/schema.org reasons we need the min/max as separate values. .. py:function:: temporal(ds) Set the temporal extent global attributes This includes: * time_coverage_start * time_coverage_end .. py:function:: geospatial(ds) Set the geospatial extent global attributes These include: * geospatial_lat_min * geospatial_lat_max * geospatial_lon_min * geospatial_lon_max * geospatial_vertical_min * geospatial_vertical_max * geospatial_vertical_positive (always "down") * geospatial_vertical_units (always "dbar") Note that according to the "spec" of ACDD 1.3 if the lon min is greater than the lon max, this indicates that the geospatial extent crosses the discontinuity meridian. This function assumes that if the difference between the min/max of lon is larger than 300 degrees that crossing is occurring. The behavior if the ship goes to a longitude singularity such as the north pole not explicitly handled. The ACDD 1.3 "spec" also allows for the pressure units of bar to be used for the vertical units. .. py:function:: add_discoverability_attributes(ds) Add (or update) all the discoverability metadata from all the other functions in this module