Fetching UK Met Office weather data

447 views
Skip to first unread message

Robin Cole

unread,
Feb 27, 2017, 8:05:26 AM2/27/17
to QATrack+
Hi all, below is a short script I wrote to fetch UK weather data, here the pressure at Gatwick Airport (nr. Charlwood). Makes use of a nice python package called MetOffer  (https://pypi.python.org/pypi/MetOffer) that provides a wrapper to the met office API (http://www.metoffice.gov.uk/datapoint). Note you will have to sign up to the Met Office DataPoint and insert your own API key. 
Next stage is to import MetOffer into the QAtrack environment, not tried this yet but you can understand the usage. 
Cheers
Robin



And the met office page


Robin Cole

unread,
Feb 27, 2017, 9:23:26 AM2/27/17
to QATrack+
I note that our barometers (https://www.gemeasurement.com/test-calibration/indicators/pace1000-precision-pressure-indicator) have an ethernet port, meaning that the barometer QA (comparing to Gatwick) could be performed automatically. Anybody using their barometers over the network? Presumably they can publish the readings as a webserver..
Cheers 

Randle Taylor

unread,
Feb 27, 2017, 9:34:27 AM2/27/17
to Robin Cole, QATrack+
Nice work!  You should just be able to 'pip install metoffer' in the QATrack+ virtualenv on your server and then import metoffer inside a composite test.

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+unsubscribe@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Akos Gulyban

unread,
Mar 1, 2017, 4:52:28 PM3/1/17
to QATrack+, robma...@gmail.com
Pay attention to grab proper air pressure information (especially airport reported / sources, not to repeat the famous error):
Correction for atmospheric pressure (Bend, OR) 
- Institution had no in Institution had no in-house barometer house barometer
- Physicist used airport or transported aneroid barometer 
- Airport reported pressure corrected to sea level (elevation was actually ~3,500 ft.)
- Aneroid barometer made one complete revolution (4 ”) and appeared to indicate sea level pressure 
- Patients received 13% overdose


On Monday, February 27, 2017 at 3:34:27 PM UTC+1, Randle Taylor wrote:
Nice work!  You should just be able to 'pip install metoffer' in the QATrack+ virtualenv on your server and then import metoffer inside a composite test.
On 27 February 2017 at 08:05, Robin Cole <robma...@gmail.com> wrote:
Hi all, below is a short script I wrote to fetch UK weather data, here the pressure at Gatwick Airport (nr. Charlwood). Makes use of a nice python package called MetOffer  (https://pypi.python.org/pypi/MetOffer) that provides a wrapper to the met office API (http://www.metoffice.gov.uk/datapoint). Note you will have to sign up to the Met Office DataPoint and insert your own API key. 
Next stage is to import MetOffer into the QAtrack environment, not tried this yet but you can understand the usage. 
Cheers
Robin



And the met office page


--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.

Robin Cole

unread,
Mar 2, 2017, 4:17:41 AM3/2/17
to QATrack+, robma...@gmail.com
Thanks Akos, that is important information. In our case, we correct for difference in height between our center and mean sea level, and actually use our own barometer readings for calibrations, with the met office data just for QA of our barometer. The documentation of the met office API is at http://www.metoffice.gov.uk/binaries/content/assets/mohippo/pdf/3/0/datapoint_api_reference.pdf 

Robin Cole

unread,
Mar 21, 2017, 5:06:09 AM3/21/17
to qat...@googlegroups.com, robma...@gmail.com
Hi Randle, doing my development in the 'portable' QAtrack, is it possible to 'pip install package' in this version of QAtrack?
Cheers

EDIT: I think the answer is easy_install :-) However the portable version is python 2.7, but I need 3.5 for pylinac

Randle Taylor

unread,
Mar 24, 2017, 10:10:06 AM3/24/17
to Robin Cole, QATrack+
Hi Robin,

Portable Python includes easy_install with it (similar to pip) so I think you should be able to do:

Portable Python 2.7.3.1/App/Scripts/easy_install.exe <package-name> and have it installed in the portable python library.

Hope that helps!
Randy



On 21 March 2017 at 05:06, Robin Cole <robma...@gmail.com> wrote:
Hi Randle, doing my development in the 'portable' QAtrack, is it possible to 'pip install package' in this version of QAtrack?
Cheers

--

Robin Cole

unread,
Apr 11, 2017, 8:53:26 AM4/11/17
to QATrack+, robma...@gmail.com
Hi Randle, attempting to easy_install pylinac intot he standalone, getting an error.. Any tips? Cheers

Portable Python 2.7.3.1\App\Scripts>easy_install.exe pylinac


Fatal error in launcher: Unable to create process using '"'



Randle Taylor

unread,
Apr 11, 2017, 9:03:43 AM4/11/17
to Robin Cole, QATrack+
Hmmm.  No idea on that one off​ the top of my head.  You might try 'easy_install.exe pip' and then 'pip install pylinac' .  I can't remember whether pylinac is pip installable on Windows on it's own or if you need compilers and other dependencies though.

RT 

Robin Cole

unread,
Apr 11, 2017, 9:14:53 AM4/11/17
to QATrack+, robma...@gmail.com
Hi Randel, reading this topic http://stackoverflow.com/questions/24627525/fatal-error-in-launcher-unable-to-create-process-using-c-program-files-x86 I believe the issue could be due to the white spaces in the path....? 

BTW pylinac installs fine in my main work environment on my PC with pip


Randle Taylor

unread,
Apr 11, 2017, 9:28:13 AM4/11/17
to Robin Cole, QATrack+
Yes that looks like it might be it although it sounds like it's been fixed in pip.   I just realized this is a moot point though.  Pylinac is Python 3 only.  I've already ported QATrack+ to Python 3 for the next version and have used Pylinac with it but for now you're out of luck on that front.

If there's other packages you have this problem with, a workaround might be to download the .whl package directly from PyPi and then 'pip install /path/to/downloaded/package.whl'

RT

On 11 April 2017 at 09:14, Robin Cole <robma...@gmail.com> wrote:
Hi Randel, reading this topic http://stackoverflow.com/questions/24627525/fatal-error-in-launcher-unable-to-create-process-using-c-program-files-x86 I believe the issue could be due to the white spaces in the path....? 

BTW pylinac installs fine in my main work environment on my PC with pip


Robin Cole

unread,
Apr 11, 2017, 9:32:02 AM4/11/17
to QATrack+, robma...@gmail.com
Aha, gotcha.. I am only doing a 'proof of principle' with pylinac, perhaps if there is a pre-production version available I would be happy to test out the integration with pylinac? If not, I will find another project for the time-being :-)

Randle Taylor

unread,
Apr 11, 2017, 9:40:19 AM4/11/17
to Robin Cole, QATrack+
Most or all of the work for Python 3 is available in the py34 branch if you want to play with it.  I will say James Kerns (author of Pylinac) and I have been collaborating together on some stuff related to this ;)

