Skip to content

This class converts and joins netcdf files from the Tall Tower database into a csv file

Notifications You must be signed in to change notification settings

marcosp-araujo/Tower2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

The Tall Tower is an open database aimed at boosting the use of hub-height wind observations from meteorological towers. The Tower2csv.py class scans netCDF files from a Tall Tower database and joins all of them into a single .CSV file.

How to use

A "how to" example is provided in the main.py file:

from modules.Tower2csv import Tower2csv

if __name__ == "__main__":
   
    netcdf_dir = r".\owez\10minutely" # directory of the netCDF files
    save_dir = "."                    # directory to save the .csv file
    save_file_name = "owez"           # Save file name

    T = Tower2csv(netcdf_dir, save_dir, save_file_name)

Requirements

See requirements.txt. You can install them using the following command in your terminal:

pip install -r requirements.txt

Input parameters

The Tower2csv requires three inputs:

1 - netcdf_dir = Directory of the netCDF files (string).

2 - save_dir = Directory to save the .CSV (string).

3 - save_file = Name of the .CSV file to be saved (string).

Input data example

Data from the OWEZ offshore meteorological tower are used to exemplify the Tower2csv applicability. The example data are in the owez folder. You can find data from other sites at the following link: https://talltowers.bsc.es/access-the-data

Input database structure

Now, let's continue by understanding the dataset structure using the data example which is uploaded here. When opening the owez folder, there is a subfolder called 10minutely:

image

The data are organized in different subfolders inside 10minutely, which are named according to the sensor type:

image

For instance, in the humidity-sensor folder "huragl116S1", you will see that there is one netCDF file for each month:

image

Output example

One output example is in owez.csv. When running the Tower2csv.py via main.py, all netCDF files from all subfolders are joined, and then, saved into a single .CSV file. Data from each sensor are stored in different comma-separated columns as follows:

image

About

This class converts and joins netcdf files from the Tall Tower database into a csv file

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages