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

KeyError 'pytest' while installing POPPY 0.3

While using pip to install POPPY 0.3, with all the resources needed, I get several warnings about an Astropy Deprecation Warning and pysynphot things that I don't really understand. On the last few lines before failure, the Traceback shows that the…
0
votes
1 answer

Astropy Deprecation Warning

I installed Anaconda distro for python 2.7 (all works fine), then I installed SunPy following SunPy install To install SunPy’s extra dependancies run: conda update astropy pip install suds To install run: pip install sunpy But whem i run…
nandhos
  • 681
  • 2
  • 16
  • 31
0
votes
1 answer

Astroquery: AttributeError("'bytes' object has no attribute 'encode'")

I would like to run the NED query of the astroquery package. from astroquery.ned import Ned result_table = Ned.query_object("NGC 224") this is given by the example in the Documentary. I got the following issue: TableParseError: Failed to parse NED…
varantir
  • 6,624
  • 6
  • 36
  • 57
0
votes
1 answer

Python Astropy: string to integer conversion

I have an astropy Table input_table with a field/column 'observation_id', which contains the objects like 81-126. I wish to separate the two numbers (81 and 126) and save them as integers. I am writing all the steps here to show the type of objects…
nk_science
  • 23
  • 4
0
votes
1 answer

ValueError when trying to create Table object in Astropy

I am trying to construct a Table object from astropy.table, for now I wish to add only one column, but I am getting a ValueError. Does anyone know what I am doing wrong? >>> br_data["mass"] array([ 49.65092267, 269.50829639, 51.37768973, ...,…
Ohm
  • 2,312
  • 4
  • 36
  • 75
0
votes
1 answer

ValueError when using pip or easy_install to install a package into winpython

Currently doing a science course and using python to do calculations and plotting. The Uni uses winpython 2.7.5.3 This is the version I've installed as it has all the standard packages I need. I'm using windows 7 64bit However my course has started…
ArcAngel
  • 131
  • 2
  • 11
-1
votes
1 answer

To set up parameters for the sherpa tool

How to set the parameters - photon index and metal abundance in the CIAO-sherpa tool for an x-ray source? I am trying to analyze a bright x-ray source using the data extracted from Chandra archive. I have no idea about setting up the parameters for…
-1
votes
1 answer

Astropy cross-matching unusall coordinates

I want to cross-match two catalogs. But the Dec and RA coordinate data of these two catalogs are written as "h m s" and "d m s" (instead of being separated by a ":" a space separates them). RAJ2000 ----------- 00 32…
hamid
  • 3
  • 3
-1
votes
2 answers

how to find sum of all first elements of several lists i got as output

I have a got several list of numbers as output.i need to find the sum of all the corresponding first elements of all the lists(to find the average). for i in fitsfiles: hdul = fits.open (i) flux= hdul[1].data['FLUX'] waves…
Walker
  • 19
  • 3
-1
votes
1 answer

ERROR: failed building wheel when installing spectral-cube (astropy)

I'm trying to install the package spectral-cube from the astropy project using pip (22.0.4). I get a long error which ends with this: note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel…
Alex P
  • 93
  • 1
  • 6
-1
votes
2 answers

How to convert a FITS file to a numpy array

I'm trying to train an AI algorithm to determine photometric redshifts of galaxies, and to do so I have a FITS file which contains the training data. I need to convert this FITS file into a format which can be manipulated easily in Python,…
Lara
  • 33
  • 4
-1
votes
1 answer

'TypeError: string indices must be integers ' while using astropy.ascii

I am trying to read in a file 'BASTIFeH.txt' with astropy.ascii, that has more files embedded in it. Those embedded files get called my_ISOFILE1 or my_ISOFILE2. There seems to be no issue with this, it's when I start working with those that I seem…
-1
votes
1 answer

why does it say "ValueError: The array returned by a function changed size between calls"?

I'm trying to calculate an integral and I don't understand the error output, what does it mean, what's the problem and how do I fix it? the output is "ValueError: The array returned by a function changed size between calls", I added the full…
KerenK
  • 1
  • 7
-1
votes
1 answer

matplotlib title, and axes tick marks, not working with 5D np array (but do work with 3D array)

Exact code: def sanity(self) : for frame in self._input : plt.figure ( ) plt.imshow ( frame ) plt.xlim ( [ 0, frame.shape[1] ] ) plt.ylim ( [ 0, frame.shape[0] ]…
-1
votes
2 answers

Astropy Spectrum1D recovering arrays from spectrum

I have to work with an Astropy Spectrum1D array: spectrum = Spectrum1D(spectral_axis= wavelength, flux = field_strength) I need to recover the wavelengths and field_strength to standard numpy arrays so that I can manipulate them (this has to be…
PeterD
  • 29
  • 5