On 11 April 2017 at 09:32, Robin Cole <robma...@gmail.com> wrote:
Aha, gotcha.. I am only doing a 'proof of principle' with pylinac, perhaps if there is a pre-production version available I would be happy to test out the integration with pylinac? If not, I will find another project for the time-being :-)

--

Simon Biggs

unread,
Apr 12, 2017, 12:44:48 AM4/12/17
to QATrack+, robma...@gmail.com
Hi Randle,

That is very cool to hear that you and James are collaborating on something related to this :). I would be keen on throwing my hat in the ring and helping out with some leg work if you would like?

On Tuesday, 11 April 2017 23:40:19 UTC+10, Randle Taylor wrote:
Most or all of the work for Python 3 is available in the py34 branch if you want to play with it.  I will say James Kerns (author of Pylinac) and I have been collaborating together on some stuff related to this ;)
On 11 April 2017 at 09:32, Robin Cole <robma...@gmail.com> wrote:
Aha, gotcha.. I am only doing a 'proof of principle' with pylinac, perhaps if there is a pre-production version available I would be happy to test out the integration with pylinac? If not, I will find another project for the time-being :-)

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.

Robin Cole

unread,
Apr 24, 2017, 11:57:01 AM4/24/17
to QATrack+, robma...@gmail.com
Hi Randle, trying to install the py34 branch following https://bitbucket.org/tohccmedphys/qatrackplus/wiki/v/0.2.9/deployment/windows/wapp.md but getting stuck at step 4: python manage.py syncdb Looks like incorrect use of manage.py in py34?

