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

fov table joins added #143

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

fov table joins added #143

wants to merge 7 commits into from

Conversation

NucleonGodX
Copy link
Contributor

To implement functionality for plotting curves using Field of View (FoV) values available in SOAR, we needed to first add support for these tables in sunpy-soar. This PR introduces that necessary support for FoV tables.

@NucleonGodX NucleonGodX marked this pull request as draft July 29, 2024 20:04
@nabobalis
Copy link
Contributor

Can we make FOV opt in?

@NucleonGodX
Copy link
Contributor Author

Can we make FOV opt in?

Can you explain what you mean by this?

@NucleonGodX
Copy link
Contributor Author

I've tried to add a functionality, FOV can be passed in the search query with "earth" and "solar" values which would give coordinates with respect to that, if there is no FOV in search query it returns the normal table, if the user passes FOV in search query, depending on the value of it being solar or earth, the user will get all four coordinates.

@nabobalis
Copy link
Contributor

Can we make FOV opt in?

Can you explain what you mean by this?

By making it a new attribute a user can add to the query instead of being done all the time.

@nabobalis
Copy link
Contributor

We should create the example as well. Might as well go all in.

@NucleonGodX
Copy link
Contributor Author

We should create the example as well. Might as well go all in.

Alrighty!

@NucleonGodX NucleonGodX marked this pull request as ready for review July 31, 2024 02:41
@NucleonGodX
Copy link
Contributor Author

Looks like the doc test is failing, I'll fix it.

examples/FOV.py Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file should be renamed to be something slightly more descriptive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll make all the necessary changes. I just pushed my initial code before leaving for college.

examples/FOV.py Outdated Show resolved Hide resolved
examples/FOV.py Outdated Show resolved Hide resolved
examples/FOV.py Outdated
import sunpy_soar # NOQA: F401

#####################################################
# We shall start with constructing a search query.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would explain what query you are constructing and why

sunpy_soar/attrs.py Outdated Show resolved Hide resolved
examples/FOV.py Outdated Show resolved Hide resolved
examples/FOV.py Outdated Show resolved Hide resolved
examples/FOV.py Outdated
# Create a blank map.

data = np.full((10, 10), np.nan)
skycoord = SkyCoord(0 * u.arcsec, 0 * u.arcsec, obstime="2013-10-28", observer="earth", frame=frames.Helioprojective)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the obstime match the search?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update it.

examples/FOV.py Outdated Show resolved Hide resolved
examples/FOV.py Outdated Show resolved Hide resolved
examples/FOV.py Outdated Show resolved Hide resolved
examples/FOV.py Outdated
blank_map.draw_grid(axes=ax, color="k")

# Plot the FOVs
ax.plot_coord(earth_fov_corners, color="blue", linestyle="-", label="Earth FOV")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not use quadrangle?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'll use that.

Comment on lines +59 to +62
bottom_left_tx = min(fov_earth_bot_left_tx, fov_earth_top_right_tx)
bottom_left_ty = min(fov_earth_bot_left_ty, fov_earth_top_right_ty)
top_right_tx = max(fov_earth_bot_left_tx, fov_earth_top_right_tx)
top_right_ty = max(fov_earth_bot_left_ty, fov_earth_top_right_ty)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quadrangle was distorting, due to the coordinate values.
image

This code fixed that.
image

or maybe I am doing something wrong?

Copy link
Contributor

@nabobalis nabobalis Aug 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the values returned from all of fov_earth variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Earth FOV coordinates: {fov_earth_bot_left_tx}, {fov_earth_bot_left_ty}, {fov_earth_top_right_tx}, {fov_earth_top_right_ty}"
Values:
Earth FOV coordinates: -567.5620750957169 , -374.20399399515225 , -833.5243687650654 , -74.82417116247366 

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like the wrong values to for each pair.

Can you check we got the values from the SOAR correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are the values I get from the SOAR, maybe I am missing something in the plotting?

Copy link
Contributor

@nabobalis nabobalis Aug 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numbers for fov_earth_bot_left_tx and fov_earth_top_right_tx are reversed.

I assume that's on our side?

What is strange is that those top right values look like the values of the left edge.
Can you double check the example from the issue to make sure we are getting the correct values?

Something is up but I dont know what exactly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, will look into it.

Copy link

@ebuchlin ebuchlin Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have just discussed, this is probably because on 2022-10-13T12 (date of the example code) the Earth-Sun-SO angle was 109°, so the SO FOV was on the far side of the Sun seen from Earth. It appears that SOAR converts the bottom left and top right (θx, θy) helioprojective coordinates of the corners of the field of view seen from SO (assuming 0° roll) to Earth view, dropping the 3rd coordinate and not taking into account what is visible from Earth or not.

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

Successfully merging this pull request may close these issues.

3 participants