From ramestica at gmail.com Mon Feb 3 11:03:34 2020 From: ramestica at gmail.com (Rodrigo Amestica) Date: Mon, 03 Feb 2020 11:03:34 -0500 Subject: [AstroPy] missing distance in galactic coordinates from catalog Message-ID: Hi, I assumed that the code below would return galactic coodinates including a known distance to the object. However, what I get are the two galactic angles and the distance seems to always default to 1.0, which seems to convey no distance information at all. I suppose that that happens because the actual distance is not known with a given accurracy? I'm interested on querying for very well known Milky Way objects (like in the example below), to map their position in the galaxy; without much concern about accurracy. Is it there a different approach that I could follow to get complete galactic coordinates? Rodrigo from astropy.coordinates import SkyCoord for i in ['Galactic Center', 'Cygnus A', 'Eta Carinae']: c = SkyCoord.from_name(i) print(i) print('\t', c.galactic, '\t', c.galactic.distance) ,---- | Galactic Center | 1.0 | Cygnus A | 1.0 | Eta Carinae | 1.0 `---- From adrianmpw at gmail.com Mon Feb 3 11:17:56 2020 From: adrianmpw at gmail.com (Adrian Price-Whelan) Date: Mon, 3 Feb 2020 11:17:56 -0500 Subject: [AstroPy] missing distance in galactic coordinates from catalog In-Reply-To: References: Message-ID: Hi Rodrigo -- The .from_name() functionality is designed to only pull sky coordinates for sources, so there is currently no way to use this to retrieve distance measurements. For many sources (especially the ones you list in your code snippet), there are often many different options for distance measurements, and choosing the "best" one often depends on a given researcher's needs or preferences. We therefore recommend that you construct the SkyCoord instances explicitly, e.g.: import astropy.coordinates as coord import astropy.units as u galcen = SkyCoord(l=359.94425934*u.deg, b=-0.04616236*u.deg, distance=XX*u.kpc, frame='galactic') In the case of the Galactic center, if you are looking for a reasonable, recent measurement, you may be interested in this paper: https://ui.adsabs.harvard.edu/abs/2018A%26A...615L..15G/abstract best, Adrian On Mon, Feb 3, 2020 at 11:04 AM Rodrigo Amestica wrote: > Hi, > > I assumed that the code below would return galactic coodinates including a > known distance to the object. > > However, what I get are the two galactic angles and the distance seems to > always default to 1.0, which seems to convey no distance information at > all. > > I suppose that that happens because the actual distance is not known with a > given accurracy? > > I'm interested on querying for very well known Milky Way objects (like in > the example below), to map their position in the galaxy; without much > concern about accurracy. Is it there a different approach that I could > follow to get complete galactic coordinates? > > Rodrigo > > from astropy.coordinates import SkyCoord > for i in ['Galactic Center', 'Cygnus A', 'Eta Carinae']: > c = SkyCoord.from_name(i) > print(i) > print('\t', c.galactic, '\t', c.galactic.distance) > > ,---- > | Galactic Center > | | (359.94425934, -0.04616236)> 1.0 > | Cygnus A > | | (76.18988033, 5.75538823)> 1.0 > | Eta Carinae > | | (287.59678845, -0.62951118)> 1.0 > `---- > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -- Adrian M. Price-Whelan Flatiron Institute, NYC http://adrn.github.io (he / him) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramestica at gmail.com Mon Feb 3 17:26:44 2020 From: ramestica at gmail.com (Rodrigo Amestica) Date: Mon, 03 Feb 2020 17:26:44 -0500 Subject: [AstroPy] missing distance in galactic coordinates from catalog In-Reply-To: References: Message-ID: Hi Adrian, thanks for your response and description. My reading of your reply is that there is no bullet-proof recipe to query for the distance to an object. For that sort of information one needs to know very well how the value is to be used and, eventually, consult papers like the one linked before; that is, not as simple as just querying a catalog. Thanks, Rodrigo ps: I recognize some colleagues from my previous professional life in that paper's authors list. On 2020-02-03T11:17:56-0500, Adrian Price-Whelan wrote: > Hi Rodrigo -- > The .from_name() functionality is designed to only pull sky coordinates for > sources, so there is currently no way to use this to retrieve distance > measurements. > For many sources (especially the ones you list in your code snippet), there > are often many different options for distance measurements, and choosing > the "best" one often depends on a given researcher's needs or preferences. > We therefore recommend that you construct the SkyCoord instances > explicitly, e.g.: > import astropy.coordinates as coord > import astropy.units as u > galcen = SkyCoord(l=359.94425934*u.deg, b=-0.04616236*u.deg, > distance=XX*u.kpc, frame='galactic') > In the case of the Galactic center, if you are looking for a reasonable, > recent measurement, you may be interested in this paper: > https://ui.adsabs.harvard.edu/abs/2018A%26A...615L..15G/abstract > best, > Adrian > On Mon, Feb 3, 2020 at 11:04 AM Rodrigo Amestica > wrote: > > Hi, > > > > I assumed that the code below would return galactic coodinates including a > > known distance to the object. > > > > However, what I get are the two galactic angles and the distance seems to > > always default to 1.0, which seems to convey no distance information at > > all. > > > > I suppose that that happens because the actual distance is not known with a > > given accurracy? > > > > I'm interested on querying for very well known Milky Way objects (like in > > the example below), to map their position in the galaxy; without much > > concern about accurracy. Is it there a different approach that I could > > follow to get complete galactic coordinates? > > > > Rodrigo > > > > from astropy.coordinates import SkyCoord > > for i in ['Galactic Center', 'Cygnus A', 'Eta Carinae']: > > c = SkyCoord.from_name(i) > > print(i) > > print('\t', c.galactic, '\t', c.galactic.distance) > > > > ,---- > > | Galactic Center > > | > | (359.94425934, -0.04616236)> 1.0 > > | Cygnus A > > | > | (76.18988033, 5.75538823)> 1.0 > > | Eta Carinae > > | > | (287.59678845, -0.62951118)> 1.0 > > `---- > > _______________________________________________ > > AstroPy mailing list > > AstroPy at python.org > > https://mail.python.org/mailman/listinfo/astropy > > > -- > Adrian M. Price-Whelan > Flatiron Institute, NYC > http://adrn.github.io > (he / him) From ejensen1 at swarthmore.edu Mon Feb 3 20:09:44 2020 From: ejensen1 at swarthmore.edu (Eric Jensen) Date: Mon, 3 Feb 2020 20:09:44 -0500 Subject: [AstroPy] missing distance in galactic coordinates from catalog In-Reply-To: References: Message-ID: <2F0E48FE-4735-4D71-9843-ED57E4D21E72@swarthmore.edu> Hi Rodrigo, > On Feb 3, 2020, at 5:26 PM, Rodrigo Amestica wrote: > > My reading of your reply is that there is no bullet-proof recipe to query > for the distance to an object. For that sort of information one needs to > know very well how the value is to be used and, eventually, consult papers > like the one linked before; that is, not as simple as just querying a > catalog. It is certainly true that there is no single method for finding the distance to an object. However, many objects have distance measurements available in Simbad, so depending on your needs, you might be able to use those distances. You can access Simbad information using astroquery. However, you have to deal with the fact that Simbad may return no information for a given source, so the relevant field in the returned table will be masked. Here?s an example, building on your original code, that shows how this is used. I?ve added two other objects to your list to show the kinds of results you get (since none of your original objects returns a distance): from astropy.coordinates import SkyCoord from astroquery.simbad import Simbad # Add to the default field returned by Simbad: Simbad.add_votable_fields('plx', 'distance?) for i in ['Galactic Center', 'Cygnus A', 'Eta Carinae', 'T Tau', 'M13']: c = SkyCoord.from_name(i) g = c.galactic print("\n", i) print(" Galactic coords l={:0.3f}, b={:0.3f}".format(g.l.degree, g.b.degree)) sim = Simbad.query_object(i) # Prefer the parallax distance if available: if not sim['PLX_VALUE'].mask[0]: # Parallax distance: print(" Parallax distance is {:0.1f} pc.".format(1000./sim['PLX_VALUE'][0])) # but if no parallax we'll take any other distance: elif not sim['Distance_distance'].mask[0]: print(" Distance from reference {} is {} {}.".format(sim['Distance_bibcode'][0], sim['Distance_distance'][0], sim['Distance_unit'][0])) else: print(" No distance available in Simbad.") This returns the following output: Galactic Center Galactic coords l=359.944, b=-0.046 No distance available in Simbad. Cygnus A Galactic coords l=76.190, b=5.755 No distance available in Simbad. Eta Carinae Galactic coords l=287.597, b=-0.630 No distance available in Simbad. T Tau Galactic coords l=176.230, b=-20.887 Parallax distance is 144.3 pc. M13 Galactic coords l=59.009, b=40.912 Distance from reference 2008MNRAS.389.1924F is 0.008 Mpc. Hope this helps, Eric P.S. As an aside, I?ll note that the first item shows nicely the fact that the Galactic Coordinate system was defined in 1958, but measurements of the position of Sgr A* have continued to improve, so it is not actually located at 0, 0 in Galactic coords despite being our best marker of the Galactic Center. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3952 bytes Desc: not available URL: From bsipocz at gmail.com Wed Feb 5 18:48:39 2020 From: bsipocz at gmail.com (Brigitta Sipocz) Date: Wed, 5 Feb 2020 15:48:39 -0800 Subject: [AstroPy] SciPy 2020 Conference Call for Proposals (with Astronomy and Astrophysics mini symposium!) Message-ID: Dear All, I would like to remind everyone that the call for proposals for the upcoming SciPy 2020 conference is fast approaching. I would like to highlight that this year we have an Astronomy and Astrophysics mini symposium, thus abstract submissions for tutorials, talks, and posters are especially encouraged from this community. Deadline is February 11, 2020. For more information see the website and the details below. Best regards, Brigitta Sip?cz SciPy 2020 Astronomy and Astrophysics Co-chair https://www.scipy2020.scipy.org/ =========== SciPy 2020, the 19th annual Scientific Computing with Python conference, will be held July 6-12, 2020 in Austin, Texas. The annual SciPy Conference brings together over 900 participants from industry, academia, and government to showcase their latest projects, learn from skilled users and developers, and collaborate on code development. The call for SciPy 2020 talks, posters, and tutorials is now open through February 11, 2020. Talks and Posters (July 8-10, 2020) In addition to the general track, this year will have the following specialized tracks, mini symposia, and sessions: Tracks High Performance Python Machine Learning and Data Science Mini Symposia Astronomy and Astrophysics Biology and Bioinformatics Earth, Ocean, Geo and Atmospheric Science Materials Science Special Sessions Maintainers Track SciPy Tools Plenary Session For additional details and instructions, please see the conference website. Tutorials (July 6-7, 2020) Tutorials should be focused on covering a well-defined topic in a hands-on manner. We are looking for awesome techniques or packages, helping new or advanced Python programmers develop better or faster scientific applications. We encourage submissions to be designed to allow at least 50% of the time for hands-on exercises even if this means the subject matter needs to be limited. Tutorials will be 4 hours in duration. In your tutorial application, you can indicate what prerequisite skills and knowledge will be needed for your tutorial, and the approximate expected level of knowledge of your students (i.e., beginner, intermediate, advanced). Instructors of accepted tutorials will receive a stipend. For examples of content and format, you can refer to tutorials from past SciPy tutorial sessions (SciPy 2018 , SciPy2019 ) and some accepted submissions . For additional details and instructions see the conference website . Submission page: https://easychair.org/conferences/?conf=scipy2020 Submission Deadline: February 11, 2020 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishri0208 at gmail.com Wed Feb 12 07:59:21 2020 From: aishri0208 at gmail.com (AISHRILA MAZUMDER) Date: Wed, 12 Feb 2020 18:29:21 +0530 Subject: [AstroPy] Making fits images with given angular size and pixel resolution Message-ID: Hello, I have a numpy 3D array of size (200,200,300). The third axis is the redshift (frequency) axis, and the first two axes are coordinates in Mpc. Now I have converted the Mpc values to angular separation using cosmological calculations, and I have determined the pixel size in arcsec. I want to know if its possible to make a fits image out of this 3D array using the pixel size and angular size in Astropy. I could not find any method of doing this hence I am writing this email. The image (which is a single slice along z axis) should look like image.png attached with this email. Thank you in advance, best regards, Aishrila Mazumder -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 78634 bytes Desc: not available URL: From m.shemuni at gmail.com Thu Feb 13 00:33:48 2020 From: m.shemuni at gmail.com (Mohammad Shameoni Niaei) Date: Thu, 13 Feb 2020 08:33:48 +0300 Subject: [AstroPy] Making fits images with given angular size and pixel resolution In-Reply-To: References: Message-ID: You're looking for "writeto" method. Here a simple script: from astropy.io import fits as fts > > dest = "/Output/file" > > fits_file = "/Input/file" > > hdu = fts.open(fits_file, "readonly") > > header = hdu[0].header > data = hdu[0].data > > # > #Do something to data > # > > fts.writeto(dest, data, header=header) > On Wed, Feb 12, 2020 at 5:50 PM AISHRILA MAZUMDER wrote: > Hello, > > I have a numpy 3D array of size (200,200,300). The third axis is the > redshift (frequency) axis, and the first two axes are coordinates in Mpc. > Now I have converted the Mpc values to angular separation using > cosmological calculations, and I have determined the pixel size in arcsec. > I want to know if its possible to make a fits image out of this 3D array > using the pixel size and angular size in Astropy. I could not find any > method of doing this hence I am writing this email. The image (which is a > single slice along z axis) should look like image.png attached with this > email. > > Thank you in advance, > > best regards, > Aishrila Mazumder > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -- Mohammad SHAMEONI NIAEI Astronomer / Software Specialist Astrofizik Ara?t?rma ve Uygulama Merkezi (ATASAM), Yakutiye, ERZURUM/T?RK?YE -------------- next part -------------- An HTML attachment was scrubbed... URL: From mihail.cara at gmail.com Thu Feb 13 13:13:58 2020 From: mihail.cara at gmail.com (Mihai Cara) Date: Thu, 13 Feb 2020 13:13:58 -0500 Subject: [AstroPy] AstroPy Digest, Vol 161, Issue 5 In-Reply-To: References: Message-ID: <6A767E88-2DF0-45EF-8CC2-9CBC8E3CE44F@gmail.com> Because you mentioned "pixel size in arcsec", I assume you are interested in creating images with valid WCS object. In that case, follow instructions in https://docs.astropy.org/en/stable/wcs/index.html#building-a-wcs-structure-programmatically to create a WCS object ("w") and to create a FITS HDU object. The only difference from the example is in the last statement. Instead of hdu = fits.PrimaryHDU(header=header) assuming "data" is the numpy array with your data and "slice" is the slice number (0-indexed), you should do: hdu = fits.PrimaryHDU(data=data[:, :, slice], header=header) Then write this HDU to a file: hdu.writeto('slice_name.fits') Mihai ?On 2/13/20, 12:02 PM, "astropy-bounces+mihail.cara=gmail.com at python.org on behalf of 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: Making fits images with given angular size and pixel resolution (Mohammad Shameoni Niaei) ---------------------------------------------------------------------- Message: 1 Date: Thu, 13 Feb 2020 08:33:48 +0300 From: Mohammad Shameoni Niaei To: Astronomical Python mailing list Subject: Re: [AstroPy] Making fits images with given angular size and pixel resolution Message-ID: Content-Type: text/plain; charset="utf-8" You're looking for "writeto" method. Here a simple script: from astropy.io import fits as fts > > dest = "/Output/file" > > fits_file = "/Input/file" > > hdu = fts.open(fits_file, "readonly") > > header = hdu[0].header > data = hdu[0].data > > # > #Do something to data > # > > fts.writeto(dest, data, header=header) > On Wed, Feb 12, 2020 at 5:50 PM AISHRILA MAZUMDER wrote: > Hello, > > I have a numpy 3D array of size (200,200,300). The third axis is the > redshift (frequency) axis, and the first two axes are coordinates in Mpc. > Now I have converted the Mpc values to angular separation using > cosmological calculations, and I have determined the pixel size in arcsec. > I want to know if its possible to make a fits image out of this 3D array > using the pixel size and angular size in Astropy. I could not find any > method of doing this hence I am writing this email. The image (which is a > single slice along z axis) should look like image.png attached with this > email. > > Thank you in advance, > > best regards, > Aishrila Mazumder > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -- Mohammad SHAMEONI NIAEI Astronomer / Software Specialist Astrofizik Ara?t?rma ve Uygulama Merkezi (ATASAM), Yakutiye, ERZURUM/T?RK?YE -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer _______________________________________________ AstroPy mailing list AstroPy at python.org https://mail.python.org/mailman/listinfo/astropy ------------------------------ End of AstroPy Digest, Vol 161, Issue 5 *************************************** From ferguson at stsci.edu Thu Feb 13 16:11:12 2020 From: ferguson at stsci.edu (Harry Ferguson) Date: Thu, 13 Feb 2020 21:11:12 +0000 Subject: [AstroPy] AstroPy Digest, Vol 161, Issue 5 In-Reply-To: References: Message-ID: <1C4AAEF8-7C8C-448E-B6B4-BC8BBBCAF14F@stsci.edu> If you would like to record the mapping from pixels to angular size in your FITS header, that?s what ?world coordinate systems? are for. There are some instructions at https://docs.astropy.org/en/stable/wcs/. This can get very arcane, but for your simple application, ifthe third axis is redshift, you could do something like: from astropy.io import fits from astropy.wcs import WCS myarray = np.ones((200,200,300),dtype=np.float64) # Your 3D array w = WCS(naxis=3) w.wcs.crpix = (100,100,150) # Reference pixel at the center w.wcs.crval = (30.,60.,1.0) # centered at RA=30 deg, Dec=60 deg, redshift z=1.0 w.wcs.ctype = ('RA---TAN','DEC--TAN','ZOPT') w.wcs.cunit = ('deg','deg?,'') # Increments 1 arc second per pixel in the spatial dimensions and delta_z = 0.1 in redshift w.wcs.pc = [[1/3600.,0.,0.], [0,1/3600.,0.], [0,0,0.01]] hdu = fits.PrimaryHDU(myarray, header=w.to_header()) hdu.writeto('myfile.fits') If you display myfile.fits in ds9 you should get slider for the redshift axis, labeled with redshift, and the coordinate info should show RA & Dec. Dr. Henry C. Ferguson Space Telescope Science Institute 3700 San Martin Drive, Baltimore, MD 21218 Phone: (410) 338-5098 www.stsci.edu/~ferguson On Feb 13, 2020, at 12:00 PM, astropy-request at python.org wrote: External Email - Use Caution 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: Making fits images with given angular size and pixel resolution (Mohammad Shameoni Niaei) ---------------------------------------------------------------------- Message: 1 Date: Thu, 13 Feb 2020 08:33:48 +0300 From: Mohammad Shameoni Niaei > To: Astronomical Python mailing list > Subject: Re: [AstroPy] Making fits images with given angular size and pixel resolution Message-ID: > Content-Type: text/plain; charset="utf-8" You're looking for "writeto" method. Here a simple script: from astropy.io import fits as fts dest = "/Output/file" fits_file = "/Input/file" hdu = fts.open(fits_file, "readonly") header = hdu[0].header data = hdu[0].data # #Do something to data # fts.writeto(dest, data, header=header) On Wed, Feb 12, 2020 at 5:50 PM AISHRILA MAZUMDER > wrote: Hello, I have a numpy 3D array of size (200,200,300). The third axis is the redshift (frequency) axis, and the first two axes are coordinates in Mpc. Now I have converted the Mpc values to angular separation using cosmological calculations, and I have determined the pixel size in arcsec. I want to know if its possible to make a fits image out of this 3D array using the pixel size and angular size in Astropy. I could not find any method of doing this hence I am writing this email. The image (which is a single slice along z axis) should look like image.png attached with this email. Thank you in advance, best regards, Aishrila Mazumder _______________________________________________ AstroPy mailing list AstroPy at python.org https://mail.python.org/mailman/listinfo/astropy -- Mohammad SHAMEONI NIAEI Astronomer / Software Specialist Astrofizik Ara?t?rma ve Uygulama Merkezi (ATASAM), Yakutiye, ERZURUM/T?RK?YE -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer _______________________________________________ AstroPy mailing list AstroPy at python.org https://mail.python.org/mailman/listinfo/astropy ------------------------------ End of AstroPy Digest, Vol 161, Issue 5 *************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingridivetthe at gmail.com Fri Feb 14 00:33:15 2020 From: ingridivetthe at gmail.com (Ingrid Iveth) Date: Thu, 13 Feb 2020 23:33:15 -0600 Subject: [AstroPy] AstroPy Digest, Vol 161, Issue 5 In-Reply-To: <1C4AAEF8-7C8C-448E-B6B4-BC8BBBCAF14F@stsci.edu> References: <1C4AAEF8-7C8C-448E-B6B4-BC8BBBCAF14F@stsci.edu> Message-ID: Hi My name is Ingrid FLores, and I'm a master student in M?xico and I have been working with python for a while, I would like to know how to write a python macro to display a spectrum(files are given) in order to calculate the flux of the H? and H? lines; calculate dust extinction; so I can calculate the SFR from the H? line. I would really appreciate your help. Best regards, Ingrid FLores El jue., 13 feb. 2020 a las 15:27, Harry Ferguson () escribi?: > If you would like to record the mapping from pixels to angular size in > your FITS > header, that?s what ?world coordinate systems? are for. There are some > instructions > at https://docs.astropy.org/en/stable/wcs/. > > This can get very arcane, but for your simple application, ifthe third axis > is redshift, you could do something like: > > from astropy.io import fits > from astropy.wcs import WCS > > myarray = np.ones((200,200,300),dtype=np.float64) # Your 3D array > > w = WCS(naxis=3) > w.wcs.crpix = (100,100,150) # Reference pixel at the center > w.wcs.crval = (30.,60.,1.0) # centered at RA=30 deg, Dec=60 deg, redshift > z=1.0 > w.wcs.ctype = ('RA---TAN','DEC--TAN','ZOPT') > w.wcs.cunit = ('deg','deg?,'') > > # Increments 1 arc second per pixel in the spatial dimensions and delta_z > = 0.1 in redshift > w.wcs.pc = [[1/3600.,0.,0.], > [0,1/3600.,0.], > [0,0,0.01]] > > hdu = fits.PrimaryHDU(myarray, header=w.to_header()) > hdu.writeto('myfile.fits') > > If you display myfile.fits in ds9 you should get slider for the redshift > axis, labeled > with redshift, and the coordinate info should show RA & Dec. > > > Dr. Henry C. Ferguson > Space Telescope Science Institute > 3700 San Martin Drive, Baltimore, MD 21218 > Phone: (410) 338-5098 > www.stsci.edu/~ferguson > > > > On Feb 13, 2020, at 12:00 PM, astropy-request at python.org wrote: > > External Email - Use Caution > > 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: Making fits images with given angular size and pixel > resolution (Mohammad Shameoni Niaei) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 13 Feb 2020 08:33:48 +0300 > From: Mohammad Shameoni Niaei > To: Astronomical Python mailing list > Subject: Re: [AstroPy] Making fits images with given angular size and > pixel resolution > Message-ID: > > > Content-Type: text/plain; charset="utf-8" > > You're looking for "writeto" method. Here a simple script: > > from astropy.io import fits as fts > > > dest = "/Output/file" > > fits_file = "/Input/file" > > hdu = fts.open(fits_file, "readonly") > > header = hdu[0].header > data = hdu[0].data > > # > #Do something to data > # > > fts.writeto(dest, data, header=header) > > > On Wed, Feb 12, 2020 at 5:50 PM AISHRILA MAZUMDER > wrote: > > Hello, > > I have a numpy 3D array of size (200,200,300). The third axis is the > redshift (frequency) axis, and the first two axes are coordinates in Mpc. > Now I have converted the Mpc values to angular separation using > cosmological calculations, and I have determined the pixel size in arcsec. > I want to know if its possible to make a fits image out of this 3D array > using the pixel size and angular size in Astropy. I could not find any > method of doing this hence I am writing this email. The image (which is a > single slice along z axis) should look like image.png attached with this > email. > > Thank you in advance, > > best regards, > Aishrila Mazumder > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > > > > -- > Mohammad SHAMEONI NIAEI > Astronomer / Software Specialist > Astrofizik Ara?t?rma ve Uygulama Merkezi (ATASAM), > Yakutiye, ERZURUM/T?RK?YE > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/astropy/attachments/20200213/dedbc231/attachment-0001.html > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > > > ------------------------------ > > End of AstroPy Digest, Vol 161, Issue 5 > *************************************** > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From perry at stsci.edu Mon Feb 17 15:57:24 2020 From: perry at stsci.edu (Perry Greenfield) Date: Mon, 17 Feb 2020 20:57:24 +0000 Subject: [AstroPy] Announcing ASDF mailing lists Message-ID: <2A1161AA-7588-491C-8507-7EA1C8779AA2@stsci.edu> Because there are users of ASDF (Advanced Scientific Data Format: https://asdf.readthedocs.io/en/latest/) outside of STScI and that we have encountered issues that would benefit from feedback from such users, we are creating two new mailing lists for ASDF. One will be user-focused (asdf-users) and one more developer-focused (asdf-developers). These will permit general discussions, but also allow us to make announcements and raise issues that the user and developer communities should be aware of. To avoid spammers, we require requests for group membership. https://groups.google.com/forum/#!forum/asdf-users https://groups.google.com/forum/#!forum/asdf-developers