ratt-ru / pyxis

Python Extensions for Interferometry Scripting
3 stars 5 forks source link

reverse order of Stokes/freq axes in im.wsclean #41

Open o-smirnov opened 9 years ago

o-smirnov commented 9 years ago

im.wsclean currently assembles the cubes as RA,DEC,FREQ,STOKES. lwimager and CASA produce tham as RA,DEC,STOKES,FREQ.

It would be useful to make im.wsclean follow the CASA ordering, since it simplifies e.g. image arithmetic in Tigger.

SpheMakh commented 9 years ago

This is something that is always a pain to deal with. But the culprit is not wsclean, its lwimager and MeqTrees (uv-brick). CASA, wsclean and most packages I've used follow the convention RA,DEC,FREQ,STOKES.

Which convention should we use when making images in pyxis?

o-smirnov commented 9 years ago

Ah really? Now that I hadn't realized... lt me think about that...

On Tue, Jun 2, 2015 at 2:05 PM, Sphesihle Makhathini < notifications@github.com> wrote:

This is something that is always a pain to deal with. But the culprit is not wsclean, its lwimager and MeqTrees (uv-brick). CASA, wsclean and most packages I've used follow the convention RA,DEC,FREQ,STOKES.

Which convention should we use when making images in pyxis?

— Reply to this email directly or view it on GitHub https://github.com/ska-sa/pyxis/issues/41#issuecomment-107930262.

IanHeywood commented 9 years ago

Hold up because it gets worse, and CASA isn't even internally consistent. FITS images produced by CASA's exportfits task are RA,DEC,FREQ,STOKES but the CASA format images that the imager creates are RA,DEC,STOKES,FREQ.

The best course of action is probably to assume nothing and read the ordering from the image header each time.

o-smirnov commented 9 years ago

Yeah but here the question is, if Sphe is forming up those FITS files in a script anyway, what ordering must he use?

On Tue, Jun 2, 2015 at 2:31 PM, IanHeywood notifications@github.com wrote:

Hold up because it gets worse, and CASA isn't even internally consistent. FITS images produced by CASA's exportfits task are RA,DEC,FREQ,STOKES but the CASA format images that the imager creates are RA,DEC,STOKES,FREQ.

The best course of action is probably to assume nothing and read the ordering from the image header each time.

— Reply to this email directly or view it on GitHub https://github.com/ska-sa/pyxis/issues/41#issuecomment-107938051.

SpheMakh commented 9 years ago

As we say in isZulu, "Insumansumane le". I assumed that CASA was at least self consistent; I thought the exportfits convention was the CASA convention.

o-smirnov commented 9 years ago

Is that translated as "if a man unwisely uses CASA, he deserves the shit he gets"?

On Tue, Jun 2, 2015 at 3:17 PM, Sphesihle Makhathini < notifications@github.com> wrote:

As we say in isZulu, "Insumansumane le". I assumed that CASA was at least self consistent; I thought the exportfits convention was the CASA convention.

— Reply to this email directly or view it on GitHub https://github.com/ska-sa/pyxis/issues/41#issuecomment-107950827.

SpheMakh commented 9 years ago

he he he, that is quite close though. Its translated as "A situation which is beyond comprehension"

IanHeywood commented 9 years ago

I've always held RA,DEC,FREQ,STOKES to be the proper order because that's the way AIPS does it, and also that's ordering the axes in descending order of how often astronomers care about them (RA and DEC occupying the joint first position).

o-smirnov commented 9 years ago

Well I find that very hurtful, as I care very deeply about the Stokes axis! If only because it fucks me over so often -- I guess it's Stockholm syndrome.

Anyway, I guess the only solution is to create a little tool to reorder axes in a FITS file. fitstool.py in Owlcat is a logical recipient for this functionality...

On Wed, Jun 3, 2015 at 12:39 AM, IanHeywood notifications@github.com wrote:

I've always held RA,DEC,FREQ,STOKES to be the proper order because that's the way AIPS does it, and also that's ordering the axes in descending order of how often astronomers care about them (RA and DEC occupying the joint first position).

— Reply to this email directly or view it on GitHub https://github.com/ska-sa/pyxis/issues/41#issuecomment-108118037.

SpheMakh commented 9 years ago

I've written a function that does this ( im.argo.swap_stokes_freq). But maybe this is the time to move this function as well as other FITS file related functions to fitstool.py.

SpheMakh commented 9 years ago

In fact they are couple of functions in im.argo that really ought to be moved elsewhere, like the addcol function should really be in ms. Its time to clean up after younger me. I'll create a branch for this, and hopefully be done in a few days.

IanHeywood commented 9 years ago
"You may not be interested in the polarization, but the polarization is interested in you."

Also:

"if a man unwisely uses CASA, he deserves the shit he gets"

Sphe, can you translate this please? I'm going to get a t-shirt made.

SpheMakh commented 9 years ago

@IanHeywood give me a few days to come figure out the correct phrasing.