Support selecting multiple column names in FITS_rec
See original GitHub issueFITS_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:
- Created 6 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 (?), whereasFITS_rec
could in principle work withmmap=True
, and then selecting just a few column names would be more memory efficient. But I could be wrong about memmap…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.