Closed grburgess closed 4 years ago
If you just want to drop some columns from the returned table, you could use, e.g.
sdss = speclite.filters.load_filters('sdss2010-*')
mags = sdss.get_ab_magnitudes(flux, wlen)
print mags[['sdss2010-g', 'sdss2010-r']]
Alternatively, you could use, e.g.
mags.remove_columns(['sdss2010-g', 'sdss2010-z'])
Ok. This was actually a little slower than using the pandas conversion. Strange. I bet a straight numpy array would be much faster. The problem is that this routine is called by the fitting engine as right now it is rather slow.
I'll see if I can get a working version of my idea going. Ideally, one would call sdss.get_ab_magnitudes(blah,blah, as_array=True)
@dkirkby also, here is the idea of what we are using: https://github.com/giacomov/3ML/blob/photo_like/examples/Photometry_demo.ipynb
Is this still a blocking factor for your project @grburgess?
Closing, having never heard a reply from @grburgess.
Do you think it would be easy to have an option to have FilterSequence.get_ab_magnitudes have an option to return an array instead of a table?
Currently, I need to do this type of operation:
because I may mask some of the filters if a user wants to do a fit without them. Like so:
where self._mask is a numpy boolean array. I am not sure how to do this cleanly with a table and Table.as_array() returns a structured np array which does not understand the indexing. However, going to pandas is incredibly slow!
I was thinking to modify the _get_table() method to just build up a np 2D array optionally. Or do you think there is a better way?