brightwind-dev / brightwind

Python library containing wind analysis functions
MIT License
50 stars 18 forks source link

anemometer adjust slope and offsets #12

Closed stephenholleran closed 5 years ago

stephenholleran commented 5 years ago

add capability to adjust an anemometer wind speed which requires a new slope and offset applied to that applied by the logger.

bw.apply_calibration(wndspd, current_slope, current_offset, new_slope, new_offset) returns adjusted wind speed

stephenholleran commented 5 years ago

Shouldn't be called 'apply_calibration' as applying a calibration could mean using the equation y=mx+c. This function adjusts a wind speed which already has a slope and offset applied. It is adjusting the slope and offsets that were applied. Therefore it should be called 'adjust_slope_offset'.

stephenholleran commented 5 years ago

Added tests to this now https://github.com/brightwind-dev/brightwind/tree/5fba1416a2d36242738eaaf3596e42b91a2d5d4c

@Inder95 can you check out the tests and see if they are done correctly? Thanks.

inder-preet-kakkar commented 5 years ago

The tests look good and all of them passed. You can add it to the master branch or send me a pull request. You can run the tests by opening the terminal within pycharm itself and run the command:

 pytest -svv
stephenholleran commented 5 years ago

I ran them using py.test from the command line.

Already merged with master.