Skip to content

Commit

Permalink
Merge pull request #140 from DeepSenseCA/mnt_loading-ev-special-values
Browse files Browse the repository at this point in the history
MNT: Load values outside the range -1e37 to 1e37 as NaN
  • Loading branch information
scottclowe authored Jun 15, 2020
2 parents d827620 + e6137d8 commit c5f74cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion echofilter/raw/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ def transect_loader(
# Turn NaNs into NaNs (instead of extremely negative number)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", "invalid value encountered in less")
data[data < -1e6] = np.nan
warnings.filterwarnings("ignore", "invalid value encountered in greater")
# 9.9e+37 and -9.9e+37 are special values indicating missing data
# https://support.echoview.com/WebHelp/Reference/File_formats/Export_file_formats/Special_Export_Values.htm
data[data < -1e37] = np.nan
data[data > 1e37] = np.nan

# Trim timestamps dimension down to size
timestamps = timestamps[:n_entry]
Expand Down

0 comments on commit c5f74cd

Please sign in to comment.