Code Monkey home page Code Monkey logo

top-air's Introduction

(Top_air) Read Upper-Air data and make template by Supaporn Noisen

This project can read csv, text file (in Thai Meteorological Department format) and Upper-Air code to decode and clean or filter data before use template to plot charts and calculate indicators. Skew-t, hodograph, wind brab and indicators use MetPy library (https://pypi.org/project/MetPy/) to make template.

Need install library

  • metpy, numpy, pandas, requests, matplotlib

How to use?

  • Download top_air.py and condition.py to your project folder
  • Import file
import top_air as rws

[Read Upper-Air in text file]

  • Use Upper-Air or pilot data (.txt) to create skew-t ,wind brab and hodograph.
  • Read data from text file, It will return to filtered output data as temperature, dew potnt , wind speed , wind direction in list.
CM_SIGLVLS_name = "CM2023111523_SIGLVLS"
souce_file_input = "example_data\\"
dest_file_output = "example_output\\"
P2, T2, Td2, Wd2, Ws2 = rws.rawindsonde_txt(CM_SIGLVLS_name, souce_file_input).data_merge()
  • Input pressure, temperature, dew point, wind speed ,wind direction to template (use metpy and matplotlib library to make template.)
pilot_txt_vtcc = rws.skew_t_create(P2, T2, Td2, Wd2, Ws2)
pilot_txt_vtcc.plot_skew_t("Output_name_1", dest_file_output, "15-11-2023", "15:23",name_location="Chiang maistaion", size=[14, 8])

alt text

[Select data range]

  • You can limit pressure level and make out put data to csv or excel by use parameter just like this code.
P3, T3, Td3, Wd3, Ws3 = rws.rawindsonde_txt(CM_SIGLVLS_name,souce_file_input).data_merge(press_limit=250,type="excel",file_name="excel_output",dest="example_output\\")
pilot_txt_vtcc = rws.skew_t_create(P3, T3, Td3, Wd3, Ws3)
  • but you should adjust parameter to make ratio template and decorate skew-t chart like this command.
pilot_txt_vtcc.plot_skew_t("Output_name_2", dest_file_output, "15-11-2023", "15:23", name_location="Chiang maistaion",
size=[14, 8],y_limit=200,x_limit=[-20, 40], hodo_color=True,pacel_prof_plot = True,cape_cin_plot = True)

alt text

[Read and decode Upper-Air code file]

  • Use rawindsonde or pilot code to create skew-t, hodograph.
Code_file_name = "16112566"
Code_file_input = "example_data\\"
pilot_code = rws.rawindsonde_decode(Code_file_name, Code_file_input)
P4, T4, Td4, Pb4, Wd4, Ws4 = pilot_code.data_merge(press_limit=25)
  • you should add more Pressure brab, wind direction and wind speed to template maker because of data from decoder is separate group.
pilot_code_plt.plot_skew_t("decode_data", "example_output\\", "16-11-2023", "00:00", name_location="title name",
show_skt=False, hodo_itv=[2, 2, 2],press_barb=Pb4, wd_barb=Wd4, ws_barb=Ws4, hodo_color=True, size=[14, 8])

alt text

[Read wind profiler file in csv format]

  • Use csv from wind profiler to filter and make data template.
CSV_file_name = "20231117_0450"
source_csv_input = "example_data\\"
P5, T5, Td5, Pb5, Wd5, Ws5 = rws.windprofiler_csv(CSV_file_name,source_csv_input).data_merge()

wpfl_csv_vtcc = rws.skew_t_create(P5, T5, Td5, Wd5, Ws5)
wpfl_csv_vtcc.plot_skew_t("wind_profiler_output", "example_output\\", "17-11-2023", "00:00",name_location="Chiang mai",
y_limit=200, show_skt=False,press_barb=Pb5, wd_barb=Wd5, ws_barb=Ws5,brab_itv=[5, 5, 5], x_limit=[-20, 40], 
size=[8, 6],hodo_color=True)

alt text

  • you can use your data from different format file by copy and paste data instead example input file.

Develop by Supaporn Noisen

top-air's People

Contributors

topaz09 avatar

Stargazers

 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.