<commit_before>#-------------------------------------------------------------------------------
# Name:        test_coord
# Purpose:
#
# Author:      <NAME>
#
# Created:     07.03.2014
# Copyright:   (c) <NAME> 2014
# Licence:     The MIT License
#-------------------------------------------------------------------------------
#!/usr/bin/env python
import math
import os

import numpy as np

import wradlib.vis as vis
import wradlib.georef as georef
import wradlib.io as io
import matplotlib.pyplot as plt

if __name__ == '__main__':

    ### Using wradlib ###

    pvol = io.read_OPERA_hdf5('data/20130429043000.rad.bewid.pvol.dbzh.scan1.hdf')
    
    # Count the number of dataset

    ntilt=1
    for i in range(100):
        try:
            pvol["dataset%d/what" %(ntilt)]
            ntilt += 1
        except:
            ntilt -= 1
            break

    nrays = int(pvol["dataset1/where"]["nrays"])
    nbins = int(pvol["dataset1/where"]["nbins"])
    rscale = int(pvol["dataset1/where"]["rscale"])
    coord = np.empty((ntilt,nrays,nbins,3))
    for t in range(ntilt):
        elangle = pvol["dataset%d/where" %(t+1)]["elangle"]
        coord[t,...] = georef.sweep_centroids(nrays,rscale,nbins,elangle)
    ascale = math.pi/nrays
    sitecoords = (pvol["where"]["lat"],pvol["where"]["lon"],pvol["where"]["height"])
    proj_radar = georef.proj4_to_osr(georef.create_projstr("aeqd",lat_0=pvol["where"]["lat"],lon_0=pvol["where"]["lon"]))
    radius = georef.get_earth_radius(pvol["where"]["lat"],proj_radar)
    lat, lon, height = georef.polar2latlonalt_n(coord[...,0], np.degrees(coord[...,1]), coord[...,2], sitecoords, re=radius, ke=4./3.)<commit_msg>MIN: better names examples coord.py<commit_after>#-------------------------------------------------------------------------------
# Name:        test_coord
# Purpose:
#
# Author:      <NAME>
#
# Created:     07.03.2014
# Copyright:   (c) <NAME> 2014
# Licence:     The MIT License
#-------------------------------------------------------------------------------
#!/usr/bin/env python
import math
import os

import numpy as np

import wradlib.vis as vis
import wradlib.georef as georef
import wradlib.io as io
import matplotlib.pyplot as plt

if __name__ == '__main__':

    ### Using wradlib ###

    pvol = io.read_OPERA_hdf5('data/20130429043000.rad.bewid.pvol.dbzh.scan1.hdf')
    
    # Count the number of dataset

    ntilt=1
    for i in range(100):
        try:
            pvol["dataset%d/what" %(ntilt)]
            ntilt += 1
        except:
            ntilt -= 1
            break

    nrays = int(pvol["dataset1/where"]["nrays"])
    nbins = int(pvol["dataset1/where"]["nbins"])
    rscale = int(pvol["dataset1/where"]["rscale"])
    coord = np.empty((ntilt,nrays,nbins,3))
    for t in range(ntilt):
        elangle = pvol["dataset%d/where" %(t+1)]["elangle"]
        coord[t,...] = georef.sweep_centroids(nrays,rscale,nbins,elangle)
    ascale = math.pi/nrays
    sitecoords = (pvol["where"]["lat"],pvol["where"]["lon"],pvol["where"]["height"])
    proj_radar = georef.proj4_to_osr(georef.create_projstr("aeqd",lat_0=pvol["where"]["lat"],lon_0=pvol["where"]["lon"]))
    radius = georef.get_earth_radius(pvol["where"]["lat"],proj_radar)
    
    lat, lon, height = georef.polar2latlonalt_n(coord[...,0], np.degrees(coord[...,1]), coord[...,2], sitecoords, re=radius, ke=4./3.)
    
{'fraction_non_alphanumeric': 0.25342058298631764, 'fraction_numerical': 0.028554431885782272, 'mean_word_length': 2.2650485436893204, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6154241', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1203, 'n_words': 207}