hydro.legacy.woce#

Package Contents#

Functions#

flag_description(flag_map)

simplest_str(s)

Give the simplest string representation.

_pad_station_cast(x)

Pad a station or cast identifier out to 5 characters. This is usually

get_filename(expocode, station, cast, file_ext)

convert_fortran_format_to_c(ffmt)

Simplistic conversion from Fortran format string to C format string.

get_exwoce_params()

Return a dictionary of WOCE parameters allowed for Exchange conversion.

writeable_columns(ds[, is_ctd])

Return the columns that belong in a WOCE data file.

columns_and_base_format(dfile[, is_ctd])

Return columns and base format for WOCE fixed column data.

truncate_row(lll)

Return a new row where all items are less than or equal to column width.

write_data(ds, columns, base_format)

Write WOCE data in fixed width columns.

write_bottle(ds)

How to write a Bottle WOCE file.

write_ctd(ds)

How to write a CTD WOCE file.

to_woce(ds)

Attributes#

hydro.legacy.woce.CTD_ZIP_FILE_EXTENSION = 'ct.zip'[source]#
hydro.legacy.woce.CTD_FILE_EXTENSION = 'ct.txt'[source]#
hydro.legacy.woce.BOTTLE_FILE_EXTENSION = 'hy.txt'[source]#
hydro.legacy.woce.FILL_VALUE[source]#
hydro.legacy.woce.ASTERISK_FLAG[source]#
hydro.legacy.woce.CHARACTER_PARAMETERS = ['STNNBR', 'SAMPNO', 'BTLNBR'][source]#
hydro.legacy.woce.COLUMN_WIDTH = 8[source]#
hydro.legacy.woce.SAFE_COLUMN_WIDTH[source]#
hydro.legacy.woce.UNKNONW_TIME_FILL = '0000'[source]#
hydro.legacy.woce.BOTTLE_FLAGS[source]#
hydro.legacy.woce.CTD_FLAGS[source]#
hydro.legacy.woce.WATER_SAMPLE_FLAGS[source]#
hydro.legacy.woce.flag_description(flag_map)[source]#
hydro.legacy.woce.BOTTLE_FLAG_DESCRIPTION[source]#
hydro.legacy.woce.CTD_FLAG_DESCRIPTION[source]#
hydro.legacy.woce.WATER_SAMPLE_FLAG_DESCRIPTION[source]#
hydro.legacy.woce._UNWRITTEN_COLUMNS = ['EXPOCODE', 'SECT_ID', 'LATITUDE', 'LONGITUDE', 'DEPTH', '_DATETIME'][source]#
hydro.legacy.woce.simplest_str(s)[source]#

Give the simplest string representation.

If a float is almost equivalent to an integer, swap out for the integer.

Return type:

str

hydro.legacy.woce._pad_station_cast(x)[source]#

Pad a station or cast identifier out to 5 characters. This is usually for use in a file name.

Parameters:

x (str) – a string to be padded

Return type:

str

hydro.legacy.woce.get_filename(expocode, station, cast, file_ext)[source]#
hydro.legacy.woce.convert_fortran_format_to_c(ffmt)[source]#

Simplistic conversion from Fortran format string to C format string.

This only operates on F formats.

Parameters:

ffmt (str) –

hydro.legacy.woce.get_exwoce_params()[source]#

Return a dictionary of WOCE parameters allowed for Exchange conversion.

Returns:

{‘PMNEMON’: {‘unit_mnemonic’: ‘WOCE’, ‘range’: [0.0, 10.0], ‘format’: ‘%8.3f’}}

hydro.legacy.woce._EXWOCE_PARAMS[source]#
hydro.legacy.woce.writeable_columns(ds, is_ctd=False)[source]#

Return the columns that belong in a WOCE data file.

Parameters:

ds (xarray.Dataset) –

hydro.legacy.woce.columns_and_base_format(dfile, is_ctd=False)[source]#

Return columns and base format for WOCE fixed column data.

hydro.legacy.woce.truncate_row(lll)[source]#

Return a new row where all items are less than or equal to column width.

Warnings will be given for any truncations.

hydro.legacy.woce.write_data(ds, columns, base_format)[source]#

Write WOCE data in fixed width columns.

columns and base_format should be obtained from columns_and_base_format()

hydro.legacy.woce.write_bottle(ds)[source]#

How to write a Bottle WOCE file.

Parameters:

ds (xarray.Dataset) –

hydro.legacy.woce.write_ctd(ds)[source]#

How to write a CTD WOCE file.

Parameters:

ds (xarray.Dataset) –

hydro.legacy.woce.to_woce(ds)[source]#
Parameters:

ds (xarray.Dataset) –

Return type:

bytes