name:: Make a color map from CALIFA cubes query:: SELECT TOP 20000 raj2000, dej2000, flux3807-flux3839 as color FROM ( SELECT obsid, flux as flux3807 FROM califadr1.fluxv500 WHERE lambda=3807) AS t1 NATURAL JOIN ( SELECT obsid, flux as flux3839 FROM califadr1.fluxv500 WHERE lambda=3839) AS t2 JOIN califadr1.spectra USING (obsid) WHERE obsid like 'V500/IC0540%' description:: This query shows how to use the :taptable:`califadr1.fluxv500` (or :taptable:`califadr1.fluxv1200`) tables to obtain maps of color indices. The first step is to create two tables that have single-lambda maps of fluxes for a wavelength each. Note how we use column aliasing here to allow natural joining the tables and to have a nice expression in the select clause. The obsid identifies one spatial pixel here. This pixel is mapped to a position in the :taptable:`califadr1.spectra` table, which is subsequently joined to get the actual sky positions. Note that it's fairly easy to turn this into "broadband" colors; you'll just have to adjust the inner selects, e.g., like this:: SELECT obsid, SUM(flux)/count(*) AS flux3839 FROM califadr1.fluxv500 WHERE lambda BETWEEN 3850 AND 3900 GROUP BY obsid) AS t2 Note that queries like this can run for quite a while. Further note that NULL values in flux tend to make such images "spotty". To make things more robust, you could filter by ``WHERE flux IS NOT NULL`` in yet another inner select. ..