Questions tagged [astropy]

Questions related to Astropy, a community Python package for Astronomy

The Astropy Project is a community effort to develop a common core package for Astronomy in Python and foster interoperability between Python astronomy packages.

This package provides core data structure and transformations adapted to astronomy, files and I/O tools, as well as computation utilities.

For more information, refer to the Astropy documentation.

When you are posting questions about astropy, it is helpful to include the sample data file(s). Since FITS files are large, linking to publicly available MAST data, or a GitHub repo, are the best options.

730 questions
0
votes
1 answer

Change projection of a fits image

This is my first question here, so I'll try to explain it well. I am working with some all-sky fits astronomical images, which are in galactic coordinates (in the AITOF projection). I would like to transform these fits images into RA,Dec…
Pere Munar
  • 49
  • 7
0
votes
1 answer

Efficiently get midpoint of image in Python with astropy

My data is organized in a table in fits format (example.fits). I open this table ('mappars') using the Python module atpy. The table has columns x,y which are image coordinates and a data column z. The x,y are evenly spaced (events on a CCD…
Florian
  • 16
  • 5
0
votes
1 answer

How to compute the pixel size and beam size in a fits file?

I can't see the beam size in the header. How to find it?
Rian
  • 111
  • 5
0
votes
1 answer

Turning off ConfigurationItems

I am doing some calculations involving propagation of uncertainties, and I keep getting a lot of useless information logs about correlated uncertainties being unsupported. I already know that, I don't care, and I would like to stop it printing these…
TheBigH
  • 524
  • 3
  • 15
0
votes
1 answer

Copy header into new file astropy

I have this script that makes a file with multiple extensions, but I would like to add headers from the old files to the extensions. new_hdul = fits.HDUList() new_hdul.append(fits.PrimaryHDU(header=headermain)) new_hdul.append(fits.ImageHDU(nod1,…
Coolcrab
  • 2,655
  • 9
  • 39
  • 59
0
votes
1 answer

Save 2 fits files with 3 headers astropy or pyfits

I am trying to make a fits file with two images inside of it, and i want to give them both a header. There should also be a basic header for the both of them. What I have found until now is this, but I don't know how to add the headers properly.…
Coolcrab
  • 2,655
  • 9
  • 39
  • 59
0
votes
2 answers

How to concatenate 2 rows of an Astropy Table?

I have created an Astropy Table 'specs' that has columns 'path' and 'filename'. Here's the first row: path filename string192 string256 ------------------------ -------------------------------- …
J. Rigby
  • 119
  • 7
0
votes
1 answer

Conditions with Numpy

I have a little question. I don't find the way to get what I want. I have an array. I create the variable "Tri_1" in order to get only the rows which respect my condition. But I want to get also the rows from an other column which take account the…
user3685310
0
votes
0 answers

Astrometry of a CCD image with python

I am trying to implement a really easy astrometry code. I have manually found the coordinates of a couple of stars in my picture (RA/DEC and x/y in pixel). Everything seems straight forward but I still get weird results, that are off by a couple of…
0
votes
2 answers

Creating a new Image file in astropy with specified dimensions of another image file

I'm having a problem wit fits file manipulation in the astropy package, and I'm in need of some help. I essentially want to take an image I have in fits file format, and create a new file I need to start inputing correction factors to and a new…
user3125347
0
votes
1 answer

TypeError: 'Quantity' object is not callable

I am attempting to understand the quantity error. I am using Python version 2.7.1 and numpy with the quantities package. I have posted the defined variables and equations and the subsequent error. I am attempting to generate an array with values of…
0
votes
1 answer

Astropy add checksum to existing fits file

I already have a fits file written (someone sent it to me) and I want to add a checksum and datasum to the header. The only examples I found with adding a checksum using astropy.io.fits involve building a new fits HDU and verifying it on adding each…
veda905
  • 782
  • 2
  • 12
  • 32
0
votes
1 answer

How to covert np.ndarray into astropy.coordinates.Angle class?

What is the quickest/most efficient way to convert a np.ndarray (importing numpy as np) into the astropy.coordinates.Angle class? I am having trouble keeping it as np.ndarray because the .wrap_at() operation will not work.
pulsar100
  • 41
  • 7
0
votes
1 answer

Astropy: Asymmetric catalog matching results

I am doing some catalog matching for a project and found that the results I get are different when using astropy compared to other software packages for coordinate matching (e.g. Topcat). In particular, I do not understand why the following code…
HansSnah
  • 2,160
  • 4
  • 18
  • 31
0
votes
1 answer

implementing masking in python Astropy tables

Two related questions about implementing masking in a large table. I am working on a large Table with 50+ columns (merged from different sources). The missing values the columns are either NaN, 0, or empty. I would like to create a mask to find…
saud
  • 773
  • 1
  • 7
  • 20