question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support selecting multiple column names in FITS_rec

See original GitHub issue

FITS_rec generally behaves like a Numpy structured array, but doesn’t support selecting multiple column names (tested with Numpy 1.13 and both Astropy 2.0.2 and master). See the example here: https://gist.github.com/4f3d0684183da6f413539854f213b845

The workaround I’m using right now is:

data = fits.getdata('/path/to/file.fits')
data = data.view(data.dtype, np.ndarray)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
adrncommented, Oct 21, 2020

This specific issue is still present with FITS_rec.

This might still be a relevant feature request: I believe Table loads all data into memory (?), whereas FITS_rec could in principle work with mmap=True, and then selecting just a few column names would be more memory efficient. But I could be wrong about memmap…

1reaction
saimncommented, Oct 21, 2020

You can use memmap with Table now, e.g. Table.read(..., memmap=True). However this is interesting when reading rows, for columns I guess it will still load the whole file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table Data — Astropy v5.2
There are two kinds of tables in the FITS standard: binary tables and ASCII ... So, data.field(0) is the data in the column...
Read more >
selecting columns from one data frame by name from a ...
Closed last year. I have two dataframes: df1<-matrix(data = 1: ...
Read more >
How To Select Multiple Columns From PySpark DataFrames
Selecting multiple columns from PySpark DataFrames using column names, column index and regular expressions.
Read more >
PySpark Select Columns From DataFrame
You can select the single or multiple columns of the DataFrame by passing the column names you wanted to select to the select()...
Read more >
Subset columns using their names and types — select • dplyr
These helpers select variables from a character vector: all_of(): Matches variable names in a character vector. All names must be present, otherwise an ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found