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 CASA image types: concatenated, componentlist, LEL #388

Closed
3 tasks done
jott3077 opened this issue Dec 4, 2019 · 24 comments
Closed
3 tasks done

Support CASA image types: concatenated, componentlist, LEL #388

jott3077 opened this issue Dec 4, 2019 · 24 comments
Assignees
Labels
enhancement New feature or request

Comments

@jott3077
Copy link

jott3077 commented Dec 4, 2019

CASA produces a number of different image formats. CARTA needs to support these image types:

  • CASA Concatenated image
  • CASA Componentlist image
  • CASA LEL images

Supporting various data types (bool, int, complex, etc.) has been moved to new issue #520.
Supporting other image types (UV, pV) has been moved to new issue #663.

A link to examples is given in the google doc
https://docs.google.com/document/d/1qH118KxBtxX4xtLNrV18meScxciFCVyIc9kelZ0JCvo

@pford
Copy link
Collaborator

pford commented Dec 4, 2019

The backend needs FileLoader subclasses for the additional types, and to support templated classes. See casacore::ImageOpener::openImage for an example which returns appropriate templated type (PagedImage, HDF5Image, ImageConcat, ImageExpr for LEL images) as LatticeBase*, but data types do not include Boolean or Int. We could adapt this for our backend and make CartaHdf5Image a templated class like PagedImage.

I tested Juergen's CASA images:

  • ComponentList opens and looks okay (?)
  • PV opens but incorrect (backend sets spectral and stokes coordinate axes incorrectly)
  • UV opens with no axes in render widget - frontend issue? (CTYPE1=UU, CTYPE2=VV, CUNIT=CUNIT2=lambda)
  • Concatenated images are currently ignored and do not appear in the file list

@veggiesaurus
Copy link
Collaborator

veggiesaurus commented Dec 5, 2019

We should probably investigate alternative data delivery mechanisms for integer and boolean images. For integers, the byte-shuffling and Zstd compression approach taken with contours would probably work nicely. For booleans, sending them as bit arrays rather than byte arrays, and using Zstd (or even just the gzip compression built into WebSocket transmission) should be sufficient.

Converting to floating point and doing lossy compression with ZFP on quantized data would be counter-productive.

@zarda
Copy link
Contributor

zarda commented Feb 7, 2020

The concatenated image in example fold can be opened in the branch. The next branch is not able to test because of no example file for LEL image.

@zarda zarda self-assigned this Feb 12, 2020
@zarda
Copy link
Contributor

zarda commented Mar 17, 2020

For PV image loader, there is an issue while setting region on PV image, the backend will crash as #327 happening. In one case for a PV image file (M17_SWex_pv.fits) with one spatial dimension and another spectral dimension, the backend will crash if starting any region functionality. In another case for a PV image (pVimage.image) with only one spatial dimension on canvas, there will be no issue. I suppose the CARTA may need the functionality for one dimensional image.

@pford
Copy link
Collaborator

pford commented Mar 17, 2020

Where is the crash? A PV image is not a 1D image, it has a casacore::LinearCoordinate and a casacore::SpectralCoordinate. According to the CASA viewer, the shape of pVimage.image is [160, 1, 52]. You cannot assume that the axes are in any particular order; CASA often puts the spectral axis last. casacore::CoordinateSystem (casacore/coordinates/Coordinates/CoordinateSystem.h) has various functions to find out if the image has a certain type of axis and where it is.

M17_SWex_pv.fits has shape [482, 25, 1]. If you push your branch I can have a look why it is crashing. Not sure what you mean by "region functionality".

@pford
Copy link
Collaborator

pford commented Mar 17, 2020

@jott3077 can you point us to some documentation on LEL images? Do they reside on disk or are they created dynamically with a lattice expression applied to an image? How would this be done in CARTA?

@pford pford mentioned this issue May 6, 2020
7 tasks
@jott3077
Copy link
Author

jott3077 commented May 8, 2020

Hi Pam,
LEL images are created dynamically. We would have to get an interface similar to the CASA viewer where one can enter the mathematical expression.

@zarda
Copy link
Contributor

zarda commented Jul 16, 2020

May I commit the current changes only? At least close part of list.

@pford
Copy link
Collaborator

pford commented Jul 17, 2020

@zarda which image types are supported in your hj/388_imageExpr branch (@kswang1029 available in mix 'n' match)? You checked off componentlist in the issue description, but the switch in FileLoader does not return a loader for this type.

