cmac 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cmac-0.1.0/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2017, EVS-ATMOS
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cmac-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,24 @@
1
+ Metadata-Version: 2.4
2
+ Name: cmac
3
+ Version: 0.1.0
4
+ Summary: Corrected Moments in Antenna Coordinates
5
+ Home-page: https://github.com/EVS-ATMOS/cmac2.0
6
+ Author: Scott Collis, Zachary Sherman, Robert Jackson
7
+ Maintainer: Data Informatics and Geophysical Retrievals (DIGR)
8
+ License-File: LICENSE
9
+ Provides-Extra: test
10
+ Requires-Dist: pytest; extra == "test"
11
+ Requires-Dist: pytest-mpl; extra == "test"
12
+ Requires-Dist: xarray; extra == "test"
13
+ Requires-Dist: act-atmos; extra == "test"
14
+ Dynamic: author
15
+ Dynamic: description
16
+ Dynamic: home-page
17
+ Dynamic: license-file
18
+ Dynamic: maintainer
19
+
20
+ Using fuzzy logic, scipy, and more to identify gates as rain, melting,
21
+ snow, no clutter, and second trip. Many fields such as reflectivity and
22
+ coorelation coefficient are used, but also SNR and sounding data is used.
23
+ More information can be found at https://www.arm.gov/data/data-sources/cmac-69
24
+
cmac-0.1.0/README.rst ADDED
@@ -0,0 +1,127 @@
1
+ CMAC
2
+ ====
3
+
4
+ CMAC: Corrected Precipitation Radar Moments in Antenna Coordinates
5
+
6
+ CMAC (Corrected Moments in Antenna Coordinates) is a set of
7
+ algorithms and code that does corrections to Radar data, but also adds fields
8
+ to the original data. Using fuzzy logic CMAC also calculates gate IDs such as
9
+ rain, snow and second-trip. Some other examples of the corrections done are
10
+ velocity dealiasing and attenuation-corrected reflectivity. Example of fields
11
+ added are rain_rate_A, velocity_texture and filtered_corrected_differential_phase.
12
+
13
+ More information can be found at https://www.arm.gov/capabilities/vaps/xsapr-cmac-142
14
+
15
+ Interactive notebooks on the cloud
16
+ ----------------------------------
17
+ .. image:: https://binder.pangeo.io/badge_logo.svg
18
+ :target: https://binder.pangeo.io/v2/gh/EVS-ATMOS/cmac2.0/master
19
+
20
+
21
+ The `Atmospheric Community Toolkit <https://arm-doe.github.io/ACT>`_ is installed in this binder
22
+ and can be used to download data for CMAC from ARM Data Discovery. For an example on how
23
+ to download ARM datastreams from Data Discovery, click `here <https://arm-doe.github.io/ACT/API/generated/act.discovery.download_data.html#act.discovery.download_data>`_.
24
+
25
+
26
+ All ARM files are in the format that is needed by CMAC for processing.
27
+
28
+ Install
29
+ -------
30
+
31
+ CMAC and the required environment can be installed by using the
32
+ instructions below::
33
+
34
+ git clone https://github.com/ARM-Development/cmac.git
35
+ cd cmac
36
+ conda env create -f environment.yml
37
+ conda activate cmac_env
38
+
39
+ If you wish to use the LP phase processing code instead of the CSU code, you will
40
+ need to set an environment variable to point to the location of the COIN-OR
41
+ libraries. This can be done by using the following command in the terminal::
42
+
43
+ export COIN_INSTALL_DIR=/Users/yourusername/youranacondadir/envs/cmac_env
44
+
45
+ If you are using the Bringi KDP retrieval, method then this is not needed.
46
+ The Bringi method is the default method for KDP retrieval in CMAC. If you want to use the LP method, then you will need to set the environment variable as described above and then set the kdp_method argument in the config file to 'lp'.
47
+
48
+ You will need to install Anaconda Compilers for the installation of CyLP.
49
+ These compilers can be found here and differ between OS:
50
+ https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html
51
+
52
+ After the compilers are installed, you should be able to install CyLP with::
53
+
54
+ pip install git+https://github.com/coin-or/CyLP.git
55
+
56
+ Scripts such as cmac_animation and cmac_dask require additional dependencies::
57
+
58
+ source activate cmac_env
59
+ conda install -c menpo ffmpeg=version
60
+ conda install dask ipyparallel
61
+
62
+ Note: For ffmpeg, depending on the user's operating system, the version will
63
+ need to be replaced with corresponding version number found here:
64
+
65
+ https://anaconda.org/menpo/ffmpeg
66
+
67
+ Using CMAC
68
+ ----------
69
+
70
+ Once downloaded, CMAC can be used in the terminal. The required positional
71
+ arguments are ``radar_file``, ``sonde_file`` and ``radar_config`` (the name
72
+ of a radar configuration, e.g. ``bnf_csapr2_ppi``, that exists in
73
+ ``cmac.default_config`` or in a YAML file passed via ``--config-file``).
74
+
75
+ An example::
76
+
77
+ cmac /home/user/cmac2.0/data/radar_file.nc \
78
+ /home/user/cmac2.0/data/sonde_file.cdf \
79
+ bnf_csapr2_ppi
80
+
81
+ The script also accepts the following optional arguments:
82
+
83
+ ``-c``, ``--config-file`` ``PATH``
84
+ Optional YAML config file whose values override the built-in defaults
85
+ for the given ``radar_config``.
86
+
87
+ ``-cf``, ``--clutter-file`` ``PATH``
88
+ Clutter file to use for addition of the clutter gate id.
89
+
90
+ ``-o``, ``--out-radar-directory`` ``PATH``
91
+ Output directory for the CMAC radar file. Defaults to the user home
92
+ directory.
93
+
94
+ ``-id``, ``--image-directory`` ``PATH``
95
+ Directory to save CMAC radar quicklook images. Defaults to the user
96
+ home directory.
97
+
98
+ ``-ma``, ``--meta-append`` ``SOURCE``
99
+ Source of metadata for the output file. ``config`` (default) uses the
100
+ per-radar metadata from ``cmac.default_config`` / the YAML override.
101
+ Pass a path to a JSON file to use custom metadata, or ``default`` to
102
+ use the generic global defaults.
103
+
104
+ ``--verbose`` / ``--no-verbose``
105
+ Display debugging output. Defaults to off.
106
+
107
+ For backwards compatibility, the underscore forms of each long option
108
+ (e.g. ``--config_file``, ``--clutter_file``, ``--out_radar_directory``,
109
+ ``--image_directory``, ``--meta_append``) are also accepted.
110
+
111
+ There is currently a ``default_config.py`` file with dictionaries for
112
+ radars. Additional radars can be added there, or supplied through a YAML
113
+ file passed via ``--config-file`` and selected with the ``radar_config``
114
+ positional argument.
115
+
116
+ Lead Developers
117
+ ---------------
118
+
119
+ - Scott Collis
120
+ - Robert Jackson
121
+ - Zach Sherman
122
+ - Max Grover
123
+
124
+ Credits
125
+ -------
126
+ The Bringi KDP retrieval method is taken from CSU-RadarTools, which is a collection of radar processing tools developed by Colorado State University.
127
+ The CSU-RadarTools can be found at https://github.com/CSU-Radarmet/CSU_RadarTools.
@@ -0,0 +1,33 @@
1
+ """
2
+ ====
3
+ CMAC
4
+ ====
5
+
6
+ CMAC functions for determining gate ids, detect second trip returns and
7
+ more.
8
+
9
+ cmac
10
+ quicklooks
11
+ snr_and_sounding
12
+ get_texture
13
+ cum_score_fuzzy_logic
14
+ do_my_fuzz
15
+ return_csu_kdp
16
+ retrieve_qvp
17
+ tall_clutter
18
+
19
+ """
20
+
21
+ from .cmac_radar import cmac, area_coverage
22
+ from .cmac_ppi_quicklooks import quicklooks_ppi
23
+ from .cmac_rhi_quicklooks import quicklooks_rhi
24
+ from .cmac_processing import snr_and_sounding, do_my_fuzz
25
+ from .cmac_processing import get_texture, cum_score_fuzzy_logic
26
+ from .cmac_processing import return_csu_kdp, retrieve_qvp, beam_block
27
+ from .config import get_cmac_values, get_field_names
28
+ from .config import get_metadata, get_plot_values
29
+ from .config import get_zs_relationships, get_default_metadata
30
+ from .data_catalouging import get_sounding_times, get_sounding_file_name
31
+ from .radar_clutter import tall_clutter
32
+
33
+ __all__ = [s for s in dir() if not s.startswith('_')]