easyaccess icon indicating copy to clipboard operation
easyaccess copied to clipboard

add ability to map array and matrix columns

Open esheldon opened this issue 7 years ago • 0 comments

A good example is the ngmix photometry which has array and matrix columns. Some of these are covariance matrices, which are naturally represented in memory as a 9x9 matrix not 81 different columns.

A simple approach is for easyaccess to internally check that the user has requested an array or matrix column, such as cm_pars_cov, and then expand it in the query. E.g. the user could write

select
    cm_pars,
    cm_pars_cov,
from
    ....

and this would internally be expanded to

select
    cm_pars_1,
    cm_pars_2,
    ....
    cm_pars_cov_1_1,
    cm_pars_cov_1_2,
   ...
from

And then when writing out a fits file or returning a numpy array, the data gets packed into single columns cm_pars and cm_pars_cov.

esheldon avatar Jul 31 '17 16:07 esheldon