Randle Taylor

unread,
Apr 24, 2017, 11:59:57 AM4/24/17
to Robin Cole, QATrack+
There's no syncdb in the version of Django that the py34 branch is using.  The 'migrate' command now handles both database creation/migrations, so you just need to do `manage.py migrate` for that branch. 

RT

On 24 April 2017 at 11:57, Robin Cole <robma...@gmail.com> wrote:
Hi Randle, trying to install the py34 branch following https://bitbucket.org/tohccmedphys/qatrackplus/wiki/v/0.2.9/deployment/windows/wapp.md but getting stuck at step 4: python manage.py syncdb Looks like incorrect use of manage.py in py34?

--

Simon Biggs

unread,
Apr 24, 2017, 6:33:04 PM4/24/17
to Randle Taylor, Robin Cole, QATrack+

Hi Robin,

Give me a couple of days, I'm going to make a new install method for the py34 branch. It will be a standardised method that works on all OSes using Docker.


On Tue., 25 Apr. 2017, 1:59 am Randle Taylor, <randle...@gmail.com> wrote:
There's no syncdb in the version of Django that the py34 branch is using.  The 'migrate' command now handles both database creation/migrations, so you just need to do `manage.py migrate` for that branch. 

RT

On 24 April 2017 at 11:57, Robin Cole <robma...@gmail.com> wrote:
Hi Randle, trying to install the py34 branch following https://bitbucket.org/tohccmedphys/qatrackplus/wiki/v/0.2.9/deployment/windows/wapp.md but getting stuck at step 4: python manage.py syncdb Looks like incorrect use of manage.py in py34?

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.

To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.

To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Cole

unread,
Apr 25, 2017, 4:22:56 AM4/25/17
to QATrack+, randle...@gmail.com, robma...@gmail.com, ma...@simonbiggs.net
Thanks Simon, I look forward to it!

Simon Biggs

unread,
Apr 25, 2017, 8:11:56 AM4/25/17
to Robin Cole, QATrack+, randle...@gmail.com
On Tue., 25 Apr. 2017, 6:22 pm Robin Cole, <robma...@gmail.com> wrote:
Thanks Simon, I look forward to it!

--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Cole

unread,
Apr 26, 2017, 4:14:21 AM4/26/17
to QATrack+, robma...@gmail.com, randle...@gmail.com, ma...@simonbiggs.net
Thanks Simon, looks ready to rock?

Simon Biggs

unread,
Apr 26, 2017, 4:16:21 AM4/26/17
to Robin Cole, QATrack+, randle...@gmail.com

Very close. I'll need to move those scripts into the docker image so that the whole thing runs on windows in a more automated fashion. If you can just type what's in those scripts into a command prompt it should work :)


On Wed., 26 Apr. 2017, 6:14 pm Robin Cole, <robma...@gmail.com> wrote:
Thanks Simon, looks ready to rock?

--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Cole

unread,
Apr 26, 2017, 4:28:22 AM4/26/17
to qat...@googlegroups.com, robma...@gmail.com, randle...@gmail.com, ma...@simonbiggs.net
Have followed the instructions in the readme, don't appear to have dockerised.. Guess its not merged into https://bitbucket.org/tohccmedphys/qatrackplus 
Happy to wait for the full windows instructions :-)




Simon Biggs

unread,
Apr 26, 2017, 7:01:42 AM4/26/17
to Robin Cole, QATrack+, randle...@gmail.com
Yeah, the pull request hasn't actually been accepted yet. So it's not in the repo yet. 

My fork should work though:

On Wed., 26 Apr. 2017, 6:28 pm Robin Cole, <robma...@gmail.com> wrote:
Have followed the instructions in the readme, don't appear to have dockerised 




--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Cole

unread,
Apr 26, 2017, 7:22:34 AM4/26/17
to QATrack+, robma...@gmail.com, randle...@gmail.com, ma...@simonbiggs.net
Alas, legacy docker also requires 64 bit unfortunately 

Randle Taylor

unread,
Apr 26, 2017, 9:29:09 AM4/26/17
to Robin Cole, QATrack+, Simon Biggs
Sounds like it maybe won't work for you regardless, but it is merged into the py34 branch now.
Message has been deleted

Simon Biggs

unread,
Apr 27, 2017, 8:40:55 AM4/27/17
to Robin Cole, QATrack+

Interesting. I can see it on the online repo:
https://bitbucket.org/tohccmedphys/qatrackplus/src/bef2e7c6c3b4a1205332db8509eb82b34983e8f0/deploy/dockerised/?at=py34

Can you repeat the issue by going through the following steps within a new directory:

git clone https://bitbucket.org/tohccmedphys/qatrackplus.git
cd qatrackplus
git checkout py34
cd deploy/dockerised


On Thu., 27 Apr. 2017, 9:24 pm Robin Cole, <robma...@gmail.com> wrote:

Just downloaded the 34 branch but no sign of docker in deploy..?


--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Cole

unread,
Apr 27, 2017, 8:51:01 AM4/27/17
to qat...@googlegroups.com, robma...@gmail.com, ma...@simonbiggs.net
Thanks Simon, I had downloaded master by accident. Now have it installed and run start-server.sh but nothing at localhost - is it not on a particular port?

I then ran ./update-server-files.sh and again ./start-server.sh and now see 


Simon Biggs

unread,
Apr 27, 2017, 8:57:10 AM4/27/17
to Robin Cole, QATrack+

From the docker directory in it's current set up (I'll automate this soon) you need to run the following in a console:

docker-compose build
docker-compose up -d
(Wait about a second here)
docker-compose run web bash -c 'python manage.py migrate && echo "from django.contrib.auth.models import User; User.objects.create_superuser(\"admin\", \"mye...@example.com\", \"admin\")" | python manage.py shell && python manage.py loaddata fixtures/defaults/*/* && python manage.py collectstatic --noinput'

Once you have run those three lines then go to localhost in your browser. Default user is admin with password admin. Password can be changed via qatrack interface.


On Thu., 27 Apr. 2017, 10:51 pm Robin Cole, <robma...@gmail.com> wrote:
Thanks Simon, I had downloaded master by accident. Now have it installed and run start-server.sh but nothing at localhost - is it not on a particular port?

--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Cole

unread,
Apr 27, 2017, 9:10:12 AM4/27/17
to QATrack+, robma...@gmail.com, ma...@simonbiggs.net
Happy to say that it's working now :-)

Simon Biggs

unread,
Apr 27, 2017, 4:01:12 PM4/27/17
to Robin Cole, QATrack+

Woohoo :)


On Thu., 27 Apr. 2017, 11:10 pm Robin Cole, <robma...@gmail.com> wrote:
Happy to say that it's working now :-)

--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Biggs

unread,
Apr 27, 2017, 4:13:30 PM4/27/17
to Robin Cole, QATrack+

Please be warned the docker install still needs a bit of work. One thing I know doesn't work yet is if you upload files to a test they won't be there anymore when you reboot your computer. It's an easy fix, I just need to make that directory a persistent docker volume. But it hasn't been done yet. I'm sure there will be other things too. If you find anything docker related, let me know and I can fix it up :)

Robin Cole

unread,
Apr 28, 2017, 6:48:44 AM4/28/17
to QATrack+, robma...@gmail.com, ma...@simonbiggs.net
Thanks Simon. How would I import extra python packages in docker? I want to analyse images so probably need the PIL library..?
Cheers

