nrgpy.utils.nsd_functions module#

class nrgpy.utils.nsd_functions.nsd(nsd_file='')[source]#

Bases: object

class for handling NSD files from Symphonie Logger Data.

Parameters:
nsd_filestr

path to nsd file to open for reading and writing

Returns:
obj
add_channel_history(timestamp='', channel=0, sensor_type='1', sensor_desc='', print_precision=4, units='', serial_number='', height='', sensor_detail='', sensor_notes='', scale_factor=-9999, offset=-9999)[source]#

use for adding new sensor history registries

Parameters:
timestampstring

“YYYY-MM-DD HH:MM:SS”

channelint

or string, channel number

sensor_typeint
or string, number:

1 : anemometer 2 : totalizer (rain gauge) 3 : vane 4 : analog (temp, bp, rh, etc.)

sensor_descstring

description

print_precisionint

1 through 4, number of decimals

unitsstring
serial_numberstring
heightfloat
sensor_detailnote
sensor_notesnote
scale_factorfloat
offsetfloat
check_for_jet_drivers()[source]#

check for jet database drivers

Returns:
bool

True if drivers present, otherwise False

check_platform() linux#

determine which operating system python is running on

close()[source]#

close connection to database

read_channel_settings(channel=0, dash=False)[source]#

read individual channel settings from sensor history table

Parameters:
channelint

1 through 15 (12 if Sym Classic nsd file)

Returns:
obj

pandas dataframe of channel details

read_sensor_history()[source]#

read SensorHistory table into dataframe

Returns:
obj

sensor_history : pandas dataframe

write_channel_settings(channel=0, entry=1, sensor_desc='', print_precision=-9999, units='', serial_number='', height='', sensor_detail='', sensor_notes='', scale_factor=-9999, offset=-9999)[source]#

write new sensor history to site file

Parameters:
channelint

required; 1 through 15 (or 1 through 12 for Sym Classic)

entryint

default is 1 for channel baseline values, 2, 3, etc. for newer entries

sensor_descstring
print_precisionint

1, 2, 3, or 4 or 0 for off

unitsstring
serial_numberstring
heightstring
sensor_detailstring
sensor_notesstring
scale_factorfloat
offsetfloat