Create a DataWindow#

In this example we will demonstrate how to create a DataWindow using raw data files.

Please note:

Raw data files are stored in one of two ways:

  • Structured: Files are organized by date and time as specified in the API-M repo.

  • Unstructured: All files exist at the same level in the directory.

Raw data files come in specially formatted files with one of the following extensions: .rdvxz or .rdvxm.

If you have downloaded a pre-constructed DataWindow, then please visit the Load DataWindow section.

Loading Raw Data#

Please note: Creating a DataWindow will take longer to complete the more data being used to create it. Please have patience when reading large amounts of data.

This example shows how to load raw data files in a structured layout.

from redvox.common.data_window import DataWindow, DataWindowConfig

# Input Directory
input_dir = "path/to/redvox/data"

# Configuration for DataWindow
dw_config = DataWindowConfig(input_dir=input_dir, structured_layout=True)

# Create the DataWindow
dw = DataWindow("my_dw", config=dw_config)

This example shows how to load raw data files in an unstructured layout.

from redvox.common.data_window import DataWindow, DataWindowConfig

# Input Directory
input_dir = "path/to/redvox/data"

# Configuration for DataWindow
dw_config = DataWindowConfig(input_dir=input_dir, structured_layout=False)

# Create the DataWindow
dw = DataWindow("my_dw", config=dw_config)

You may want more control over which data is loaded into DataWindow. Please view the DataWindow Parameters example for more details.

If you encounter any issues while creating a DataWindow, refer to the page on Troubleshooting

Now that you have a DataWindow, we will demonstrate how to access the metadata in the next section.