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

support beam info and beam rendering from an AIPS fits cube #1083

Closed
kswang1029 opened this issue Apr 12, 2022 · 11 comments · Fixed by #1275
Closed

support beam info and beam rendering from an AIPS fits cube #1083

kswang1029 opened this issue Apr 12, 2022 · 11 comments · Fixed by #1275
Assignees
Labels
enhancement New feature or request requiring frontend this backend issue requires work in both frontend and backend
Milestone

Comments

@kswang1029
Copy link
Contributor

kswang1029 commented Apr 12, 2022

example AIPS fits images can be obtained from https://www2.mpia-hd.mpg.de/THINGS/Data.html

For such AIPS fits images, the beam info is not represented in header as BMAJ, BMIN, and BPA. It adopted a non-standard representation using the HISTORY keyword. The "standard" AIPS form is (all in degrees)

HISTORY AIPS CLEAN BMAJ= 3.8158E-03 BMIN= 3.4928E-03 BPA= -40.24 =

We should still try to look for BMAJ, BMIN, and BPA to set up beam info. If those are not available, then look for that specific HISTORY to guess the beam shape for the file info (hence the frontend can render the beam properly).

HO_II_NA_MOM0_THINGS.FITS.zip

detailed discussions in https://docs.google.com/document/d/1qUm02JOLxOoG_4p_lDJpKRj7z4tnwsEh5GoOxASKNSs/edit#

Let's do 1 and 2 as described in the doc

The frontend counterpart is CARTAvis/carta-frontend#2164

@kswang1029 kswang1029 added the enhancement New feature or request label Apr 12, 2022
@kswang1029
Copy link
Contributor Author

@markccchiang do you have time to look into this?

@markccchiang
Copy link
Contributor

@markccchiang do you have time to look into this?

Ok, I will take a look at it.

@pford
Copy link
Collaborator

pford commented Apr 12, 2022

This is supported in casacore, but for #935 we removed the HISTORY beam. (See FitsLoader::RemoveHistoryBeam)

My comments in #935 indicated it was for AIPS images according to the casacore::FITSImage header comments.

@kswang1029
Copy link
Contributor Author

kswang1029 commented Apr 12, 2022

@jott3077 made this request to support AIPS fits cube. Deriving beam shape from history is really not ideal but we have no other choices. #935 is an example demonstrating it can lead to bad results.

Maybe we will need to warn users in the file info if the beam info is derived from history 🤔️

@veggiesaurus
Copy link
Collaborator

This is rather frustrating, because history is really not the appropriate place for this information, and the user was quite right to ask us to ignore it. If we add this back, we may produce misleading results, surely?

@kswang1029
Copy link
Contributor Author

kswang1029 commented Apr 12, 2022

@jott3077 could you confirm what unit is implicitly assumed for the beam shape defined in the HISTORY of an AIPS fits cube? #935 is an case that the unit is not set correctly by casacore, resulting an incorrect rendered beam. We have to make sure all AIPS fits cubes adopt the same unit for beam shape definition, otherwise rendering a wrong beam element is worse than not showing a beam element.

@veggiesaurus
Copy link
Collaborator

Deriving beam shape from history is really not ideal but we have no other choices.

I guess the other choice would be to ignore it and provide a scripting snippet to generate the appropriate beam headers from the history.

@kswang1029 kswang1029 added the question Further information is requested label Apr 12, 2022
@kswang1029
Copy link
Contributor Author

Can NRAO archive team fix this beam issue for all the archived AIPS fits images? This would help the situation a lot and ensure robustness for the future.

@jehibbard
Copy link

It's wider than the NRAO archive. For instance, I put all my thesis HI cubes and some subsequent ones into NED, and they have this behavior.

I checked a bunch of ancient images I have on disk and found:

HISTORY AIPS CLEAN BMAJ=...

gives units of degrees

HISTORY APCLN BMAJS=

gives units of arcsec (so did "HISTORY CONVL BMAJ=" in the #935 example)

MIRIAD gave units explicitly:
HISTORY RESTOR: Beam = 7.277E+00 x 6.230E+00 arcsec, pa = 6.706E+01 degrees

The first (HISTORY AIPS CLEAN BMAJ=... with units in degrees) was by far the most common, at least from my experience.

I agree that it would be a "nice to have" fall-back behavior to read it from the HISTORY card if the BMAJ fits keyword is missing, and print out a warning that it is falling back to this behavior and if the beam is wrong to set it explicitly using the BMAJ, BMIN, BPA fits keywords.

That would not help the #935 example, where there are (at least) several different HISTORY*BMAJ =" entries:
HISTORY PUTHEAD BMAJ = 0.00000E+00 / old
HISTORY PUTHEAD BMAJ = 5.55556E-04 / new
HISTORY CONVL BMAJ= 5.0000 BMIN= 5.0000 BPA= 0.0/Output beam
HISTORY AIPS CLEAN BMAJ= 1.3889E-03 BMIN= 1.3889E-03 BPA= 0.00
as well as:
HISTORY RESTOR Beam = 2.000E+00 x 1.800E+00 arcsec, pa = 8.000E+01 degrees

So I have no idea what the beam is for that image (my guess wold be that it would be the last entry rather than the first)

@veggiesaurus
Copy link
Collaborator

So I have no idea what the beam is for that image (my guess wold be that it would be the last entry rather than the first)

Personally I think this is exactly why we shouldn't attempt to guess things unless they are following a clear and widely used convention. This looks like a minefield to me.

@veggiesaurus
Copy link
Collaborator

@markccchiang don't worry about this for now. It's on hold until there is clear consensus as to how we should handle this situation.

@kswang1029 kswang1029 added this to the v4.0-stable milestone May 17, 2023
@kswang1029 kswang1029 added requiring frontend this backend issue requires work in both frontend and backend and removed question Further information is requested labels May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request requiring frontend this backend issue requires work in both frontend and backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants