Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA data model first version #131

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions datamodel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,64 @@ The format will be identical to that of the pfsObject files.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Physical parameter measurements for Galactic Archeology targets including flux-calibrated
combined spectra and synthetic stellar template fits.

"pfsGAObject-%05d-%05d-%s-%016x-%03d-0x%016x.fits"
% (catId, tract, patch, objId, nVisit % 1000, pfsVisitHash)

The format is similar to pfsObject files, but with additional HDUs and a different fluxTable format.

HDU #j VELCORR Velocity corrections used at each visit [BINARY FITS TABLE]
HDU #i STELLARPARAMS Fundamental stellar parameter measurements [BINARY FITS TABLE]
HDU #l STELLARCOVAR Covariance matrix of stellar parameters [BINARY FITS TABLE] n*n
HDU #k ABUND Single element abundances [BINARY FITS TABLE]
HDU #m ABUNDCOVAR Covarinace matrix of single element abundances [32-bit FLOAT] n*n

In the data tables outlined below, we allow for the possibility of multiple measurements of the same
physical parameters indicated by the `method` field but we provide the full covariance matrix for
the primary method only. The column `covarId` indicates the position of the parameter within the
corresponding covariance matrix.

The VELCORR table lists the velocity corrections used at each visit:

visit visit identifier 32-bit int
JD Julian Date of the visit 32-bit float
helio Heliocentric correction at the visit [km s-1] 32-bit float
bary Barycentric correction at the visit [km s-2] 32-bit float

The STELLARPARAMS table lists the measured fundamental parameters

method Method of measuring the parameters string
frame Reference frame for measuring the velocity string
param Stellar parameter string
covarId Index of parameter within the covariance matrix 8-bit uint
unit Physical unit of the parameter string
value Measured value of the parameter 32-bit float
valueErr Uncertainty of the measured value 32-bit float
flag Measurement flag (true means bad) bool
status Flags describing the quality of the measurement string

The ABUND table lists the measured single element abundances

method Method of measuring the parameters string
element Element name string
covarId Index of parameter within the covariance matrix 8-bit uint
value Measured abundance 32-bit float
valueErr Uncertainty of the measured abundance 32-bit float
flag Measurement flag (true means bad) bool
status Flags describing the quality of the measurement string

The FLUXTABLE of pfsGAObject files is extended and includes the following additional columns:

model Best fit fluxed template model 32-bit float
cont Continuum model 32-bit float
norm_flux Continuum-normalized flux 32-bit float
norm_error Error of continuum-normalized flux 32-bit float
norm_model Best fit continuum-normalized model 32-bit float

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

2D spectral line measurements

The 2D pipeline measures the position and flux of sky and arc lines as part of the reduction process.
Expand Down
1 change: 1 addition & 0 deletions python/pfs/datamodel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
from .pfsTable import *
from .pfsFocalPlaneFunction import *
from .pfsFiberNorms import *
from .ga import *
21 changes: 16 additions & 5 deletions python/pfs/datamodel/fluxTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class FluxTable:
_hduName = "FLUX_TABLE" # HDU name to use

def __init__(self, wavelength, flux, error, mask, flags):
dims = np.array([len(wavelength.shape), len(flux.shape), len(error.shape), len(mask.shape)])
lengths = set([wavelength.shape, flux.shape, error.shape, mask.shape])
if np.any(dims != 1) or len(lengths) > 1:
raise RuntimeError("Bad shapes for wavelength,flux,error,mask: %s,%s,%s,%s" %
(wavelength.shape, flux.shape, error.shape, mask.shape))
self.checkShapes(wavelength=wavelength,
flux=flux,
error=error,
mask=mask)

self.wavelength = wavelength
self.flux = flux
self.error = error
Expand All @@ -53,6 +53,17 @@ def __len__(self):
"""Return number of elements"""
return len(self.wavelength)

def checkShapes(self, **kwargs):
keys = list(sorted(kwargs.keys()))
dims = np.array([len(kwargs[k].shape) for k in keys])
lengths = set([kwargs[k].shape for k in keys])

if np.any(dims != 1) or len(lengths) > 1:
names = ','.join(keys)
shapes = ','.join([str(kwargs[k].shape) for k in keys])
raise RuntimeError("Bad shapes for %s: %s" %
(names, shapes))

def toFits(self, fits):
"""Write to a FITS file

Expand Down
Loading