-
Notifications
You must be signed in to change notification settings - Fork 10
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
Mark/1178 supports loading swapped-axes image cubes #1194
Conversation
…mark/1178_set_render_axes_as_0_and_1
…mark/1178_set_render_axes_as_0_and_1
@markccchiang the file info for a PV image needs a fix. The offset axis is with the "NA" label. It should be "Spatial" I guess? In fact maybe we can simply display CTYPE1/2/3/4, so
becomes
or
for example. |
@markccchiang another file info issue: for a rotated cube, there is a repeated (and incorrect) "frequency range" info. |
Oops, this was my fault. For some reason casacore uses Freq for spectral worldAxisNames instead of the actual header value. Sorry @markccchiang you will have to change it back to iterating through header entries. |
to handle the general cases like we need to incorporate a general rule in the current PR to ignore stokes (if it exists) first, then from the rest, we pick up the 1st as x-axis and the 2nd as y-axis. The rest (if it exists) is z-axis (iterable via the animator). stokes (if it exists) remains as the polarization axis. |
FYI. Working on fixing and add basic e2e tests for this new feature now. Once done I will approve this PR. |
@markccchiang one minor issue spotted in the file info. Name = gaussian_array_large_GALACTIC_2031.image longitude is [0 deg, 360 deg]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature-wise this is looking good for the current scope - supporting image visualization of a swapped-axes cube. 👍 Please proceed code review.
…mark/1178_set_render_axes_as_0_and_1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is OK; I would just like to rename these variables. We have previously referred to the X and Y axes in the code as "spatial" rather than "direction" axes, and I think it will be less confusing if we stick to that naming convention.
src/ImageData/FileLoader.cc
Outdated
@@ -175,9 +175,11 @@ std::shared_ptr<casacore::CoordinateSystem> FileLoader::GetCoordinateSystem(cons | |||
return std::make_shared<casacore::CoordinateSystem>(); | |||
} | |||
|
|||
bool FileLoader::FindCoordinateAxes(casacore::IPosition& shape, int& spectral_axis, int& z_axis, int& stokes_axis, std::string& message) { | |||
bool FileLoader::FindCoordinateAxes(casacore::IPosition& shape, std::vector<int>& direction_axes, int& spectral_axis, int& stokes_axis, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use "spatial" instead of "direction" in all these variables and comments, for consistency with our existing terminology.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a IIRC note, in casacore it is called directional axis. This may be why. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only we could all decide on one standard! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good. new e2e tests are implemented.
…TAvis/carta-backend into mark/1178_set_render_axes_as_0_and_1
|
Description
What is implemented or fixed? Mention the linked issue(s), if any.
Support loading swapped axes image cubes Support loading swapped-axes image cubes (eg RA-Channel-Dec) (backend) #1178.
How does this PR solve the issue? Give a brief summary.
Fix the render axes to [0, 1], i.e., the first two axes from the header. The original render axes setting is direction axes, if any.
Are there any companion PRs (frontend, protobuf)?
No need to change the protobuf. But it seems the AST plot settings have to be modified in the frontend, in order to plot RA-channel or DEC-channel coordinates.Companion PRs: protobuf PR 77 and frontend PR 2011.
Is there anything else that testers should know (e.g. exactly how to reproduce the issue)?
This is the new feature. We may need sample image cubes with swapped axes for testing.
Checklist
/ no changelog update needede2e test passing/ added corresponding fix/ no protobuf update needed