In [20]:
from marvin import config
from marvin.tools.query import Query
config.mode='remote'
Let's grab all spaxels with an Ha-flux > 25 from MPL-5.
In [2]:
config.setRelease('MPL-5')
f = 'emline_gflux_ha_6564 > 25'
q = Query(searchfilter=f)
print(q)
In [5]:
# let's run the query
r = q.run()
In [6]:
r.totalcount
r.results
Out[6]:
Spaxel queries are queries on individual spaxels, and thus will always return a spaxel x and y satisfying your input condition. There is the potential of returning a large number of results that span only a few actual galaxies. Let's see how many..
In [7]:
# get a list of the plate-ifus
plateifu = r.getListOf('plateifu')
# look at the unique values with Python set
print('unique galaxies', set(plateifu), len(set(plateifu)))
Unless specified, spaxel queries will query across all bintypes and stellar templates. If you only want to search over a certain binning mode, this must be specified. If your query is taking too long, or returning too many results, consider filtering on a specific bintype and template.
In [8]:
f = 'emline_gflux_ha_6564 > 25 and bintype.name == SPX'
q = Query(searchfilter=f, returnparams=['template.name'])
print(q)
# run it
r = q.run()
In [9]:
r.results
Out[9]:
In [10]:
f = 'nsa.sersic_logmass > 9.5 and nsa.z < 0.1 and emline_sew_ha_6564 > 3'
q = Query(searchfilter=f)
print(q)
In [11]:
r = q.run()
In [12]:
# Let's see how many spaxels we returned from how many galaxies
plateifu = r.getListOf('plateifu')
print('spaxels returned', r.totalcount)
print('from galaxies', len(set(plateifu)))
In [13]:
r.results[0:5]
Out[13]:
Marvin also contains more advanced queries in the form of predefined functions. For example, let's say you want to ask Marvin
"Give me all galaxies that have an H-alpha flux > 25 in more than 20% of their good spaxels"
you can do so using the query function npergood. npergood accepts as input a standard filter expression condition. E.g., the syntax for the above query would be input as
npergood(emline_gflux_ha_6564 > 25) >= 20
The syntax is
FUNCTION(Conditional Expression) Operator Value
Let's try it...
In [17]:
config.mode='remote'
config.setRelease('MPL-4')
f = 'npergood(emline_gflux_ha_6564 > 5) >= 20'
q = Query(searchfilter=f)
r = q.run()
In [18]:
r.results
Out[18]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: