Skip to content

Commit

Permalink
Actually remove it; don't just comment it out
Browse files Browse the repository at this point in the history
  • Loading branch information
dnowacki-usgs committed Feb 15, 2024
1 parent 3bee670 commit 7758ef6
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 74 deletions.
4 changes: 1 addition & 3 deletions doc/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ EXO
EXO-specific options include:

- ``skiprows``: number of lines to skip in the CSV before the real data begins
..
- ``trim_by_salinity``: if ``'true'``, use salinity (``S_41``) as a master variable. Wherever salinity is ``_FillValue``, all other variables will be filled as well. Useful for when the instrument comes out of the water.

Note that negative numeric values in the YAML config file must be treated with care so as not to be interpreted as strings. If you want the minimum value to be, say, -0.2 units for a particular parameter, you must write this as ``-0.2`` and not ``-.2`` in the config file. The latter format will be interpreted as a string and will cause an error.

Expand Down Expand Up @@ -199,4 +197,4 @@ Lowell TCM Hobo
- All the _min, _max, _bad_ens, etc. options available to the EXO.
- ``skipfooter``: number of lines to skip in the CSV file at the end of the file
- ``ncols``: number of columns of data to read, starting at first
- ``names``: option for user specified column names (only recommended when code will not read names using automated/default method)
- ``names``: option for user specified column names (only recommended when code will not read names using automated/default method)
4 changes: 0 additions & 4 deletions stglib/aqd/aqdutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ def coord_transform(vel1, vel2, vel3, heading, pitch, roll, T, T_orig, cs, out="
return u, v, w


# def swap_bindist_to_depth(ds):
# return ds.swap_dims({"bindist": "depth"})


def set_orientation(VEL, T):
"""
Create Z variable depending on instrument orientation
Expand Down
2 changes: 0 additions & 2 deletions stglib/aqd/wvscdf2nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ def cdf_to_nc(cdf_filename, atmpres=False, writefile=True):
# Make bin_depth variable
ds = aqdutils.make_bin_depth(ds, waves=True)

# Swap dimensions from bindist to depth
# ds = aqdutils.swap_bindist_to_depth(ds)
ds = cdf2nc.ds_swap_dims(ds)
# Rename DataArrays within Dataset for EPIC compliance
# and append depth coord to velocities and amplitudes
Expand Down
23 changes: 0 additions & 23 deletions stglib/core/qaqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,29 +186,6 @@ def trim_bad_ens_indiv(ds, var):
return ds


# def trim_by_salinity(ds, var):
# if (
# "trim_by_salinity" in ds.attrs
# and ds.attrs["trim_by_salinity"].lower() == "true"
# and var in ds
# ): # xarray doesn't support writing attributes as booleans
# if (
# "trim_by_salinity_exclude" in ds.attrs
# and var in ds.attrs["trim_by_salinity_exclude"]
# ):
# pass
# else:
# print("%s: Trimming using valid salinity threshold" % var)
# ds[var][ds["S_41"].isnull()] = np.nan
#
# if var != "S_41":
# notetxt = "Values filled using valid salinity threshold. "
#
# ds = utils.insert_note(ds, var, notetxt)
#
# return ds


def trim_by_any(ds, var):
attrlist = []
for a in ds.attrs:
Expand Down
25 changes: 0 additions & 25 deletions stglib/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,31 +673,6 @@ def create_epic_times(ds, waves=False):
return ds


# def create_2d_time(ds):
# print("Creating 2D time variable")
# # time increment in milliseconds
# td = ds.attrs["sample_interval"] * np.arange(ds.attrs["samples_per_burst"]) * 1000
#
# # time_2d is a CF representation of a 2d time
# ds["time_2d"] = xr.DataArray(
# np.expand_dims(ds["time"], 1) + [np.timedelta64(int(x), "ms") for x in td],
# dims=("time", "sample"),
# )
#
# raveljd = make_jd(pd.DatetimeIndex(np.ravel(ds["time_2d"])))
# jd_2d = np.reshape(raveljd, ds["time_2d"].shape)
#
# ds["epic_time_2d"] = xr.DataArray(make_epic_time(jd_2d), dims=("time", "sample"))
# ds["epic_time_2d"].encoding["_FillValue"] = None
#
# ds["epic_time2_2d"] = xr.DataArray(make_epic_time2(jd_2d), dims=("time", "sample"))
# ds["epic_time2_2d"].encoding["_FillValue"] = None
#
# ds = ds.drop("time_2d") # don't need it anymore
#
# return ds


def check_update_attrs(ds, key, value):
"""Update attr and raise warning if attr already exists and is different from replacement value"""
if key in ds.attrs and ds.attrs[key] != value:
Expand Down
9 changes: 0 additions & 9 deletions stglib/troll.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,6 @@ def read_aquatroll(filnam, skiprows=69, encoding="utf-8", skipfooter=0):
return df


# def read_aquatroll_header(filnam, encoding="utf-8"):
# with open(filnam, encoding=encoding) as f:
# for line in f.readlines():
# if "Time Zone:" in line:
# # remove commas and only return the value,
# # not the 'Time Zone: ' part
# return line.replace(",", "").strip()[11:]


def ds_rename_vars(ds):
varnames = {
"pressure": "P_1ac",
Expand Down
8 changes: 0 additions & 8 deletions stglib/wxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,6 @@ def ds_rename_vars(ds):
return ds.rename(newvars)


# Convert data from float 64 to float32
# def ds_convertfloat(ds):
# for var in ds.variables:
# if ds[var].name != "time":
# ds[var] = ds[var].astype("float32")
# return ds


# Add attributes: units, standard name from CF website, epic code
def ds_add_attrs(ds):
ds = utils.ds_coord_no_fillvalue(ds)
Expand Down

0 comments on commit 7758ef6

Please sign in to comment.