Skip to content

Calibration hybrid milidecades #160

@JPalmerK

Description

@JPalmerK

Hey there,
Not sure if this issue fits better in pyhydrophone or in pypam but I've been testing the hybrid milidecade band analysis a csv file. I've ensured that the data are being properly read into the hydrophone object (get_freq_cal within the hydrophone object, line 154) but the hybridmilidecades do not seem to change with or without the frequency dependent sensitivity included. Any help would be most appreciated. Thanks!


# Create a custom hydrophone class with the model number, serial number, and
# name (Dummy)
model = "alasdfasdfae"
name = "asdfsddd"
serial_number = 8675309
drifter_noCal = pyhy.RTSys(
    name=name, 
    model=model, 
    sensitivity=-172.8, 
    serial_number=serial_number,
    preamp_gain= 10,
    Vpp =2,
    mode = 'broadband')

drifter_Cal = pyhy.RTSys(
    name=name, 
    model=model, 
    sensitivity=-172.8, 
    serial_number=serial_number,
    preamp_gain= 10,
    Vpp =2,
    mode = 'broadband',
    calibration_file = calFileLoc)


# First, decide band to study. The top frequency should not be higher than the nyquist frequency (sampling rate/2)
band = [0, 4000]

# Then, set the nfft to double the sampling rate. If you want to pass None to your band, that is also an option, but
# then you need to know the sampling frequency to choose the nfft.
nfft = band[1] * 2  # or nfft = 8000

# Set the band to 1 minute
binsize = 60.0

include_dirs = False
zipped_files = False
dc_subtract = True

# Create an asa for the frequency specific calibration and non-frequency specific calibration 
asa_cal = pypam.ASA(
    hydrophone=drifter_Cal,
    folder_path="C:\\Users\\kaity\\Documents\\GitHub\\SPACIOUS-Propagation-Modes\\ExampleData",
    binsize=binsize,
    nfft=nfft,
    timezone="UTC",
    include_dirs=include_dirs,
    zipped=zipped_files,
    dc_subtract=dc_subtract)

asa_nocal = pypam.ASA(
    hydrophone=drifter_noCal,
    folder_path="C:\\Users\\kaity\\Documents\\GitHub\\SPACIOUS-Propagation-Modes\\ExampleData",
    binsize=binsize,
    nfft=nfft,
    timezone="UTC",
    include_dirs=include_dirs,
    zipped=zipped_files,
    dc_subtract=dc_subtract)


# Compute the hybrid millidecade bands

milli_psd_cal = asa_cal.hybrid_millidecade_bands(
    db=True, method="density", band=band, percentiles=None)
aa_cal = 20*np.log10(milli_psd_cal.band_density.values)


milli_psd_nocal = asa_nocal.hybrid_millidecade_bands(
    db=True, method="density", band=band, percentiles=None)
aa_nocal = 20*np.log10(milli_psd_nocal.band_density.values)

# Ach! they are the same.
difval = aa_cal-aa_nocal

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