Marvin provides the ability to query on or return a number of different parameters. Currently we have vetted and provided a small set. See the Parameter List for the currently available list. The naming conventions here are the same for the filter parameter names. There are more parameters. If you wish to query on a parameter that you do not see here, please let us know, and we will make it available. Or if you are adventurous, you can peruse the full unvetted list using query.get_available_params('all')
.
All Manga query parameters are grouped by parameter type. We offer six groups of parameters, and have provided a toolset designed to help you search for and locate what parameters are available, and to easily input them into Queries.
From within Marvin, to list which groups are available import the query_params object. The query_params object is a Python list object.
# import the query_params
from marvin.utils.datamodel.query.base import query_params
# display the list of parameter groups
query_params
[<ParameterGroup name=Metadata, paramcount=7>,
<ParameterGroup name=Spaxel Metadata, paramcount=3>,
<ParameterGroup name=Emission Lines, paramcount=13>,
<ParameterGroup name=Kinematics, paramcount=6>,
<ParameterGroup name=Spectral Indices, paramcount=1>,
<ParameterGroup name=NSA Catalog, paramcount=11>]
Shown is a list of all available query groups, with the number of parameters within each group. You can access individual groups, and list their parameters.
# access a group
query_params['metadata']
<ParameterGroup name=Metadata, paramcount=7>
# list parameters
query_params['metadata'].list_params()
[<QueryParameter full=cube.plateifu, name=plateifu, short=plateifu, display=Plate-IFU>,
<QueryParameter full=cube.mangaid, name=mangaid, short=mangaid, display=Manga-ID>,
<QueryParameter full=cube.ra, name=ra, short=ra, display=RA>,
<QueryParameter full=cube.dec, name=dec, short=dec, display=Dec>,
<QueryParameter full=cube.plate, name=plate, short=plate, display=Plate>,
<QueryParameter full=bintype.name, name=name, short=bin, display=Bintype>,
<QueryParameter full=template.name, name=name, short=template, display=Template>]
Access individual parameters with the same list indexing technique for groups.
# grab ra and dec
query_params['metadata']['ra']
<QueryParameter full=cube.ra, name=ra, short=ra, display=RA>
query_params['metadata']['dec']
<QueryParameter full=cube.dec, name=dec, short=dec, display=Dec>
# slice it like a list
query_params['metadata'][0:3]
[<QueryParameter full=cube.plateifu, name=plateifu, short=plateifu, display=Plate-IFU>,
<QueryParameter full=cube.mangaid, name=mangaid, short=mangaid, display=Manga-ID>,
<QueryParameter full=cube.ra, name=ra, short=ra, display=RA>]
To generate a list of names that are formatted as ready-input into Marvin Queries, use the full keyword.
# format the RA query parameter
query_params['metadata']['ra'].full
'cube.ra'
# format the entire list of metadata parameters
query_params['metadata'].list_params(full=True)
['cube.plateifu',
'cube.mangaid',
'cube.ra',
'cube.dec',
'cube.plate',
'bintype.name',
'template.name']
You can combine lists. Make a list of the galaxy RA, Dec, NSA redshift, and g-r color parameters.
# make a custom list of parameters
meta = query_params['metadata']
nsa = query_params['nsa']
myparams = meta.list_params(['ra','dec'], full=True) + nsa.list_params(['z', 'absmag_g_r'], full=True)
myparams
['cube.ra', 'cube.dec', 'nsa.z', 'nsa.elpetro_absmag_g_r']
# input into a Marvin Query
from marvin.tools.query import Query
query = Query(searchfilter='nsa.z < 0.1', returnparams=myparams)
If you want all parameters from all groups, use the query_params.list_params method.
# return all parameters from all groups
query_params.list_params()
['cube.plateifu',
'cube.mangaid',
'cube.ra',
'cube.dec',
'cube.plate',
'bintype.name',
...
...
'nsa.z',
'nsa.elpetro_ba',
'nsa.elpetro_mag_g_r',
'nsa.elpetro_absmag_g_r',
'nsa.elpetro_logmass',
'nsa.elpetro_th50_r',
'nsa.sersic_logmass',
'nsa.sersic_ba']
You can also select the parameters from individual groups. Let’s return all the NSA and Kinematic parameters.
myparams = query_params.list_params(['nsa', 'kin'])
myparams
['nsa.iauname',
'nsa.ra',
'nsa.dec',
'nsa.z',
'nsa.elpetro_ba',
'nsa.elpetro_mag_g_r',
'nsa.elpetro_absmag_g_r',
'nsa.elpetro_logmass',
'nsa.elpetro_th50_r',
'nsa.sersic_logmass',
'nsa.sersic_ba',
'spaxelprop.emline_gvel_ha_6564',
'spaxelprop.emline_gvel_oiii_5008',
'spaxelprop.emline_gsigma_ha_6564',
'spaxelprop.emline_gsigma_oiii_5008',
'spaxelprop.stellar_vel',
'spaxelprop.stellar_sigma']
We can input these directly into a Marvin Query. Note that returning lots of parameters or a mix of spaxel and galaxy parameters may result in long query times or a large result set.
from marvin.tools.query import Query
query = Query(searchfilter='nsa.z < 0.1', returnparams=myparams)
results = query.run()
print(results.columns)
print(results.results[0])
[u'cube.mangaid', u'cube.plate', u'cube.plateifu', u'ifu.name', 'nsa.iauname', 'nsa.ra', 'nsa.dec', 'nsa.z', 'nsa.elpetro_ba', 'nsa.elpetro_mag_g_r', 'nsa.elpetro_absmag_g_r', 'nsa.elpetro_logmass', 'nsa.elpetro_th50_r', 'nsa.sersic_logmass', 'nsa.sersic_ba', 'spaxelprop.emline_gvel_ha_6564', 'spaxelprop.emline_gvel_oiii_5008', 'spaxelprop.emline_gsigma_ha_6564', 'spaxelprop.emline_gsigma_oiii_5008', 'spaxelprop.stellar_vel', 'spaxelprop.stellar_sigma', u'spaxelprop.x', u'spaxelprop.y']
(u'1-209232', 8485, u'8485-1901', u'1901', u'J153010.73+484124.8', 232.544703894, 48.6902009334, 0.0407447, 0.87454, 0.646084027458681, 1.16559028625488, 9.56547591284382, 1.33067, 9.62935046578146, 0.773047, 4.95878, 0.674934, 110.361, 128.882, 32.2628, 95.9309, 6, 15)
Class
marvin.utils.datamodel.query.base.ParameterGroupList (items) |
ParameterGroup Object |
marvin.utils.datamodel.query.base.ParameterGroup (…) |
A Query Parameter Group Object |
marvin.utils.datamodel.query.base.QueryParameter (full) |
A Query Parameter class |
Methods
marvin.utils.datamodel.query.base.ParameterGroupList.list_groups () |
Returns a list of query groups. |
marvin.utils.datamodel.query.base.ParameterGroupList.list_params ([…]) |
Returns a list of parameters from all groups. |
marvin.utils.datamodel.query.base.ParameterGroup.list_params ([…]) |
List the parameter names for a given group |