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

in-house implementation of a pv image generator #794

Closed
kswang1029 opened this issue Apr 13, 2021 · 6 comments · Fixed by #934
Closed

in-house implementation of a pv image generator #794

kswang1029 opened this issue Apr 13, 2021 · 6 comments · Fixed by #934
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@kswang1029
Copy link
Contributor

kswang1029 commented Apr 13, 2021

The reason why we cannot re-use the code of casa-impv for the pv image generation is performance. casa-impv attempts to generate a rotated cube first so that the pv cut is either vertical or horizontal before actual image slicing. This is a slow process and seems unnecessary and does not scale well when image cube becomes larger.

A more scalable approach (and cancellable) is to sample the pv cut as a series of rectangle regions with 1 x cut_width (default 3pix) shape and request region spectral profiles to form a 2D image. Based on the experiments with astropy, we see at least an order of magnitude performance boost. This approach can be also used to support generating a pv image along a polyline (hence an arbitrary curve).

Screen Shot 2021-04-13 at 12 07 59 PM

Once uncertainty of this proposed approach is how we form a proper header for the offset axis, especially when projection effect is not negligible.

Science requirements: https://docs.google.com/document/d/1Z1fCDj9IujGvV6ER_bzjjL2j_bF5ykc34GRhPdOiXI4/edit

@kswang1029
Copy link
Contributor Author

kswang1029 commented Jul 15, 2021

I am going to make a mock-up script in python about the way of sampling a pv cut with fixed angular separation. This should help avoiding using tabular axis in the header. Will report back in a day or so

@kswang1029
Copy link
Contributor Author

I made a mockup script in python to sample a pv cut with fixed angular separation along the cut. The idea seems feasible but the performance may not be good enough. I put a quick summary of the idea in the attached slides. Please let me know if you have better ideas @pford @veggiesaurus
CARTA_pv_cut_sampling.pdf

@veggiesaurus
Copy link
Collaborator

@kswang1029 @pford I presume this needs to be moved to the beta 2 milestone?

@pford pford modified the milestones: v3.0b-1, v3.0b-2 Jul 27, 2021
@pford pford mentioned this issue Oct 4, 2021
@pford
Copy link
Collaborator

pford commented Oct 7, 2021

@kswang1029 during testing I have produced pv images which are the mirror of images produced by casa impv. The case shown below is like the example in the requirements doc BUT it has the line start at the upper right (positive offset) and line end at lower left (negative offset). so one would expect higher values in the pv image at the negative offset end, correct? This is what my image does, but casa has the higher values at the positive offset end. The image has only one channel.

impv(imagename='casa_wideField.fits', outfile='widefield_impv_pv.im', mode='coords', start=[2335, 1650], end=[1800, 1200], width=3)

Shown: original image with line, carta pv image, casa impv image.

casa_wideField fits-image-2021-10-07-14-44-14
casa_wideField_pv fits-image-2021-10-07-14-54-39
widefield_impv_pv im-image-2021-10-07-14-55-22

@pford
Copy link
Collaborator

pford commented Oct 7, 2021

@kswang1029 in the previous example, if I reverse the impv start and end points, I get the same image as carta. I tried to see whether the casaviewer is consistent with impv for this image, but the pV tab in the Regions panel is blank!

However, with the HD163296 image in the requirements doc, I get the same (pos/neg-oriented) pv image in carta and casa, and the same pv image in carta and casa if I reverse the start and end points.

I could not find anything in casadocs explaining how the offset directions were determined.

@pford
Copy link
Collaborator

pford commented Oct 29, 2021

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

Successfully merging a pull request may close this issue.

4 participants