From fhessma at uni-goettingen.de Tue Apr 23 11:14:45 2024 From: fhessma at uni-goettingen.de (Hessman, Frederic) Date: Tue, 23 Apr 2024 15:14:45 +0000 Subject: [AstroPy] how to display an image on an different WCS In-Reply-To: References: Message-ID: <124655B0-6549-440F-AB4C-FCD869E53E9A@uni-goettingen.de> There are tutorials and plenty of examples showing how to put coordinates onto a plot of an image given the image's WCS, but what about the other way around: define the coordinate system of the plot and then place the image in that frame? Let's say one has a 101x101 image with a flat blob on it and an outer frame (so one can easily see rotations) and whose pixels are in an unrotated FK5 frame, centered at (00:11:22,-33:44:55) : the accompanying script will demo all of this. I've got a WCS for the image, called "wcs" CTYPE : 'RA---TAN' 'DEC--TAN' CRVAL : 2.8416666666666663 33.74861111111111 CRPIX : 51.0 51.0 PC1_1 PC1_2 : 1.0 0.0 PC2_1 PC2_2 : 0.0 1.0 CDELT : 0.000277777777777777 0.000277777777777777 NAXIS : 101 101 I want to display the image where the galactic coordinates are the main axes, so I've created a galactic WCS from scratch at the same central position, called "gal_wcs". CTYPE : 'GLON-TAN' 'GLAT-TAN' CRVAL : 113.46911966371806 -28.38577360534605 CRPIX : 51.0 51.0 PC1_1 PC1_2 : 1.0 0.0 PC2_1 PC2_2 : 0.0 1.0 CDELT : 0.000277777777777777 0.000277777777777777 NAXIS : 101 101 Naively, I'd expect to be able to do it this way : fig = plt.figure(figsize=(4,4)) ax = plt.subplot (projection=gal_wcs, label='galactic') ax.coords.grid (True, color='gray',ls='solid') ax.coords[0].set_axislabel (r'Galactic Longitude') ax.coords[1].set_axislabel (r'Galactic Latitude') overlay = ax.get_coords_overlay ('fk5') overlay.grid (True, color='gray',ls='dotted') overlay[0].set_axislabel (r'Right Ascension (J2000)') overlay[1].set_axislabel (r'Declination (J2000)') fk5_2_gal = ax.get_transform(wcs) # TRANSFORMATION FROM wcs=FK5 TO ax=galactic ax.imshow (data,origin='lower',interpolation='nearest',transform=fk5_to_gal) but this doesn't work: the image contents are rotated but matplotlib creates data outside of the frame to maintain an un-rotated area! ? In order to see what's happening, one can increase the size of the coordinate space, e.g. plt.xlim (right=0-0.2*nx,left=nx-1+0.2*nx) plt.ylim (top=0-0.2*ny,bottom=ny-1+0.2*ny) but this doesn't really change anything: one sees the displayed image is not rotated, just the contents, and one sees the area of data created by matplotlib outside of the rotated image. The area used is not the same in the two cases, so it's not simply matplotlib filling in the area defined by gal_wcs. Where am I confused? Can someone suggest an example I've missed? Running python 3.9.11, astropy 6.0.0, matplotlib 3.5.1 on Darwin 12.7.4 / Monterey. Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- # test.py """ Plots a fake (RA,DEC) image in a galactic reference frame. """ import astropy.units as u import matplotlib.pyplot as plt import numpy as np from astropy.coordinates import FK5, Galactic, SkyCoord from astropy.wcs import WCS, utils # ---- DEFINE CENTER OF IMAGE center = SkyCoord ('00:11:22','+33:44:55',frame='icrs',unit=(u.hourangle,u.deg)) print ('Center:',center) # ---- CREATE FAKE IMAGE data = np.zeros((101,101)) ny,nx = data.shape x,y = np.meshgrid (np.arange(nx),np.arange(ny)) x0,y0 = nx//2+1,ny//2+1 data = np.exp(-((x-x0)**2/20**2+(y-y0)**2/3**2)) mask = (x == 0)+(x == nx-1)+(y == 0//3)+(y == ny-1) data[np.where(mask)] = 1.0 plt.imshow (data) plt.show () hdr = utils.celestial_frame_to_wcs (FK5()).to_header() hdr['CRPIX1'] = nx//2+1 hdr['CRPIX2'] = ny//2+1 hdr['CDELT1'] = 1./3600 # ARCSEC hdr['CDELT2'] = 1./3600 # ARCSEC hdr['CRVAL1'] = center.ra.deg hdr['CRVAL2'] = center.dec.deg hdr['NAXIS'] = 2 hdr['NAXIS1'] = nx hdr['NAXIS2'] = ny """ hdr['PC1_1'] = np.cos(45*np.pi/180) hdr['PC1_2'] = np.sin(45*np.pi/180) hdr['PC2_1'] = hdr['PC1_2'] hdr['PC2_2'] = hdr['PC1_1'] """ wcs = WCS(hdr) print ('\nWCS of image:\n',wcs) # ---- CREATE A CORRESPONDING GALACTIC WCS adjacent = utils.pixel_to_skycoord (nx//2,ny//2,wcs) cdelt = np.abs(center.separation (adjacent).to(u.deg)) gal_hdr = utils.celestial_frame_to_wcs (Galactic()).to_header() gal_hdr['CRPIX1'] = nx//2+1 gal_hdr['CRPIX2'] = ny//2+1 gal_hdr['CDELT1'] = hdr['CDELT1'] gal_hdr['CDELT2'] = hdr['CDELT2'] gal_hdr['CRVAL1'] = center.galactic.l.value gal_hdr['CRVAL2'] = center.galactic.b.value gal_hdr['NAXIS'] = 2 gal_hdr['NAXIS1'] = nx gal_hdr['NAXIS2'] = ny gal_wcs = WCS(gal_hdr) print ('\nWCS of equivalent galactic frame:\n',gal_wcs) # ---- PLOT fig = plt.figure(figsize=(4,4)) ax = plt.subplot (projection=gal_wcs, label='galactic') ax.coords.grid (True, color='gray',ls='solid') ax.coords[0].set_axislabel (r'Galactic Longitude') ax.coords[1].set_axislabel (r'Galactic Latitude') overlay = ax.get_coords_overlay ('fk5') overlay.grid (True, color='gray',ls='dotted') overlay[0].set_axislabel (r'Right Ascension (J2000)') overlay[1].set_axislabel (r'Declination (J2000)') fk5gal = ax.get_transform(wcs) ax.imshow (data,origin='lower',interpolation='nearest',transform=fk5gal) # ---- SHOW RESULT plt.xlim (right=0-0.2*nx,left=nx-1+0.2*nx) plt.ylim (top=0-0.2*ny,bottom=ny-1+0.2*ny) plt.show () From thomas.boch at astro.unistra.fr Tue Apr 23 11:52:38 2024 From: thomas.boch at astro.unistra.fr (BOCH Thomas (OBAS)) Date: Tue, 23 Apr 2024 17:52:38 +0200 (CEST) Subject: [AstroPy] how to display an image on an different WCS In-Reply-To: <124655B0-6549-440F-AB4C-FCD869E53E9A@uni-goettingen.de> References: <124655B0-6549-440F-AB4C-FCD869E53E9A@uni-goettingen.de> Message-ID: <682287989.7081986.1713887558704.JavaMail.zimbra@unistra.fr> Hi Frederic, If I understand correctly your use case, you will need to reproject your image into the new WCS. reproject ( https://pypi.org/project/reproject/ ) is a good candidate for the task. Cheers, Thomas ----- Mail d?origine ----- De: Hessman, Frederic ?: Astronomical Python mailing list Envoy?: Tue, 23 Apr 2024 17:14:45 +0200 (CEST) Objet: [AstroPy] how to display an image on an different WCS There are tutorials and plenty of examples showing how to put coordinates onto a plot of an image given the image's WCS, but what about the other way around: define the coordinate system of the plot and then place the image in that frame? Let's say one has a 101x101 image with a flat blob on it and an outer frame (so one can easily see rotations) and whose pixels are in an unrotated FK5 frame, centered at (00:11:22,-33:44:55) : the accompanying script will demo all of this. I've got a WCS for the image, called "wcs" CTYPE : 'RA---TAN' 'DEC--TAN' CRVAL : 2.8416666666666663 33.74861111111111 CRPIX : 51.0 51.0 PC1_1 PC1_2 : 1.0 0.0 PC2_1 PC2_2 : 0.0 1.0 CDELT : 0.000277777777777777 0.000277777777777777 NAXIS : 101 101 I want to display the image where the galactic coordinates are the main axes, so I've created a galactic WCS from scratch at the same central position, called "gal_wcs". CTYPE : 'GLON-TAN' 'GLAT-TAN' CRVAL : 113.46911966371806 -28.38577360534605 CRPIX : 51.0 51.0 PC1_1 PC1_2 : 1.0 0.0 PC2_1 PC2_2 : 0.0 1.0 CDELT : 0.000277777777777777 0.000277777777777777 NAXIS : 101 101 Naively, I'd expect to be able to do it this way : fig = plt.figure(figsize=(4,4)) ax = plt.subplot (projection=gal_wcs, label='galactic') ax.coords.grid (True, color='gray',ls='solid') ax.coords[0].set_axislabel (r'Galactic Longitude') ax.coords[1].set_axislabel (r'Galactic Latitude') overlay = ax.get_coords_overlay ('fk5') overlay.grid (True, color='gray',ls='dotted') overlay[0].set_axislabel (r'Right Ascension (J2000)') overlay[1].set_axislabel (r'Declination (J2000)') fk5_2_gal = ax.get_transform(wcs) # TRANSFORMATION FROM wcs=FK5 TO ax=galactic ax.imshow (data,origin='lower',interpolation='nearest',transform=fk5_to_gal) but this doesn't work: the image contents are rotated but matplotlib creates data outside of the frame to maintain an un-rotated area! ? In order to see what's happening, one can increase the size of the coordinate space, e.g. plt.xlim (right=0-0.2*nx,left=nx-1+0.2*nx) plt.ylim (top=0-0.2*ny,bottom=ny-1+0.2*ny) but this doesn't really change anything: one sees the displayed image is not rotated, just the contents, and one sees the area of data created by matplotlib outside of the rotated image. The area used is not the same in the two cases, so it's not simply matplotlib filling in the area defined by gal_wcs. Where am I confused? Can someone suggest an example I've missed? Running python 3.9.11, astropy 6.0.0, matplotlib 3.5.1 on Darwin 12.7.4 / Monterey. Rick From j.koot at airbusds.nl Tue Apr 23 11:15:25 2024 From: j.koot at airbusds.nl (j.koot at airbusds.nl) Date: Tue, 23 Apr 2024 17:15:25 +0200 Subject: [AstroPy] how to display an image on an different WCS In-Reply-To: <124655B0-6549-440F-AB4C-FCD869E53E9A@uni-goettingen.de> References: <124655B0-6549-440F-AB4C-FCD869E53E9A@uni-goettingen.de> Message-ID: Dear reader, Please note that your email might not reach me. Airbus Netherlands has migrated to Airbus' company-wide email platform. This means that from now on my email address is sjaak.koot at airbus.com. I kindly request you to update my contact details accordingly. Thank you very much in advance. Kind regards, Sjaak Koot From fhessma at uni-goettingen.de Mon Apr 29 03:37:06 2024 From: fhessma at uni-goettingen.de (Hessman, Frederic) Date: Mon, 29 Apr 2024 07:37:06 +0000 Subject: [AstroPy] AstroPy Digest, Vol 207, Issue 2 In-Reply-To: References: Message-ID: <22DC779C-06EB-42CF-B72C-92A0478FF3E4@uni-goettingen.de> Just an update on plotting images on pre-configured WCS, in this case a fake FK5 image on a galactic coordinate grid. Thomas' idea of using reproject works great: just need to add from reproject import reproject_interp # OR reproject_adaptive FOR ANTI-ALIASING array,footprint = reproject_interp (hdu,gal_hdr) # hdu=ORIGINAL (RA,DEC) IMAGE and pyplot.imshow() will give you the correct coordinate positioning. After reading the WCS docs again, I could easily manipulate the formatting of the axes, but the formatting method ax.coords[0].set_major_formatter ('%.3f') # SUPPOSED TO BE THE SAME AS 'd.ddd' (see https://docs.astropy.org/en/stable/visualization/wcsaxes/ticks_labels_grid.html) results in an error : if you'd like to try it out, I'd be happy to send the updated script. One thing that doesn't work is the initial positioning of the image: whereas the galactic coordinates of my fake object @ RA,DEC=(00:11:22,33:44:55) are (113.469,-28.386), the plot is centered at around the major tics at (113.460,-28.390); no problem, one can shove the image to the center by hand, but one wonders why it's necessary, given that the positioning of the image should be defined by the coordinate axis WCS which was centered on the object and the image was placed correctly within both WCS. It still seems that the behaviour of pyplot & WCS using the syntax fk5_to_gal = ax.get_transform(wcs) ax.imshow (data,origin='lower',interpolation='nearest',transform=fk5_to_gal) that correcting rotates the image data but incorrectly creates fake data to turn a rotated image outline into a non-rotated image outline is doing something incorrectly. This would be a much more straight-forward route if it worked. Thanks for the great help, as always! Rick > On 24 Apr 2024, at 18:00, astropy-request at python.org wrote: > > Send AstroPy mailing list submissions to > astropy at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/astropy > or, via email, send a message with subject or body 'help' to > astropy-request at python.org > > You can reach the person managing the list at > astropy-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of AstroPy digest..." > > > Today's Topics: > > 1. Re: how to display an image on an different WCS > (BOCH Thomas (OBAS)) > 2. Re: how to display an image on an different WCS > (j.koot at airbusds.nl) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 23 Apr 2024 17:52:38 +0200 (CEST) > From: "BOCH Thomas (OBAS)" > To: Astronomical Python mailing list > Subject: Re: [AstroPy] how to display an image on an different WCS > Message-ID: > <682287989.7081986.1713887558704.JavaMail.zimbra at unistra.fr> > Content-Type: text/plain; charset=utf-8 > > Hi Frederic, > > If I understand correctly your use case, you will need to reproject your image into the new WCS. reproject ( https://pypi.org/project/reproject/ ) is a good candidate for the task. > > Cheers, > Thomas > > ----- Mail d?origine ----- > De: Hessman, Frederic > ?: Astronomical Python mailing list > Envoy?: Tue, 23 Apr 2024 17:14:45 +0200 (CEST) > Objet: [AstroPy] how to display an image on an different WCS > > There are tutorials and plenty of examples showing how to put coordinates onto a plot of an image given the image's WCS, but what about the other way around: define the coordinate system of the plot and then place the image in that frame? > > Let's say one has a 101x101 image with a flat blob on it and an outer frame (so one can easily see rotations) and whose pixels are in an unrotated FK5 frame, centered at (00:11:22,-33:44:55) : the accompanying script will demo all of this. > > I've got a WCS for the image, called "wcs" > > CTYPE : 'RA---TAN' 'DEC--TAN' > CRVAL : 2.8416666666666663 33.74861111111111 > CRPIX : 51.0 51.0 > PC1_1 PC1_2 : 1.0 0.0 > PC2_1 PC2_2 : 0.0 1.0 > CDELT : 0.000277777777777777 0.000277777777777777 > NAXIS : 101 101 > > I want to display the image where the galactic coordinates are the main axes, so I've created a galactic WCS from scratch at the same central position, called "gal_wcs". > > CTYPE : 'GLON-TAN' 'GLAT-TAN' > CRVAL : 113.46911966371806 -28.38577360534605 > CRPIX : 51.0 51.0 > PC1_1 PC1_2 : 1.0 0.0 > PC2_1 PC2_2 : 0.0 1.0 > CDELT : 0.000277777777777777 0.000277777777777777 > NAXIS : 101 101 > > Naively, I'd expect to be able to do it this way : > > fig = plt.figure(figsize=(4,4)) > > ax = plt.subplot (projection=gal_wcs, label='galactic') > ax.coords.grid (True, color='gray',ls='solid') > ax.coords[0].set_axislabel (r'Galactic Longitude') > ax.coords[1].set_axislabel (r'Galactic Latitude') > > overlay = ax.get_coords_overlay ('fk5') > overlay.grid (True, color='gray',ls='dotted') > overlay[0].set_axislabel (r'Right Ascension (J2000)') > overlay[1].set_axislabel (r'Declination (J2000)') > > fk5_2_gal = ax.get_transform(wcs) # TRANSFORMATION FROM wcs=FK5 TO ax=galactic > ax.imshow (data,origin='lower',interpolation='nearest',transform=fk5_to_gal) > > but this doesn't work: the image contents are rotated but matplotlib creates data outside of the frame to maintain an un-rotated area! ? > > In order to see what's happening, one can increase the size of the coordinate space, e.g. > > plt.xlim (right=0-0.2*nx,left=nx-1+0.2*nx) > plt.ylim (top=0-0.2*ny,bottom=ny-1+0.2*ny) > > but this doesn't really change anything: one sees the displayed image is not rotated, just the contents, and one sees the area of data created by matplotlib outside of the rotated image. The area used is not the same in the two cases, so it's not simply matplotlib filling in the area defined by gal_wcs. > > Where am I confused? Can someone suggest an example I've missed? Running python 3.9.11, astropy 6.0.0, matplotlib 3.5.1 on Darwin 12.7.4 / Monterey. > > Rick > > > > > > > ------------------------------ > > Message: 2 > Date: Tue, 23 Apr 2024 17:15:25 +0200 > From: j.koot at airbusds.nl > To: Astronomical Python mailing list > Subject: Re: [AstroPy] how to display an image on an different WCS > Message-ID: > > Dear reader, > > Please note that your email might not reach me. > > Airbus Netherlands has migrated to Airbus' company-wide email platform. > This means that from now on my email address is sjaak.koot at airbus.com. > I kindly request you to update my contact details accordingly. Thank you > very much in advance. > > Kind regards, > Sjaak Koot > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > > > ------------------------------ > > End of AstroPy Digest, Vol 207, Issue 2 > *************************************** From mroch at sdsu.edu Tue Apr 30 18:34:21 2024 From: mroch at sdsu.edu (mroch at sdsu.edu) Date: Tue, 30 Apr 2024 15:34:21 -0700 Subject: [AstroPy] visual magnitude and surface brightness from astropy/astroplan Message-ID: <08bf01da9b4e$8c02a970$a407fc50$@sdsu.edu> Dear All, We had been using JPL's Horizons and we replaced our solar ephemeris with astropy/astroplan (versions 5.8 and 0.8 respectively) which greatly increased our ephemeris throughput for biology applications (e.g., diel patterns and animal presence over a period of decades). We would like to do something similar with lunar data. Currently, we are using JPL's visual magnitude and surface brightness measurement (quantity 9, https://ssd.jpl.nasa.gov/horizons/manual.html). It is clear to me how to use astroplan to retrieve the percentage of the moon that is illuminated, but not the visual magnitude and surface brightness produced by JPL. Looking at the astroplan source code, it does not appear that astroplan was designed for this and we may need to learn how to use astropy. Any suggestions would be welcome. Apologies if this is a trivial question; I am a scientist, but not an astronomer. All my best, Marie -------------- next part -------------- An HTML attachment was scrubbed... URL: From ejensen1 at swarthmore.edu Tue Apr 30 20:09:34 2024 From: ejensen1 at swarthmore.edu (Eric LN Jensen) Date: Tue, 30 Apr 2024 20:09:34 -0400 Subject: [AstroPy] visual magnitude and surface brightness from astropy/astroplan In-Reply-To: <08bf01da9b4e$8c02a970$a407fc50$@sdsu.edu> References: <08bf01da9b4e$8c02a970$a407fc50$@sdsu.edu> Message-ID: <0233AED2-3662-4C9E-A1B1-057760C91E29@swarthmore.edu> Hi Marie, I think you can do this with the astroquery.jplhorizons package, https://astroquery.readthedocs.io/en/latest/jplhorizons/jplhorizons.html Something like this: from astroquery.jplhorizons import Horizons # Use whatever location(s) and epoch(s) you need here: obj = Horizons(id=301, location='568', epochs=2458133.) eph = obj.ephemerides() print(eph.colnames) ['targetname', 'datetime_str', 'datetime_jd', 'solar_presence', 'flags', 'RA', 'DEC', 'RA_app', 'DEC_app', 'RA_rate', 'DEC_rate', 'AZ', 'EL', 'AZ_rate', 'EL_rate', 'sat_X', 'sat_Y', 'sat_PANG', 'siderealtime', 'airmass', 'magextinct', 'V', 'surfbright', 'illumination', 'illum_defect', 'sat_sep', 'sat_vis', 'ang_width', 'PDObsLon', 'PDObsLat', 'PDSunLon', 'PDSunLat', 'SubSol_ang', 'SubSol_dist', 'NPole_ang', 'NPole_dist', 'EclLon', 'EclLat', 'r', 'r_rate', 'delta', 'delta_rate', 'lighttime', 'vel_sun', 'vel_obs', 'elong', 'elongFlag', 'alpha', 'lunar_elong', 'lunar_illum', 'sat_alpha', 'sunTargetPA', 'velocityPA', 'OrbPlaneAng', 'constellation', 'TDB-UT', 'ObsEclLon', 'ObsEclLat', 'NPole_RA', 'NPole_DEC', 'GlxLon', 'GlxLat', 'solartime', 'earth_lighttime', 'RA_3sigma', 'DEC_3sigma', 'SMAA_3sigma', 'SMIA_3sigma', 'Theta_3sigma', 'Area_3sigma', 'RSS_3sigma', 'r_3sigma', 'r_rate_3sigma', 'SBand_3sigma', 'XBand_3sigma', 'DoppDelay_3sigma', 'true_anom', 'hour_angle', 'alpha_true', 'PABLon', 'PABLat'] print(eph['surfbright', 'V', 'illumination']) surfbright V illumination mag / arcsec2 mag % ------------- ------ ------------ 6.344 -6.287 4.51195 Hope this helps, Eric > On Apr 30, 2024, at 6:34 PM, wrote: > > Dear All, > > We had been using JPL?s Horizons and we replaced our solar ephemeris with astropy/astroplan (versions 5.8 and 0.8 respectively) which greatly increased our ephemeris throughput for biology applications (e.g., diel patterns and animal presence over a period of decades). We would like to do something similar with lunar data. Currently, we are using JPL?s visual magnitude and surface brightness measurement (quantity 9, https://ssd.jpl.nasa.gov/horizons/manual.html). It is clear to me how to use astroplan to retrieve the percentage of the moon that is illuminated, but not the visual magnitude and surface brightness produced by JPL. Looking at the astroplan source code, it does not appear that astroplan was designed for this and we may need to learn how to use astropy. Any suggestions would be welcome. > > Apologies if this is a trivial question; I am a scientist, but not an astronomer? > > All my best, > Marie > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From ejensen1 at swarthmore.edu Tue Apr 30 20:17:38 2024 From: ejensen1 at swarthmore.edu (Eric LN Jensen) Date: Tue, 30 Apr 2024 20:17:38 -0400 Subject: [AstroPy] visual magnitude and surface brightness from astropy/astroplan In-Reply-To: <0233AED2-3662-4C9E-A1B1-057760C91E29@swarthmore.edu> References: <08bf01da9b4e$8c02a970$a407fc50$@sdsu.edu> <0233AED2-3662-4C9E-A1B1-057760C91E29@swarthmore.edu> Message-ID: P.S. It?s a detail, but I realized after I sent the message that I edited (shortened) the epoch in the example but didn?t change the output, so the code snippet is not self-consistent. It should be: In [23]: obj = Horizons(id=301, location='568', epochs=2458133.) In [24]: eph = obj.ephemerides() In [25]: print(eph['targetname', 'surfbright', 'V', 'illumination']) targetname surfbright V illumination --- mag / arcsec2 mag % ---------- ------------- ------ ------------ Moon (301) 6.336 -6.508 5.73382 > On Apr 30, 2024, at 8:09 PM, Eric LN Jensen wrote: > > Hi Marie, > > I think you can do this with the astroquery.jplhorizons package, https://astroquery.readthedocs.io/en/latest/jplhorizons/jplhorizons.html > > Something like this: > from astroquery.jplhorizons import Horizons > # Use whatever location(s) and epoch(s) you need here: > obj = Horizons(id=301, location='568', epochs=2458133.) > eph = obj.ephemerides() > > print(eph.colnames) > ['targetname', 'datetime_str', 'datetime_jd', 'solar_presence', 'flags', 'RA', 'DEC', 'RA_app', 'DEC_app', 'RA_rate', 'DEC_rate', 'AZ', 'EL', 'AZ_rate', 'EL_rate', 'sat_X', 'sat_Y', 'sat_PANG', 'siderealtime', 'airmass', 'magextinct', 'V', 'surfbright', 'illumination', 'illum_defect', 'sat_sep', 'sat_vis', 'ang_width', 'PDObsLon', 'PDObsLat', 'PDSunLon', 'PDSunLat', 'SubSol_ang', 'SubSol_dist', 'NPole_ang', 'NPole_dist', 'EclLon', 'EclLat', 'r', 'r_rate', 'delta', 'delta_rate', 'lighttime', 'vel_sun', 'vel_obs', 'elong', 'elongFlag', 'alpha', 'lunar_elong', 'lunar_illum', 'sat_alpha', 'sunTargetPA', 'velocityPA', 'OrbPlaneAng', 'constellation', 'TDB-UT', 'ObsEclLon', 'ObsEclLat', 'NPole_RA', 'NPole_DEC', 'GlxLon', 'GlxLat', 'solartime', 'earth_lighttime', 'RA_3sigma', 'DEC_3sigma', 'SMAA_3sigma', 'SMIA_3sigma', 'Theta_3sigma', 'Area_3sigma', 'RSS_3sigma', 'r_3sigma', 'r_rate_3sigma', 'SBand_3sigma', 'XBand_3sigma', 'DoppDelay_3sigma', 'true_anom', 'hour_angle', 'alpha_true', 'PABLon', 'PABLat'] > > print(eph['surfbright', 'V', 'illumination']) > surfbright V illumination > mag / arcsec2 mag % > ------------- ------ ------------ > 6.344 -6.287 4.51195 > > > > Hope this helps, > > Eric > >> On Apr 30, 2024, at 6:34 PM, wrote: >> >> Dear All, >> >> We had been using JPL?s Horizons and we replaced our solar ephemeris with astropy/astroplan (versions 5.8 and 0.8 respectively) which greatly increased our ephemeris throughput for biology applications (e.g., diel patterns and animal presence over a period of decades). We would like to do something similar with lunar data. Currently, we are using JPL?s visual magnitude and surface brightness measurement (quantity 9, https://ssd.jpl.nasa.gov/horizons/manual.html). It is clear to me how to use astroplan to retrieve the percentage of the moon that is illuminated, but not the visual magnitude and surface brightness produced by JPL. Looking at the astroplan source code, it does not appear that astroplan was designed for this and we may need to learn how to use astropy. Any suggestions would be welcome. >> >> Apologies if this is a trivial question; I am a scientist, but not an astronomer? >> >> All my best, >> Marie >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at python.org >> https://mail.python.org/mailman/listinfo/astropy > > > > ???? Eric Jensen (he/him) Walter Kemp Professor of Astronomy Dean of Academic Success Swarthmore College Parrish E108, 610-328-8249 -------------- next part -------------- An HTML attachment was scrubbed... URL: