spacetelescope / nircam_calib

A collection of software for creating NIRCam reference files, pipeline testing, etc.
2 stars 15 forks source link

Reading the source catalog #66

Closed larrybradley closed 6 years ago

larrybradley commented 6 years ago

I was looking at the jwst_pipeline_walkthrough.ipynb notebook (which is great!) and in section 11, you read in the source catalog using astropy.io.ascii.read:

# below is an example source catalog product
from astropy.io import ascii
catalog = ascii.read("mosaic_A1-A4_obs1-8_cat.ecsv")

I just wanted to point out that the preferred way to read in an ECSV file is to use astropy.table.Table (or astropy.table.QTable). That will preserve the metadata stored in the table, e.g. units on column values (e.g. flux) and you will also get back any serialized astropy objects stored in the table (e.g. Time objects or SkyCoord objects (instead of separate columns for RA and Dec):

from astropy.tables import Table
catalog = Table.read('mosaic_A1-A4_obs1-8_cat.ecsv')

CC: @hcferguson

aliciacanipe commented 6 years ago

Thanks, Larry! Good suggestion. I made the change, so the latest version now uses an Astropy table instead.

larrybradley commented 6 years ago

Thanks!