Skip to content

Commit

Permalink
changes for version 0.1.1
Browse files Browse the repository at this point in the history
Added Release Notes to docs.
Changes according release note for v0.1.1
Added without GIS section to raw data tutorial
  • Loading branch information
jkreklow committed Jun 19, 2018
1 parent 5a26993 commit c65f660
Show file tree
Hide file tree
Showing 93 changed files with 369 additions and 202 deletions.
4 changes: 1 addition & 3 deletions build/lib/radproc/arcgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@

try:
import arcpy

except ImportError:
print("Import Error! Module arcpy not found")
pass


class LicenseError(Exception):
Expand Down Expand Up @@ -154,7 +152,7 @@ def create_idraster_germany(projectionFile, outRaster, extendedNationalGrid = Tr
idArr = np.arange(0,1100*900).reshape(1100,900)


idRaster = arcpy.NumPyArrayToRaster (idArr, arcpy.Point(x, y), 1, 1, -9999)
idRaster = arcpy.NumPyArrayToRaster (idArr, arcpy.Point(x, y), 1000, 1000, -9999)

if projectionFile.endswith(".prj"):
spatialRef = projectionFile
Expand Down
8 changes: 4 additions & 4 deletions build/lib/radproc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

def coordinates_degree_to_stereographic(Lambda_degree, Phi_degree):
"""
Converts geographic coordinates [°] to cartesian coordinates [km] in stereographic RADOLAN projection.
Converts geographic coordinates [°] to cartesian coordinates [m] in stereographic RADOLAN projection.
:Parameters:
------------
Expand All @@ -56,13 +56,13 @@ def coordinates_degree_to_stereographic(Lambda_degree, Phi_degree):
---------
(x, y) : Tuple with two elements of type float
Cartesian coordinates x and y in stereographic projection [km]
Cartesian coordinates x and y in stereographic projection [m]
"""

from math import sin, cos, pi
# Earth Radius in km
R = 6370.04
# Earth Radius in m
R = 6370.04 * 1000

# Convert decimal degrees to radian
Phi = Phi_degree * pi/180
Expand Down
41 changes: 19 additions & 22 deletions build/lib/radproc/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
.. autosummary::
:nosignatures:
:toctree: generated/
unzip_RW_binaries
unzip_YW_binaries
radolan_binaries_to_dataframe
radolan_binaries_to_hdf5
create_idraster_and_process_radolan_data
process_radolan_data
.. module:: radproc.raw
:platform: Windows
:synopsis: Python package radproc (Radar data processing), Module raw
Expand Down Expand Up @@ -62,14 +62,17 @@ def unzip_RW_binaries(zipFolder, outFolder):
Path of directory containing RW data as monthly tar / tar.gz archives to be unzipped.
Archive names must contain year and month at end of basename: RWrea_200101.tar or RWrea_200101.tar.gz
outFolder : string
Path of output directory.
Path of output directory. Will be created if it doesn't exist, yet.
:Returns:
---------
No return value
"""

if not os.path.exists(outFolder):
os.mkdir(outFolder)

# create list of all tar files and identify years
tarFileList = os.listdir(zipFolder)
years = np.unique([f[-10:-6] if f.endswith(".tar") else f[-13:-9] for f in tarFileList])
Expand Down Expand Up @@ -122,19 +125,17 @@ def unzip_YW_binaries(zipFolder, outFolder):
Path of directory containing YW data as monthly tar / tar.gz archives to be unzipped.
Archive names must contain year and month at end of basename: YWrea_200101.tar or YWrea_200101.tar.gz
outFolder : string
Path of output directory.
Path of output directory. Will be created if it doesn't exist, yet.
:Returns:
---------
No return value
"""

#zipFolder = r"P:\JENNY\FORSCHUNG\Daten\RADOLAN\Reanalyse2\RW_rea_Original"
#outFolder = r"P:\JENNY\FORSCHUNG\Daten\RADOLAN\Reanalyse2\RW_Rea_gz"
#firstYear = 2001
#lastYear = 2015
"""

if not os.path.exists(outFolder):
os.mkdir(outFolder)

# create list of all tar files
tarFileList = os.listdir(zipFolder)
years = np.unique([f[-10:-6] if f.endswith(".tar") else f[-13:-9] for f in tarFileList])
Expand Down Expand Up @@ -180,7 +181,7 @@ def radolan_binaries_to_dataframe(inFolder, idArr=None):
"""
Import all RADOLAN binary files in a directory into a pandas DataFrame,
optionally clipping the data to the extent of an investigation area specified by an ID array.
:Parameters:
------------
inFolder : string
Expand Down Expand Up @@ -294,7 +295,7 @@ def radolan_binaries_to_hdf5(inFolder, HDFFile, idArr=None, complevel=9):
"""
Wrapper for radolan_binaries_to_dataframe() to import and **clip all RADOLAN binary files of one month in a directory** into a pandas DataFrame
and save the resulting DataFrame as a dataset to an HDF5 file. The name for the HDF5 dataset is derived from the names of the input folder (year and month).
:Parameters:
------------
Expand Down Expand Up @@ -395,7 +396,7 @@ def _process_year(yearFolder, HDFFile, idArr, complevel):
for monthFolder in monthFolders:
try:
radolan_binaries_to_hdf5(inFolder=monthFolder, HDFFile=HDFFile, idArr=idArr, complevel=complevel)
print(monthFolder + " imported, clipped and saved")
print(monthFolder + " processed")
except:
print("Error at " + monthFolder)
failed.append(monthFolder)
Expand Down Expand Up @@ -431,7 +432,6 @@ def create_idraster_and_process_radolan_data(inFolder, HDFFile, clipFeature=None
If necessary, a textfile containing all directories which could not be processed due to data format errors is created in directory of HDF5 file.
:Parameters:
------------
Expand All @@ -450,7 +450,6 @@ def create_idraster_and_process_radolan_data(inFolder, HDFFile, clipFeature=None
complevel may range from 0 to 9, where 9 is the highest compression possible.
Using a high compression level reduces data size significantly,
but writing data to HDF5 takes more time and data import from HDF5 is slighly slower.
:Returns:
---------
Expand All @@ -460,9 +459,6 @@ def create_idraster_and_process_radolan_data(inFolder, HDFFile, clipFeature=None
Additionally, two ID Rasters and - if necessary - a textfile containing
all directories which could not be processed due to data format errors are created in directory of HDF5 file.
:Note:
------
.. seealso:: See :ref:`ref-filesystem` for further details on data processing.
If you already have an ID Array available, use :func:`radproc.raw.process_radolan_data` instead.
Expand Down Expand Up @@ -548,7 +544,7 @@ def process_radolan_data(inFolder, HDFFile, idArr=None, complevel=9):
Additionally, a textfile containing all directories which could not be processed due to data format errors is created in directory of HDF5 file.
:Parameters:
------------
Expand All @@ -574,12 +570,13 @@ def process_radolan_data(inFolder, HDFFile, idArr=None, complevel=9):
No return value
Function creates datasets for every month in HDF5 file specified in parameter HDFFile.
Additionally, a textfile containing all directories which could not be processed due to data format errors is created in HDFFolder.
:Notes:
-------
See :ref:`ref-filesystem` for further details on data processing.
This function can be used to process RADOLAN data without having ArcGIS installed.
"""
# Ignore NaturalNameWarnings --> Group/Dataset names begin with number,
# doesn't affect generation and access
Expand Down
2 changes: 1 addition & 1 deletion build/lib/radproc/sampledata/radolan_proj.prj
Original file line number Diff line number Diff line change
@@ -1 +1 @@
PROJCS["North_Pole_Stereographic",GEOGCS["GCS_WGS_1984_DWD",DATUM["<custom>",SPHEROID["<custom>",6370040.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Stereographic_North_Pole"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",10.0],PARAMETER["Standard_Parallel_1",60.0],UNIT["Kilometer",1000.0]]
PROJCS["Stereographic_North_Pole",GEOGCS["GCS_unnamed ellipse",DATUM["D_unknown",SPHEROID["Unknown",6370040,0]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Stereographic_North_Pole"],PARAMETER["standard_parallel_1",60],PARAMETER["central_meridian",10],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]]
2 changes: 1 addition & 1 deletion build/lib/radproc/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# THIS FILE IS GENERATED FROM RADPROC SETUP.PY
version = '0.1.0'
version = '0.1.1'
Binary file added dist/radproc-0.1.1-py2-none-any.whl
Binary file not shown.
Binary file added dist/radproc-0.1.1.tar.gz
Binary file not shown.
Binary file modified docs/_build/.doctrees/core.doctree
Binary file not shown.
Binary file modified docs/_build/.doctrees/dwd_gauge.doctree
Binary file not shown.
Binary file modified docs/_build/.doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_build/.doctrees/index.doctree
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/_build/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Analysis

gettingstarted
notebooks
reference
reference
releasenotes

Indices and tables
==================
Expand Down
5 changes: 3 additions & 2 deletions docs/_build/arcgis.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


<div class="version">
0.1.0
0.1.1
</div>


Expand Down Expand Up @@ -111,6 +111,7 @@
<li class="toctree-l2"><a class="reference internal" href="dwd_gauge.html">DWD MR90 Gauge Data Processing</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="releasenotes.html">Release Notes</a></li>
</ul>


Expand Down Expand Up @@ -310,7 +311,7 @@ <h1>ArcGIS-based Functions<a class="headerlink" href="#arcgis-based-functions" t
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.1.0',
VERSION:'0.1.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
Expand Down
7 changes: 4 additions & 3 deletions docs/_build/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


<div class="version">
0.1.0
0.1.1
</div>


Expand Down Expand Up @@ -108,6 +108,7 @@
<li class="toctree-l2"><a class="reference internal" href="dwd_gauge.html">DWD MR90 Gauge Data Processing</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="releasenotes.html">Release Notes</a></li>
</ul>


Expand Down Expand Up @@ -204,7 +205,7 @@ <h1>Core Functions and Data I/O<a class="headerlink" href="#core-functions-and-d
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="generated/radproc.core.coordinates_degree_to_stereographic.html#radproc.core.coordinates_degree_to_stereographic" title="radproc.core.coordinates_degree_to_stereographic"><code class="xref py py-obj docutils literal"><span class="pre">coordinates_degree_to_stereographic</span></code></a></td>
<td>Converts geographic coordinates [°] to cartesian coordinates [km] in stereographic RADOLAN projection.</td>
<td>Converts geographic coordinates [°] to cartesian coordinates [m] in stereographic RADOLAN projection.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/radproc.core.save_idarray_to_txt.html#radproc.core.save_idarray_to_txt" title="radproc.core.save_idarray_to_txt"><code class="xref py py-obj docutils literal"><span class="pre">save_idarray_to_txt</span></code></a></td>
<td>Write cell ID values to text file.</td>
Expand Down Expand Up @@ -282,7 +283,7 @@ <h1>Core Functions and Data I/O<a class="headerlink" href="#core-functions-and-d
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.1.0',
VERSION:'0.1.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
Expand Down
5 changes: 3 additions & 2 deletions docs/_build/dwd_gauge.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


<div class="version">
0.1.0
0.1.1
</div>


Expand Down Expand Up @@ -100,6 +100,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="releasenotes.html">Release Notes</a></li>
</ul>


Expand Down Expand Up @@ -250,7 +251,7 @@ <h1>DWD MR90 Gauge Data Processing<a class="headerlink" href="#dwd-mr90-gauge-da
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.1.0',
VERSION:'0.1.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


<div class="version">
0.1.0
0.1.1
</div>


Expand Down Expand Up @@ -111,6 +111,7 @@
<li class="toctree-l2"><a class="reference internal" href="../dwd_gauge.html">DWD MR90 Gauge Data Processing</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../releasenotes.html">Release Notes</a></li>
</ul>


Expand Down Expand Up @@ -278,7 +279,7 @@ <h1>radproc.arcgis.attribute_table_to_df<a class="headerlink" href="#radproc-arc
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'0.1.0',
VERSION:'0.1.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
Expand Down
5 changes: 3 additions & 2 deletions docs/_build/generated/radproc.arcgis.clip_idraster.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


<div class="version">
0.1.0
0.1.1
</div>


Expand Down Expand Up @@ -111,6 +111,7 @@
<li class="toctree-l2"><a class="reference internal" href="../dwd_gauge.html">DWD MR90 Gauge Data Processing</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../releasenotes.html">Release Notes</a></li>
</ul>


Expand Down Expand Up @@ -300,7 +301,7 @@ <h1>radproc.arcgis.clip_idraster<a class="headerlink" href="#radproc-arcgis-clip
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'0.1.0',
VERSION:'0.1.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
Expand Down
5 changes: 3 additions & 2 deletions docs/_build/generated/radproc.arcgis.create_idarray.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


<div class="version">
0.1.0
0.1.1
</div>


Expand Down Expand Up @@ -111,6 +111,7 @@
<li class="toctree-l2"><a class="reference internal" href="../dwd_gauge.html">DWD MR90 Gauge Data Processing</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../releasenotes.html">Release Notes</a></li>
</ul>


Expand Down Expand Up @@ -309,7 +310,7 @@ <h1>radproc.arcgis.create_idarray<a class="headerlink" href="#radproc-arcgis-cre
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'0.1.0',
VERSION:'0.1.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


<div class="version">
0.1.0
0.1.1
</div>


Expand Down Expand Up @@ -111,6 +111,7 @@
<li class="toctree-l2"><a class="reference internal" href="../dwd_gauge.html">DWD MR90 Gauge Data Processing</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../releasenotes.html">Release Notes</a></li>
</ul>


Expand Down Expand Up @@ -297,7 +298,7 @@ <h1>radproc.arcgis.create_idraster_germany<a class="headerlink" href="#radproc-a
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'0.1.0',
VERSION:'0.1.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
Expand Down
Loading

0 comments on commit c65f660

Please sign in to comment.