How to make multi-band lightcurves in the Portal Aspect

I am struggling to figure out how to make a multi-band light curve in the Portal. Can someone help me?

With a query like this, I can get the forced fluxes for a given DiaObject:

SELECT, fsodo.psfDiffFlux, fsodo.psfDiffFluxErr, cv.expMidptMJD 
FROM dp02_dc2_catalogs.ForcedSourceOnDiaObject as fsodo
JOIN dp02_dc2_catalogs.CcdVisit as cv ON cv.ccdVisitId = fsodo.ccdVisitId
WHERE fsodo.diaObjectId = 1252220598734556212

I can plot all of the data points, or use a filter to plot only one band, but I can’t choose a color map based on the band (see screenshot below). Presumably because is a string and not a number?

I’ve been looking around and the SQL CASE function, or ADQL scisql_extractInt64(), could be used to convert the string to a number, and then that number maybe could be used as a colormap. But neither function are available.

I’ve been perusing the IRAS IPAC YouTube channel, too, and found lots of cool plotting demos but no multi-band light curve demo.

I can’t offer any insight specifically for this problem, but for SDSS queries, the SQL CONVERT function is what’s been recommended to me to use for casts, like this (where so is a table alias):

..., CONVERT(bigint, so.specObjID) as specObjID, ...

For your case I suppose you’d try float as the type in the 1st argument. It’s standard SQL, not specific to ADQL, so it should be available. Similarly for CAST.

the only solution I found as workaround for the Firefly limit on char column is to convert the band column to ASCII.

And then use it as color map:

It seems that ASCII function is not available directly in ADQL query, so you have to perform the conversion directly on the table results.

2 posts were split to a new topic: String-formatted columns causing plot axis errors in NB 07a

Thank you @gabrimaine, that workaround does get the points colored by band, though I think alternative (or maybe I should say custom) functionality to make this easier for users (and to add a legend) is still in development.

Confirmed! It’s in the Portal development plan to make category columns (whether string or numeric, so we can usefully handle column ranges like {1,2,3,999} without washing out the 1/2/3 distinction) directly usable in the Color Map and Size Map fields, and to provide a legend.

1 Like