Normalize data with notebooks

    Walk through the following example to create a notebook that queries NOAA NDBC sample data, normalizes degree-based wind directions to cardinal directions, and then writes the normalized data to a bucket.

    1. .

    2. In the Build a Query cell:

      1. In the FROM column under Sample, select NOAA National Buoy Data.
      2. In the next FILTER column, select _measurement from the drop-down list and select the ndbc measurement in the list of measurements.
      3. In the next FILTER column, select _field from the drop-down list, and select the wind_dir_degt field from the list of fields.
      1. Define a custom function () that converts a numeric degree value to a cardinal direction (N, NNE, NE, etc.).

      2. Use to load the output of the previous notebook cell into the Flux script.

      3. Use map() to iterate over each input row, update the field key to , and normalize the column to a cardinal direction using the custom function.

    3. Click after your Flux Script cell to add a new cell and select Output to Bucket. Select a bucket from the Choose a bucket drop-down list.

    4. Click Run to run the notebook and write the normalized data to your bucket.

    To continuously run your notebook, export the notebook as a task:

    1. Click to add a new cell and then select Task.

      • Every: Interval that the task should run at.
      • Offset: (Optional) Time to wait after the defined interval to execute the task. This allows the task to capture late-arriving data.
    2. Click Export as Task.