Skip to content

Trouble comparing NOAA webpage and echoSMs #52

Description

@swill-24

Hello,

I ran the example code to compare results from the NOAA KRM webpage and echoSMs. I can see comparisons for some of the fish (i.e. Sardine, Bocaccio), but for other fish (i.e. WhiteCatfish_185, StripedBass_205), I get the following error. Do you know why this might be? Thanks!

CODE SECTION:

%%

Try the KRM model and compare to the NOAA online KRM calculator results

mod = KRMModel()

fishes = ['Sardine', 'StripedBass_205']

for fname in fishes:
fish = KRMdata().model(fname)
fish.plot()

# Create the dict that echoSMs models use and add required parameters
p = {'medium_c': 1490, 'medium_rho': 1030, 'organism': fish, 'theta': 90,
     'f': np.arange(12, 121, 1)*1e3,
     'high_ka_medium': 'water', 'low_ka_medium': 'water'}
# Note 'water' is used for the high_ka_medium and low_ka_medium parameters to
# match the TS in the available from KRMdata() class (which came from the
# online NOAA KRM calculator). To see the results when 'body' is used, uncomment these two
# lines:
# p['high_ka_medium'] = 'body'
# p['low_ka_medium'] = 'body'

krm_ts = mod.calculate_ts(p, progress=True)

# Get the TS from the NOAA KRM webpage (cached locally)
noaa_ts = KRMdata.ts(fname)
plot_compare_freq(p['f'], krm_ts,
                  'KRM echoSMs', p['f'], noaa_ts[' TS (dB).1'], 'KRM NOAA', fname)

ERROR:
TypeError Traceback (most recent call last)
Cell In[16], line 27
23
24 # Get the TS from the NOAA KRM webpage (cached locally)
25 noaa_ts = KRMdata.ts(fname)
26 plot_compare_freq(p['f'], krm_ts,
---> 27 'KRM echoSMs', p['f'], noaa_ts[' TS (dB).1'], 'KRM NOAA', fname)

TypeError: 'NoneType' object is not subscriptable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions