All posts by albertw

Django Q function

When querying objects in django the simplest way is to use the filter() query.

If we have a set of systems for example and we want to filter out those that have a SPARC architecture we could do:

And if we wanted to narrow that down to only sparc machines that use NIS for name resolution we could do:

But that is narrowing down the selection. It’s an AND. What were asking for is systems that are a SPARC _AND_ use NIS. And although we can use exclude() to reject some results it’s still and AND operation. What about an OR query?

What if we wanted to select systems that had either a T5 or a T7 processor? Then we need Q queries.

Q queries take the same form of argument as filter() & exclude() etc. but can be combined using OR operators. Here’s the Q query for our model that looks at the cpu_implementation for T5 or T7:

To build our query we just use this Q expression in a filter:

Northern Lights Quests

Yep still at this after 25 years…

Continue reading Northern Lights Quests

Funcube Satellite Telemetry

Prompted by Michael’s effort at acquiring NOAA Weather Images I thought I’d see what other telemetry or data was easily and publicly available from satellites. Sever satellites operate amateur radio transponders and you can listen in on QSOs, but some also allow you obtain satellite and experiment telemetry.

My first attempt was to get the telemetry from Funcube-1 (AO-73).

Continue reading Funcube Satellite Telemetry

SOTA promotional leaflet

‘Summits on the Air’ is a great way to operate an amateur radio station in a portable environment. In Ireland there are plenty of summits, of varying difficulty, to choose from. And you will nearly always manage to make contacts, especially if you can spot yourself on the sotawatch cluster, as people around the world really want to work you.

However, setting up a station, particularly for High Frequency, get’s you noticed. It can involve having a mast about 7m high and 20m of an inverted V dipole hanging from it! This invites attention from hillwalkers – especially if you fly a SOTA flag from the mast!

I’ve produced this leaflet to give out to such curious members of the public who come over for a chat. It’s mainly for Ireland but can easily be adapted for other counties and covers the basics of Summits On The Air.

Python: Creating a singleton (to control an Arduino)

A while ago I was writing a tool in python to communicate with a sensor on an Arduino. The idea was to have a class for the Arduino that would hold the connection and handle the reading and writing to the serial port. However that way I needed to have the object maintain the connection and the open COM port (this was on windows), but this meant that I could not have multiple objects. Why? Because you can only have one connection to a COM port. The solution – use a Singleton design pattern.

Continue reading Python: Creating a singleton (to control an Arduino)

Free Astronomy Observing Guides

Before these get lost in the ether (again!) I want to put them on my blog.

Some years back a few of us put together some observing challenge booklets for the Irish Federation of Astronomical Societies. I don’t think the certificates are still being offered but they are a great resource if you are stuck wondering what you should try and look at with your new telescope or binoculars!