sunpy / sunpy-1.0-paper

The SunPy 1.0 Paper Repo
12 stars 21 forks source link

Add a figure that shows a transformation to astrophysical coordinates #7

Closed ehsteve closed 5 years ago

ehsteve commented 5 years ago

The best current idea is to show regulus using an eclipse photo as is done in the solar eclipse repo and in this notebook.

ehsteve commented 5 years ago

Better idea would be to overlay the star field shown here on a lasco image.

C3-2008000

cmeweek1_c3full

wafels commented 5 years ago

We’re adding planet labels and PSP encounters on helioviewer.org that were calculated using sunpy, astropy, heliopy and spiceypy. We could just use a screenshot from helioviewer.

Sent from my iPhone

On Apr 9, 2019, at 11:23 AM, Steven Christe notifications@github.com wrote:

Better idea would be to overlay the star field shown here on a lasco image.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Cadair commented 5 years ago

Can we have that code in the example gallery please :grin:

wafels commented 5 years ago

I’ll post an example in the chat.

Sent from my iPhone

On Apr 9, 2019, at 3:01 PM, jackireland@gmail.com wrote:

We’re adding planet labels and PSP encounters on helioviewer.org that were calculated using sunpy, astropy, heliopy and spiceypy. We could just use a screenshot from helioviewer.

Sent from my iPhone

On Apr 9, 2019, at 11:23 AM, Steven Christe notifications@github.com wrote:

Better idea would be to overlay the star field shown here on a lasco image.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

ehsteve commented 5 years ago

@wafels could you post it here instead so it is easier to find? Thanks.

ehsteve commented 5 years ago
Screen Shot 2019-04-11 at 1 53 22 PM
ehsteve commented 5 years ago

This image was generated with this code. The locations of the stars are not quite correct. Investigation is ongoing to determine why.

ehsteve commented 5 years ago

I've added the data file in a new data directory

ayshih commented 5 years ago

Your code needs to take into account that the observer is not at Earth.

I used SunSPICE to obtain SOHO's location at the time of this image, and here's code for the corresponding SkyCoord:

>>> from astropy.coordinates import SkyCoord, CartesianRepresentation, HeliocentricTrueEcliptic

>>> soho_hae = CartesianRepresentation(-1.3602648e8, 55390609., 67729.814)*u.km
>>> soho = SkyCoord(soho_hae, frame=HeliocentricTrueEcliptic, obstime='2000-02-27 07:42:05.810')

You then need to feed observer=soho as a keyword argument any time you use frames.Helioprojective.

The difference is ~11 arcmin in longitude and ~2 arcmin in latitude:

>>> from sunpy.coordinates import get_earth
>>> print(soho.heliographic_stonyhurst)
<SkyCoord (HeliographicStonyhurst: obstime=2000-02-27 07:42:05.810): (lon, lat, radius) in (deg, deg, km)
    (359.81847756, -7.15574196, 1.46871806e+08)>
>>> print(get_earth(soho.obstime))
<SkyCoord (HeliographicStonyhurst: obstime=2000-02-27 07:42:05.810): (lon, lat, radius) in (deg, deg, AU)
    (0., -7.18539121, 0.99025198)>
wafels commented 5 years ago

I have a heliopy based solution almost ready. It reads the soho spice kernels and will return in ICRS.

Sent from my iPhone

On Apr 12, 2019, at 2:03 PM, Albert Y. Shih notifications@github.com wrote:

Your code needs to take into account that the observer is not at Earth.

I used SunSPICE to obtain SOHO's location at the time of this image, and here's code for the corresponding SkyCoord:

from astropy.coordinates import SkyCoord, CartesianRepresentation, HeliocentricTrueEcliptic

soho_hae = CartesianRepresentation(-1.3602648e8, 55390609., 67729.814)*u.km soho = SkyCoord(soho_hae, frame=HeliocentricTrueEcliptic, obstime='2000-02-27 07:42:05.810') You then need to feed observer=soho as a keyword argument any time you use frames.Helioprojective.

The difference is ~11 arcmin in longitude and ~2 arcmin in latitude:

from sunpy.coordinates import get_earth print(soho.heliographic_stonyhurst) <SkyCoord (HeliographicStonyhurst: obstime=2000-02-27 07:42:05.810): (lon, lat, radius) in (deg, deg, km) (359.81847756, -7.15574196, 1.46871806e+08)> print(get_earth(soho.obstime)) <SkyCoord (HeliographicStonyhurst: obstime=2000-02-27 07:42:05.810): (lon, lat, radius) in (deg, deg, AU) (0., -7.18539121, 0.99025198)> — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Cadair commented 5 years ago

I assume this data isn't in the header at all? I wonder if we should optionally import Heliopy in the SOHO source?

wafels commented 5 years ago

Here is my heliopy based solution to use the SOHO SPICE kernels.

Download and install my branch of heliopy that points to the SOHO SPICE kernels and adapts heliopy to return a SkyCoord. It's at

https://github.com/wafels/heliopy/tree/spicecoordinates https://github.com/wafels/heliopy/tree/spicecoordinates

You'll also need to install cdflib and spiceypy - I did that using pip. The following code snippet gives an example on how to setup heliopy to use the SPICE kernels and return the position of SOHO in the HGS system.

from sunpy.time import parse_timefrom sunpy.coordinates.frames import HeliographicStonyhurstimport heliopy.spice as spiceimport heliopy.data.spice as spicedatatime = parse_time('2010-02-03')spice.setup_spice()kernels = spicedata.get_kernel('soho')spice.furnish(kernels)target = spice.Trajectory('SOHO')coordinate = target.coordinate(time)coordinate_hgs = coordinate.transform_to(HeliographicStonyhurst)

On Sat, Apr 13, 2019 at 6:09 AM Stuart Mumford notifications@github.com wrote:

I assume this data isn't in the header at all? I wonder if we should optionally import Heliopy in the SOHO source?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sunpy/sunpy-1.0-paper/issues/7#issuecomment-482795959, or mute the thread https://github.com/notifications/unsubscribe-auth/AA8CF0jfLyKjyj9x7l20RSe7y_IIgcnzks5vgazdgaJpZM4ci_ny .

wafels commented 5 years ago

Also: https://github.com/wafels/heliopy/tree/spicecoordinates

Cadair commented 5 years ago

We can close this now right?