Hey, Christophe,

Sounds like you have been clever enough to write some code to find and correct 
those values.  Seems like you should be able to take the same logic and adapt 
it for use as python expressions and use the weewx built-in calibration 
features.

I wrote a post a while back, which may give you some ideas:

https://groups.google.com/forum/m/#!topic/weewx-user/veofTPb5adE

The first post there shows how I used python to test the eval statements, which 
I later put right into weewx.conf.  I did find out that you can't re-use the 
same weewx variable twice, which is owing to a weewx/python implementation 
detail in how weewx stores the calibration statements.  But there is a 
workaround mentioned in the second post.

Never mind that I ended up abandoning the idea.  What I show there is a sound 
approach to using a standalone python script to get the expressions working 
correctly, and then you copy/paste the exact same expressions into weewx.conf 
calibration section.

Meanwhile, if all else fails, have you tried piping "y" in your script?

    $ echo y | whatever_comand_has_a_yn_prompt ...

There is also the "yes" command which just endlessly echo's y's forever:

    $ yes | whatever_comand_has_a_yn_prompt ...

Regards,
\Leon
--
Leon Shaner :: Dearborn, Michigan (iPad Pro)

> On May 8, 2019, at 8:54 AM, Christophe CAVALLIÉ <[email protected]> wrote:
> 
> Here is the query I execute to correct the errors:
> update weewx.archive set windGust='0' where windGust 
>  in 
> ('183.600456336138','183.960914462966','137.880685399835','91.9804572314828','91.8004563367049');
> 
> The values in question are very frequent and are systematically for a 
> winDir=315
> 
> 
> Le mercredi 8 mai 2019 13:18:24 UTC+2, Andrew Milner a écrit :
>> 
>> 30 errors per day seems to be excessive.  Do you have something causing the 
>> errors?  What kind of errors are you correcting? Recalculating the daily 
>> data from the archive data is, I would have thought, likely to create more 
>> 'errors', and possibly lose max gust data which may have been in a loop 
>> packet for example.  How do you know the recorded data is wrong, and how do 
>> you know what the correct value should be??  All seems to not make much 
>> sense on the face of it.  Maybe your best option is to create your own 
>> special version of wee_database which does not issue the prompt request so 
>> that you can run it via cron (although running wee_database via cron seems a 
>> wrong thing to have to do anyway!)  Surely though you only need to do the 
>> recalculation after editing the data - so why not just include the call to 
>> wee_database within the script you invoke when you decide to edit the data.  
>> I assume the actual edit is a manual process.  Maybe understanding what your 
>> problem is caused by would shed some light on how to correct it - at the 
>> moment I feel somewhat lost.
>> 
>> 
>> 
>>> On Wednesday, 8 May 2019 12:53:21 UTC+3, Christophe CAVALLIÉ wrote:
>>> I make the corrections myself via a mysql command executed by bash shell 
>>> script and I must therefore perform a frequent recalculation of the daily 
>>> data because I have up to 30 errors on the wind speed and wind gust data 
>>> per day.
>>> 
>>> Le mercredi 8 mai 2019 11:43:48 UTC+2, Andrew Milner a écrit :
>>>> 
>>>> what kind of errors are you correcting with the utility??  If you are 
>>>> using checkstrings/fixstrings this should not need to be run on a regular 
>>>> basis via cron since it is really finding and correcting errors introduced 
>>>> by a database editor.
>>>> 
>>>> If you have a database editor that introduces null strings rather than 
>>>> null values when deleting values then I would suggest either changing the 
>>>> editor to solve the problem completely or just getting into the habit or 
>>>> running wee_database to check for null strings after running the editor.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On Wednesday, 8 May 2019 12:10:22 UTC+3, Christophe CAVALLIÉ wrote:
>>>>> Hello,
>>>>> I use Weewx for my station WS2300 in France I have to correcting lot of 
>>>>> measure errors.
>>>>> I want to automatize this with crontab command but I can't with the 
>>>>> prompt "Proceed (y/n)".
>>>>> Have you a solution to bypass this prompt?
>>>>> Thanks for your response
>>>>> Christophe Cavallié
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/d7f93914-f767-4e91-a9e2-d12c3e57457b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/1CF4A1AB-2090-49F9-AE00-C141272578FD%40isylum.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to