How to link to the Portal

Hi, we (the Lasair broker team) are looking at a possible use case where a user wants to follow up some object that they have discovered through the broker in the RSP. One obvious thing to do is to send them to the portal with a canned query based on the object ID if we know it, or the ra and dec if not, to get them started. I’ve demoed a mockup of this and got a fairly enthusiastic response from the astronomers present so I think it’s worth persuing. The question is, what is the “proper” way to do this?

Obviously I can just link to something like https://rsp.lsst.ac.uk/portal/app/?__action=table.search&request{"startIdx":0,"serviceUrl":"https://rsp.lsst.ac.uk/api/tap", "QUERY":"<iNSERT QUERY HERE>","META_INFO":{<INSERT META HERE>}&options={<INSERT OPTIONS HERE>}.

This kind of works. However, it’s a bit messy, I can’t find any good documentation for what should go in META_INFO, it doesn’t work unless you include the right parameters for things like tbl_id and it’s not at all obvious what these should be. It therefore feels very fragile.

What’s the correct way to do this? I can see there’s a Javascript API for Firefly, but it’s not obvious how that would work and frontend development is not my natural habitat.

As an aside, the above also only works if the user is already logged in to the RSP. If you go to /portal/app when not logged in then you get asked to log in; if you go to /portal/app/?__action=table.search without a login then it looks like you just get an empty page, but that’s a secondary issue.

– Gareth

This is a great question!

We do in fact have a variety of capabilities of this nature in the Portal Aspect, which we also intend to exploit from within the RSP itself in a variety of ways in the future.

In order to support this, there is an intended-to-be-public URL API for the Portal, which we haven’t called a lot of attention to thus far. (The CST is working on preparing a couple of demonstrations, though.) You can find some basic documentation for it at https://data.lsst.cloud/portal/app/?api . Note, however, that not all of the capabilities documented there are meaningful in the RSP context at present (which is why we haven’t been calling attention to it yet).

Using this API at the moment is a bit of a shared-risk exercise; we may still make some changes to it before DP1 and/or the start of survey operations. In particular, there may be changes to the way that ObsCore searches work in the API.

For what you are looking for, there are a variety of options:

  • You can populate either the “UI assisted” version of the TAP-search screen, or the “Edit ADQL” version.
  • You can construct a URL that will simply take the user to the search screen with the desired fields filled in, or one that will actually execute the query.

You mentioned specifically searching for objects both by coordinates and by ID. Searches by coordinate can be done through either screen. For now, searches by ID have to be performed by creating the ADQL yourself, though we intend to add that capability to the “UI assisted” screen in the future. (You can already see a preliminary version of it on the DP0.3 TAP search screen.)

Some examples:

Populate the “UI-assisted” screen with a cone search of the Object catalog, with a 2’ radius around (62,-37):

https://data.lsst.cloud/portal/app/?api=tap&service=https://data.lsst.cloud/api/tap&schema=dp02_dc2_catalogs&table=dp02_dc2_catalogs.Object&ra=62.0&dec=-37.0&sr=2m

Search for coadded images containing the same point, actually executing the search:

https://data.lsst.cloud/portal/app/?api=tap&service=https://data.lsst.cloud/api/tap&schema=ivoa&table=ivoa.ObsCore&worldPt=62.0;-37.0;EQ_J2000&obsCoreSubType=lsst.deepCoadd_calexp&execute=true

Populate the ADQL-search screen with a search for a specific object:

https://data.lsst.cloud/portal/app/?api=tap&service=https://data.lsst.cloud/api/tap&adql=select%20*%20from%20dp02_dc2_catalogs.Object%20where%20objectId=1651220174314974795

Perform a search for a blended object and all its children (NB: parentObjectId is not indexed in DP0.2 Qserv, so the spatial restriction is necessary to make the query execute rapidly):

https://data.lsst.cloud/portal/app/?api=tap&service=https://data.lsst.cloud/api/tap&adql=SELECT%20*%20FROM%20dp02_dc2_catalogs.Object%20WHERE%20CONTAINS(POINT(%27ICRS%27,coord_ra,coord_dec),CIRCLE(%27ICRS%27,62.0798886,-37.0417811,0.05))=1%20AND%20(objectId=1651220174314938477%20OR%20parentObjectId=1651220174314938477)&execute=true

I hope that’s helpful as a starting point. There’s a lot that can be done with this!

Gregory

3 Likes

Thanks Gregory, that looks like exactly what’s needed here!

I don’t think the lack of stability is a concern at the moment - this is very much proof of concept/early development work. I look forward to having a play around and seeing what we can do with it.

– Gareth

Hi Gareth, the blank screen you see if not logged in may be a more general problem. I’ve noticed, if I navigate (interactively, in a browser) from the landing page to the Portal (Firefly) without first logging in, I get a blank screen. I thought this was UK RSP-specific though have just checked on data.lsst.cloud and see the same thing there. Hope that helps, George.

When do you get this blank screen? Before or after being asked for credentials?

Hi Gregory, Blank screen is before being asked for credentials. Specifically, I visit https://data.lsst.cloud/ and immediately select the Portal icon without logging in. I’m using Firefox: not sure if that is significant.

I just experienced this same behavior at data.lsst.cloud with Chrome.

Thanks. I think we have a diagnosis (interaction between browser caching and our authorization redirects) and will investigate a solution this week. In the mean time, doing a “reload” in your browser (e.g., cmd-R) should fix the issue without other consequences.