Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAT-1196: Support planets and other non-radec targets in mvftoms #333

Merged
merged 3 commits into from
Apr 21, 2021

Conversation

ludwigschwardt
Copy link
Contributor

It is time...

@mauch, I used the script you modified for @nirujmohanr as basis, and also threw in scans for good measure.

Very early on (see 73546ac) I decided to disable non-radec targets
because I did not understand the MS format well enough to be sure that
it would work. The FIELD subtable stores directions that may vary as
polynomials over time and it all seemed very complicated.

Fast-forward 10 years to the Great Conjunction and a subsequent clamour
for MSes with Jupiter... Having studied the `fixplanets` CASA task and
the `planets_6cm` demo dataset, I came to the conclusion that it is
much ado about nothing. The standard procedure in CASA picks the first
timestamp associated with a field and determines the (ra, dec)
from the (az, el) POINTING table in the MS. In other words, just like
`target.radec(first_timestamp)` :-)

Looking at `fixplanets`, there is also an option to use the Horizons
ephemeris as an alternative. If we figure this out someday it might be
more accurate for Solar System objects, but for now this trick works
for all non-radec targets. 🎉
The CASA `fixplanets` task reveals that the DIRECTION column in the
POINTING subtable of an MS contains (az, el) coordinates in radians.
Not that we are using it yet, but just putting it out there.
While we are at it, also allow scans (and not only tracks) into an MS.
The FIELD and SOURCE tables will be populated from the target (ra, dec)
and the only difference is that the antenna pointing won't match that.
But we are not storing the POINTING table yet, so it should not make
a difference. This at least provides users with the ability to look at
scan data and figure it out themselves :-)
Copy link

@mauch mauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor question about the update to the POINTING table docstring, but otherwise looks good.

Great to see a KAT-7 JIRA ticket getting some attention :)

@@ -863,7 +863,7 @@ def populate_pointing_dict(num_antennas, observation_duration, start_time, phase
start_time : float
Start time of observation, as a Modified Julian Date in seconds
phase_center : array of float, shape (2,)
Direction of phase center, in ra-dec coordinates as 2-element array
Direction of phase center, in (az, el) coordinates as 2-element array (?)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the (?) signify here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure... Ideally this should be an array of shape e.g. (num_times, 2, num_antennas) but a single phase center for all antennas and all times is definitely not it.

field_names.append(target.name)
# Set direction of the field center to the (ra, dec) at the start
# of the first valid scan, based on the reference (catalogue) antenna.
field_time = katpoint.Timestamp(utc_seconds[0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very similar to the hack that I did in 2013 when I image Jupiter. I used one ra,dec coordinate for the full observation. Does this give one coordinate pair per track or one coordinate pair per observation ?

I also noted star trails in the automated reduction that uses katdal->obit . How are they doing it @mauch ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In katsdpcontim the target ra,dec is derived (for all observation time) from the the first timestamp of the observation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Sean, I was pleased to see that in KAT-1196 after I rediscovered the ticket. I'm also glad you didn't close it, which provided me with a ready-to-use ticket :-)

This gives one coordinate pair per observation. It doesn't use the first timestamp of the entire observation, but the first timestamp of a track on the actual source, mirroring CASA.

I tried the option of one coordinate pair per track, but that would imply the correspondence:

MeerKAT track <-> CASA field

The reality is the following correspondence:

MeerKAT track <-> CASA scan
MeerKAT target <-> CASA field / source

So you are stuck with a single (ra, dec) per target.

This "hack" is also apparently used by CASA in the fixplanets task. There you have 3 options:

  • Use the POINTING (az, el) table to get (ra, dec) for either the first timestamp of the field (the default option) or the median unflagged timestamp, using a given reference antenna (defaults to antenna 0).
  • Use an ephemeris, but this is a bit obscure. It gets added to an EPHEMERIS table while the FIELD (ra, dec) = (0, 0).
  • Override the field direction explicitly.

It seems that the three field centers don't really matter, unless you plan to run fixvis to change the UVW. As long as the delay tracking did the right thing for your source, CASA is happy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe the field centers are used to determine the absolute coordinates of the imaging grid?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so I'm just slightly confused. I think I understand, but please confirm that I do:

I see one RA/Dec entry for Jupiter in FIELD. So this is position of Jupiter at at the start of the first scan on it, correct? Thereafter, the correlator delay (and UVWs, etc.) is tracking Jupiter, correct? So it's a "kludge" in the sense that only the first timeslot's delay is really towards the given RA/Dec of its stated field.

I should therefore expect the imager to give me a proper image of Jupiter, and smudged tracks for the background sources, correct?

Copy link
Contributor Author

@ludwigschwardt ludwigschwardt Apr 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In katdal you could try:

d = katdal.open(...)
d.select(...)
d.catalogue['Jupiter'].radec(d.timestamps)  # radec at the selected timestamps

This does not consider target offsets in the delay model but those would not normally be used. And it assumes you did not change the ref_ant from its nominal value of 'array' when you opened the dataset.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMG_20210422_192506_433

Copy link
Contributor Author

@ludwigschwardt ludwigschwardt Apr 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mesmerising 🤩

The basic parameters look good:

  • Jupiter was 5.09 AU from us at the Conjunction and with 140 000 km diameter you get an extent of ~38" ✅
  • Jupiter's (ra, dec) changed by ~210" in 6.5 hours, which is about the length of the star trails ✅ Unless that was a 9-10 hour observation like the ones in the archive, then they are a bit short.

I think that's Jupiter :-)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now, the movie version! http://ratt.radiopadre.net/~oms/jove.gif. This is about 4 hours' worth.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to ask whether there would be any parallactic rotation of Jupiter's radio axis with respect to (ra, dec) and now I know, thanks to the movie :-D

And the spacing between Jupiter and Saturn also seems right for the conjunction (~0.1º).

I like the radio galaxy photobombing this auspicious moment 😂

@o-smirnov
Copy link

Thanks @ludwigschwardt, I started the download and I can see the Jupiter scans arriving now. 👍

@ludwigschwardt ludwigschwardt merged commit 32d139f into master Apr 21, 2021
@ludwigschwardt ludwigschwardt deleted the kat-1196-support-planets-in-mvftoms branch April 21, 2021 13:23
@mauch
Copy link

mauch commented Apr 23, 2021 via email

@o-smirnov
Copy link

Yep, it can only be Saturn. This is the "conjunction" track.

@o-smirnov
Copy link

Every good movie deserves a sequel, and I gotta say, this is one case of the sequel blowing away the original: http://ratt.radiopadre.net/~oms/jove3b.png

@ludwigschwardt
Copy link
Contributor Author

ludwigschwardt commented May 28, 2021

"I'll be back..." Wow, two photobombers! Awesome stuff.

@o-smirnov
Copy link

Look carefully, you might spot a transient going pop near one of them. And the steady little dot in the centre of the upper left inset is Callisto.

Is there a way to get the actual per-integration delay centres out of katdal? I'm trying to figure out if the shenanigans we engaged in with coordinates in the MS have introduced a small systematic offset into the astrometry...

@o-smirnov
Copy link

I'm trying to figure out if the shenanigans we engaged in with coordinates in the MS have introduced a small systematic offset into the astrometry...

Actually, I think we're all good. I checked against an ephemeris calculator, and Saturn is spot-on.

@bennahugo
Copy link
Contributor

bennahugo commented May 29, 2021 via email

@o-smirnov
Copy link

I would need to be taught. But not this time. The ephemeris checks out, the astrometry is spot-on. Onwards and upwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants