## Installation

git clone https://gitlab.science.gc.ca/dlo001/radvelso.git


## Content and Usage

The following folders, scripts and files;

## 1. The folder /source_sqlite/ contains a sqlite file:

/source_sqlite/2019080106_ra (sqlite file with two VS)

### 2. The folder /source_odim/ contains two odim files:

/source_odim/CASBV_20190702_030003.qc.CASBV.h52 (sqlite file with one VS)

/source_odim/CASBV_20190702_031203.qc.CASBV.h5 (sqlite file with one VS)

### 3. The folder /superobs/ contains script for superobbing:

In this folder there are two independent codes to make the average of the observations in the generation of the super observation. The codes are designed to work in parallel with a large sqlite file of multiples VSs . But adaptation to other configurations is possible as it is modular.

##### /superobs/superobs_sqlite.py

Code performing the search with sqlite and has as stages:

• Enter the sqlite file

• fill_ray ()^* create a map with the boxes where the average will be made ( shared program with superobs_numpy.py)

• superobs () make a loop with each PPI

• average_boxes () search the observations and write the average of them in the new sqlite file with the super observation.

Pros:

• It has fewer stages and fewer lines.
• It is faster ~ 0.5 seconds per PPI

Cons:

• Perhaps its conversion into Fortran is not so evident
• Knowledge of sqlite is required
##### /superobs/superobs_numpy.py

Code performing the search in data structures generated from a sqlite file and has as stages:

• Enter the sqlite file

• fill_ray ()^* create a map with the boxes where the average will be made ( shared program with superobs_sqlite.py)

• superobs () make a loop with each PPI

• read_sqlite_vol () transforms the PPI in sqlite into a data structure

• averaged_sqlite_dvel () searches in the data structure the observations per box and calculates the mean in a data structure

• to_sqlite () writes the data structure in the new sqlit file with the super observation.

Pros:

• Maybe the conversion in Fortran is easier
• You need a basic knowledge of Sqlite only to read and write

Cons:

• It is slower ~2 seconds per PPI
• Contains more lines and stages
##### /superobs/test_superobs.py

For validation, the tests have been done ( https://gitlab.science.gc.ca/dlo001/python-script-radar/blob/master/superobs/test_superobs.py ):

###### Test superobs_test_number_obs_boxes:

Creation of a map for visualizationing of each box where the average of the observations found will be calculated, showing in each box how many observations there are. Both codes have generated the same image independently.

Same images:

###### Run Test superobs_test_number_obs_boxes:
python test_superobs.py TestMethods.superobs_test1
there are 320 rays in the averaged PPI in 5 levels
First PPI
Graphic analysis for superobservation (superobs_sqlite)
there are 320 rays in the averaged PPI in 5 levels
First PPI
Graphic analysis for superobservation (superobs_numpy)
.
----------------------------------------------------------------------
Ran 1 test in 132.572s

OK

###### Test superobs_test_avg_sqlites:

Generation of sqlite files with the average calculated for a certain configuration of fill_ray () both have generated the same sqlite file generating the same average of observations.

Same images:

###### Run Test superobs_test_avg_sqlites:
python test_superobs.py TestMethods.superobs_test2
there are 320 rays in the averaged PPI in 5 levels
First PPI
Time analysis for one PPI (superobs_sqlite)
Runtime total one PPI:  0.4667 s
there are 320 rays in the averaged PPI in 5 levels
First PPI
Time analysis for one PPI (superobs_numpy)
Runtime total one PPI:  2.6713 s
.
----------------------------------------------------------------------
Ran 1 test in 8.777s

OK

###### Test total_number_obs:

Test of the total number of observations and total sum of observations on the tiles

###### Test total_box:

Test funtion to make sure that azimuths and ranges are selected properly in the average

^* Boxes are generated without overlap, when tiles ray starts, it ends at the end of the last allowed value of the range. The boxes are defined by delta range and number of rays to setup the size of the tile.

## Project details

Uploaded source
Uploaded py3