Giter Site home page Giter Site logo

sr0wx.py's People

Contributors

wprzyb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sr0wx.py's Issues

config.py

Langitude, Longitude and Callsign should be global variables.
Currently they are duplicated at least in WWO and OSTOL modules.

worldweatheronline broadcast structure change

Now we have whole-day minimum and maximum temperature read in the 3 hour forecast section.

I suggest separating that, because i have reports like "it have no sense, how could the temperature change from 3 to 20 in 3 hour period?"

Now maxtempC and mintempC is taken from one level above the hourly forecast. If i remember correctly it wasn't always like that, and current broadcast wasn't changed so much.

I will make another broadcast on my own, on my branch and on the production, and suggest it.

generate CTCSS tones with `sox`

It may be a good idea to get rid of pygame in generating tones of any kind, mostly CTCSS.

Examples from http://montessorimuddle.org/2012/04/19/generating-and-saving-tones-with-sox/ :

To play a single note (frequency 173.5 Hz) for 5 seconds, use:

> play -n  synth 5 sin 347

To save the note to a mp3 file (called note.mp3) use:

> sox -n note.mp3 synth 5 sin 347

The SoX command to play two notes with frequencies of 347 and 357 Hz is:

> play -n synth 15 sin 347 sin 357

and to make an mp3 file use:

> sox -n beat_10.mp3 synth 15 sin 347 sin 357

Add module for burze.dzis.net

I asked for a key for burze.dzis.net SOAP api allowing to get informations about lightning strikes and weather dangers in Europe.

>>> place = client.service.miejscowosc('sofia',klucz)
>>> place
(MyComplexTypeMiejscowosc){
   y = 42.41
   x = 23.19
 }

>>> print(client.service.szukaj_burzy(place.y, place.x, 100, klucz))
(MyComplexTypeBurza){
   liczba = 5
   odleglosc = 79.07
   kierunek = "E"
   okres = 15
 }
>>> print(client.service.ostrzezenia_pogodowe(place.y, place.x, klucz))
(MyComplexTypeOstrzezenia){
   od_dnia = None
   do_dnia = None
   mroz = 0
   upal = 0
   wiatr = 0
   opad = 0
   burza = 0
   traba = 0
 }
>>> 

And i am going to write a module to use it. I had an idea to make it more interactive, and ask for the data separately and issue an storm station broadcast when the storm is coming, not when the cron says so. But for now it will be another module i want to write to look how it's like to write a module for that and get some experience to grasp other modules waiting for rewrite.

Duplicates in dictionary.py for MS TTS

When running 'python microsoft_translator_downloader.py' with default dictionary.py you get some duplicates info, like:

metrow_na_sekunde already exists
temperatura_odczuwalna already exists

How to setup the station?

I wanted to set it on pmr 6 channel and theres an probleem.. becuse im on windows so there is no setup.exe for controling the station like you can turn if off or on But it would be good when adding it

Remove unnecessary stuff from dict which `getData`s return

For now these functions return:

rv = {
    'data': 'list of sample file_names',
    "needCTCSS": False,
    "source": "worldweatheronline",
}

because sr0wx.py doesn't use {}.get() method.

Plan:

  • use .get() in sr0wx.py
  • remove unnecessary keys from getData() fucntions (even empty dict is OK)

cleanup: remove all obsolete modules

All non-working and old style modules should be removed from:

  • working copy (.py files)
  • configuration
  • docs (if any...)
  • dictionary.py file

The only two modules which should stay is worldweatheronline and activity_map.

oldnumeric is depreciated as of NumPy 1.8 and removed in 1.9

oldnumeric is no longer available in newer numpy distributions.

$ python sr0wx.py 
Traceback (most recent call last):
  File "sr0wx.py", line 63, in <module>
    import lib.cw as cw
  File "/home/sq7lrx/Devel/sr0wx.py/lib/cw.py", line 19, in <module>
    import numpy.oldnumeric as Numeric
ImportError: No module named oldnumeric

`pl_google` should be a class

  1. Shouldn't code be in __init__?
  2. pl_google should be a class
  3. in a commit which I'm going to make in a minute there will be a block in get_data():
# What a mess!
# TODO: lang.read_temperature_celsius
# TODO: lang.`read datetime function` (no idea for name and
# functionality now)
# TODO: lang.read_pressure
# TODO: read_wind_direction (see def __wind_direction() above)
# TODO: read_wind_direction_degrees
# TODO: read_speed_kmph
# TODO: and so on to clear this mess below.

HINT: first add methods to "prototype" / parent class, each of which will raise NotImplementedError.

log "`config`-side" variable name when running module

Currently when running module

2014-11-25 19:04:41,459 root INFO: starting <activity_map.ActivityMap object at 0xb4cdb1ac>...

is logged, which is OK, but doesn't answer the question where to look at if something fails where there will be more than one module (instance) of the same class.

We need some way to find config-side variable in run time. Possible solutions:

(Pdb) [v for v in dir(config) if id(eval('config.%s' % v)) == id(module)]
['activitymap']

saving id(self) on __init__() (not tested, especially in inheritance) and then comparing module.get_id() with element of modules list.

Worldweatheronline - zmiana api, zmiana struktury wynikowego JSONa.

Zmiana api worldweatheronline usuwa takie rzeczy jak dane na temat wiatru i kod pogody z podsumowania prognozowanego dnia i przenosi je do prognoz na każdą godzinę.

W mojej poprawce do modułu sr0wx pobiera te dane z pierwszego pomiaru, ale to chyba nie rozwiązanie. Pasowałoby rozstrzygnąć czy należy zmienić strukture prognozy (i podawać każdy pomiar z osobna) czy podawać rzeczywiście pierwszy (lub któryś inny pomiar)

change way playlist is played and created

Steps:

  • modules should return messages as it would be written by human
  • (possibly) TTS-specific routine should change it into list of samples it knows
  • if message contains samples which are not words (CW, beeps, etc) it should be noted in playlist (ie. as file://path/to/file

Extract translations from `pl_google`

Extract translations from pl_google and:

  • move it to separate (.json?) file,
  • add translations disvovery (how?)
  • add function translate(value) which should read data from this file(s)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.