diff --git a/README.md b/README.md index 4a9bcf2..245423f 100644 --- a/README.md +++ b/README.md @@ -2,99 +2,25 @@ Visjobs offers plotting effective variables in effective way using atmospheric models. -## Installation +## 1.Installation -- git clone https://github.com/donmezk/visjobs -- Clone in the same directory the code is written. +#### 1.1. Dependencies +- xarray +- siphon +- pandas +- numpy +- matplotlib +- cartopy +- datetime -### Some example about how to use Visjobs +#### 1.2. Pypi Installation +- pip install visjobs -- WE WILL BE PLOTTING THE 500MB GEOPOTENTIAL HEIGHT | MEAN SEA LEVEL PRESSURE FOR NORTH AMERICA -- importing dependencies. -```python +#### 1.3. Github Clone +- git clone https://github.com/donmezkutay/visjobs -from visjobs.datas import get_data -from visjobs.visualize import draw_map -import xarray as xr -import numpy as np +## 2. Usage +Usage can be found at [Visjobs Documentation Page] -``` ------------- +[Visjobs Documentation Page]: - -+ Getting the data using pick_data function. -+ Function pick_data(): - * hour=06 --> means the 06Z run of the model - * latest=True --> means the latest output with 06Z run - * model='GFS' --> means GFS data is choosen ['NAM' is also available] - * hourly=False --> means GFS 3 hourly data is asked [not valid for NAM] - -```python - -data = get_data.pick_data(hour='06',latest=True,model='GFS', - hourly=False) -``` -+ Note that data taken is xarray DataArray. - ------------- - - -+ In below using xarray DataArray, we are deciding the interval of desired latitude and longitude. -+ Returns a dictionary. -+ Function pick_area(): - * data --> Xarray data must be given - * total_process --> means until which time step the data is asked - * interval --> means until the asked time step, with what interval time step will go - * init_time --> means the initial time step of the data - * list_of_vars --> the desired variables in list [str] - * list_of_areas --> the desired areas in list [str] - * pr_height --> the desired pressure heights in list [int] - -```python - -time, area_dict = get_data.pick_area(data, total_process=2, interval=1, init_time=0, - list_of_vars=['prmslmsl','hgtprs'],pr_height=['500'], - list_of_areas=['northamerica','europe']) -``` - -+ Let's say I want to plot 500mb heights and mslp for North America. -+ In the upper part I got the relevant data using pick_area function. -+ Now assign each single data from the whole dictionary. -``` -press = np.divide(area_dict['northamerica'][0], 100) -heightprs = area_dict['northamerica'][1] -``` - -- Choosing the desired plot size. - -```python -from pylab import rcParams -rcParams['figure.figsize'] = 21, 24 -``` - -+ In below using height_pressure function we will plot 500mb Height-Pressure graphic -+ Function height_pressure(): - * time --> the loop initiated from the init_time indicated above function until the 'time' - * press --> xarray input for pressure - * heightprs --> xarray input for height - * pr_height --> the desired pressure height - * place --> the area which the user wants to plot - * save_where --> where to save the figure - * breaking --> if True, the function will stop after one loop - * title_on --> if True, the title must be introduced, default is False - * ---------------------------------------------------------------------- - * if only the title_on = True, apply inputs below - * owner_name = the box in the upper left corner of the plot - * plot_main_tite --> main title that is going to be plotted in string - * tl1, tl2, tl3, tll4, tl5 --> set the title's placement [a,b] (int list) - -```python -draw_map.height_pressure(time, press, heightprs ,pr_height='500', place='northamerica', - save_where=r'height_prs{}.png', - breaking=True, title_on=True ,owner_name='Kutay DĂ–NMEZ', - plot_main_title=r'GFS 500mb Geopotential Height(m) | Presssure(mb)', - tl5=[0.0047, 0.97100], tl1=[0,1.032]) -``` -plot result: -https://pasteboard.co/J1HhgsF.png -![]('https://pasteboard.co/J1HhgsF.png') diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..9534b01 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..af7dc2d --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,55 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'visjobs' +copyright = '2020, Kutay & Berkay Donmez' +author = 'Kutay & Berkay Donmez' + +# The full version, including alpha/beta/rc tags +release = '0.0.6' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..14d890a --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,20 @@ +.. visjobs documentation master file, created by + sphinx-quickstart on Fri Sep 4 16:57:44 2020. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to visjobs's documentation! +=================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/setup.py b/setup.py index 43c022b..d8b74d0 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="visjobs", # Replace with your own username - version="0.0.6", + version="0.0.7", author="Kutay Donmez & Berkay Donmez", author_email="donmezk@outlook.com", description="Get Latest Atmospheric Model Data | Analyse | Visualize Easily",