Coder Social home page Coder Social logo

marcosp-araujo / tower2csv Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 27.13 MB

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

Home Page: https://talltowers.bsc.es/access-the-data

Python 100.00%
meterology wind-energy

tower2csv's Introduction

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

tower2csv's People

Contributors

marcosp-araujo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.