Randle Taylor

unread,
Apr 28, 2017, 10:43:18 AM4/28/17
to Robin Cole, QATrack+, Simon Biggs
Don't know enough about Docker yet to say how easy it is, but certainly it would be a good feature to make it easy for people to add whatever package they want to the python environment.

On 28 April 2017 at 06:48, Robin Cole <robma...@gmail.com> wrote:
Thanks Simon. How would I import extra python packages in docker? I want to analyse images so probably need the PIL library..?
Cheers

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+unsubscribe@googlegroups.com.

Simon Biggs

unread,
Apr 29, 2017, 6:04:21 AM4/29/17
to Randle Taylor, Robin Cole, QATrack+
I've made a "user_requirements.txt" file in the most recent pull request. That can be used as a convenient method to add new python packages to the environment. Does that seem like it will solve the issue?

On Sat, 29 Apr 2017 at 00:43 Randle Taylor <randle...@gmail.com> wrote:
Don't know enough about Docker yet to say how easy it is, but certainly it would be a good feature to make it easy for people to add whatever package they want to the python environment.

On 28 April 2017 at 06:48, Robin Cole <robma...@gmail.com> wrote:
Thanks Simon. How would I import extra python packages in docker? I want to analyse images so probably need the PIL library..?
Cheers

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.

To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Cole

unread,
Apr 29, 2017, 6:07:06 AM4/29/17
to QATrack+
Yes that would do it, unless we just want to bundle pylinac and PIL in the main requirements

Simon Biggs

unread,
Apr 29, 2017, 6:11:35 AM4/29/17
to Robin Cole, QATrack+
A neat benefit by having a separate user requirements file is that any changes to that requirements file will not trigger as a change to the original requirements file. Docker therefore will use a cached version of all the standard python packages, it won't have to download all the other packages again.
On Sat, 29 Apr 2017 at 20:07 Robin Cole <robma...@gmail.com> wrote:
Yes that would do it, unless we just want to bundle pylinac and PIL in the main requirements

--
You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/IEWrsshjFzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To post to this group, send email to qat...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benjamin Bown

unread,
Mar 15, 2021, 7:09:51 AM3/15/21
to QATrack+
Replying to quite an old comment, but we've just got hold of a Druck GE PACE 1000 barometer recently and I just figured out how to query the pressure over the network using python.
I made a new Composite Test called "Druck PACE1000 Current Pressure (mbar)" with the macro name druck_pressure in QATrack+ that can be used to display the current pressure in any test list.

Here's the code:
'''
This code uses pyvisa to communicate with Druck PACE1000 via SCPI commands.
pyvisa and pyvisa-py packages must be installed in qatrack python virtual environment to work.
for usage, see pyvisa documentation online.
'''
import pyvisa

# instantiate the PyVISA-py backend using '@py'
rm = pyvisa.ResourceManager('@py')

# Initialise the instrument using the VXI-11 Address String. This can be found on the LAN homepage of the druck by visiting it's IP address or http://pacexxxxx/ (where xxxxx = serial number)
# TCPIP INSTR format looks like TCPIP[board]::host address[::LAN device name][::INSTR]
with rm.open_resource("TCPIP::192.168.186.120::inst0::INSTR") as druck:
    sens_press = float(druck.query(':SENSe:PRESsure?').split()[1]) #:SENS:PRES? returns string like ':SENS:PRES 1010.5384554' so must split and float to get pressure value alone.
    
result = round(sens_press, 2) #round to 2 decimal places

Hopefully that helps anyone else using a networked barometer!

Regards,

Ben

On Monday, 27 February 2017 at 14:23:26 UTC Robin Cole wrote:
I note that our barometers (https://www.gemeasurement.com/test-calibration/indicators/pace1000-precision-pressure-indicator) have an ethernet port, meaning that the barometer QA (comparing to Gatwick) could be performed automatically. Anybody using their barometers over the network? Presumably they can publish the readings as a webserver..
Cheers 
Reply all
Reply to author
Forward
0 new messages