updates to time_frequency_scratch reflecting library changes
moved database read code to dbio.py