@kswang1029
Copy link
Contributor

@pford I have put Juergen's test images to "set_CASAImage_flavors" on our test server.

@zarda
Copy link
Contributor

zarda commented Aug 3, 2020

@zarda which image types are supported in your hj/388_imageExpr branch (@kswang1029 available in mix 'n' match)? You checked off componentlist in the issue description, but the switch in FileLoader does not return a loader for this type.

The componentlist could be opened well so I check off this item. Do I need to create a new class loader for this type?
Thanks.

@Kechil
Copy link

Kechil commented Aug 24, 2020

This is a backend issue as well as frontend.

@kswang1029 kswang1029 added the requiring frontend this backend issue requires work in both frontend and backend label Nov 19, 2020
@kswang1029
Copy link
Contributor

kswang1029 commented Nov 19, 2020

adding "requiring_frontend" tag as

  • Images with UV coordinates
  • pV images

need the frontend (AST) to display the axes properly.

@kswang1029
Copy link
Contributor

Note that this issue (esp. pv images) is critical for the coming release and v3.0.

@jott3077
Copy link
Author

The title of the ticket is now misleading. UV and pV images are not only exclusively CASA formats but also fits, miriad, hdf5 etc.

@pford pford changed the title Support of CASA image formats Support additional image types Nov 20, 2020
@pford pford changed the title Support additional image types Support CASA image types Nov 20, 2020
@pford
Copy link
Collaborator

pford commented Nov 20, 2020

I moved UV and pV images to new issue #663 .

LEL images are created dynamically. We would have to get an interface similar to the CASA viewer where one can enter the mathematical expression.

@kswang1029 @jott3077 it sounds like this still needs the frontend tag.

@pford
Copy link
Collaborator

pford commented Nov 20, 2020

@kswang1029 please determine if this issue is still included in release 2.0.

@kswang1029
Copy link
Contributor

@pford @jott3077 the relevant frontend issue is created as CARTAvis/carta-frontend#1264

I suppose this requires changes in protobuf message too?

@kswang1029 kswang1029 changed the title Support CASA image types Support CASA image types: concatenated, componentlist, LEL Nov 23, 2020
@pford
Copy link
Collaborator

pford commented Nov 24, 2020

@jott3077 your sample componentlist.image type is returned as a PagedImage (CASA) type, already supported in CARTA.

The casacore::ImageOpener looks at the table.info file and if it contains "Type = Image" it is image type ImageOpener::AIPSPP (PagedImage), but if "Type = Component List" and the table description keywords include "coords" then it is image type ImageOpener::COMPLISTIMAGE. Your sample image has type "Image" and keyword "coords". Is this a bug in the casacore::ImageOpener code, a bug in the componentlist tool, or should we just continue treating this as a CASA image?

@zarda the ComponentListImage is defined in imageanalysis/Images/ComponentListImage.h (conveniently derived from casacore::ImageInterfacecasacore::Float). This loader should be created and added to the FileLoader::GetLoader switch.

I would like to get these new loaders into the backend before I templatize the images for issue #520 (supporting image data types bool, int, complex), since the concat and LEL images can also have various data types.

@pford
Copy link
Collaborator

pford commented Nov 24, 2020

@kswang1029 the CARTA backend supports displaying two types of images, those existing on disk and those created dynamically in CARTA (moments, pV, and LEL), with an option to save the in-memory image to disk.

Creating a moments image loader was done by Mark as part of the moments generator feature, but pV image support has been split into separate issues for the loader (#663 ) and the generator epic (#155 ). I suggest we do the same for LEL images and limit this issue to an LEL loader (no frontend required), then create a new issue to create LEL images in CARTA (labels: enhancement, requiring_frontend) linked to the frontend issue 1264 and requiring protobuf changes.

Then this issue can proceed with a pull request once the branches have been updated, and I will proceed with supporting additional data types (#520 ) in the complete set of loaders.

@kswang1029
Copy link
Contributor

@pford the plan sounds ideal. Please just create issues directly.

@pford
Copy link
Collaborator

pford commented Nov 25, 2020

Creating LEL images dynamically moved to #665

@pford
Copy link
Collaborator

pford commented Dec 8, 2020

Closed #388 via #666

@pford pford closed this as completed Dec 8, 2020
@jott3077
Copy link
Author

jott3077 commented Dec 9, 2020

I received the component list image from Kumar - I assume he would also know more about the actual interpretation in casacore.

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

No branches or pull requests

6 participants