Now, we have sndist function,developed by Gala as , so we can obtain sn radial distribution from inside database.
Tables used:
Relative and absolute distances for given supernovae:
cas=# select sndist('1997C'); sndist ------------------- (6.74416,117.721) (1 row)
Just relative distance:
cas=# select (sndist('1997C')).reldist; reldist --------- 6.74416 (1 row)
More information:
cas=# select sn_name,snt.name, gal_type, gal_type_code, gal_type_code_prec, coalesce((sndist(s)).reldist,0) as rd from sn.sn_cat s, sn.sntypes snt where s.sn_type = snt.id and sn_name='1997C'; sn_name | name | gal_type | gal_type_code | gal_type_code_prec | rd ---------+------+----------+---------------+--------------------+--------- 1997C | Ib/c | Sbc | 3.6 | 2.1 | 6.74416 (1 row)
Top 10 relative distances:
cas=# select sn_name,snt.name, gal_type, gal_type_code, gal_type_code_prec, coalesce((sndist(s)).reldist,0) as rd from sn.sn_cat s, sn.sntypes snt where s.sn_type = snt.id order by rd desc limit 10; sn_name | name | gal_type | gal_type_code | gal_type_code_prec | rd ---------+------+----------+---------------+--------------------+--------- 1997C | Ib/c | Sbc | 3.6 | 2.1 | 6.74416 2001if | Ia | S0-a | -0.5 | 1 | 4.02793 1999gr | Ia | Sbc | 4.3 | 1.8 | 3.5263 2005do | Ia | S0 | -2 | 0.4 | 3.49693 2004S | Ia | Sab | 1.8 | 2.6 | 3.33767 1969L | IIP | Sc | 5.3 | 0.6 | 3.13418 1976L | I | E-SO | -2.9 | 0.4 | 3.06896 1992bo | Ia | S0 | -1.7 | 1.4 | 2.92768 2005et | Ia | S? | 0.2 | 5 | 2.92338 2003dv | IIn | I | 9.8 | 0.8 | 2.90888 (10 rows)
Top 10 absolute distances:
cas=# select sn_name,snt.name, gal_type, gal_type_code, gal_type_code_prec, coalesce((sndist(s)).absdist,0) as ad from sn.sn_cat s, sn.sntypes snt where s.sn_type = snt.id order by ad desc limit 10; sn_name | name | gal_type | gal_type_code | gal_type_code_prec | ad ---------+------+----------+---------------+--------------------+--------- 1997C | Ib/c | Sbc | 3.6 | 2.1 | 117.721 1987A | II | SBm | 9.1 | 0.5 | 105.436 2005et | Ia | S? | 0.2 | 5 | 72.2292 2004go | Ia | E-SO | -2.7 | 1.4 | 70.7152 2005do | Ia | S0 | -2 | 0.4 | 70.3288 2003iz | Ia | S? | 0.9 | 5 | 61.1004 2001if | Ia | S0-a | -0.5 | 1 | 57.4466 2005er | Ia | E | -4.8 | 0.4 | 53.4304 2005E | Ib/c | S0-a | 0.4 | 0.6 | 51.6774 2002jp | Ic | Sab | 2.2 | 1.2 | 48.3328 (10 rows)
Additional constraints could be used, for example, supernovae type.
cas=# select * from sn.sntypes; id | name | mod_date ----+------+---------------------------- 1 | I | 2006-03-22 16:30:12.854722 2 | Ia | 2006-03-22 16:30:12.856209 3 | Ib | 2006-03-22 16:30:12.858478 4 | Ib/c | 2006-03-22 16:30:12.860389 5 | Ic | 2006-03-22 16:30:12.86186 6 | II | 2006-03-22 16:30:12.863361 7 | IIb | 2006-03-22 16:30:12.864829 8 | IIn | 2006-03-22 16:30:12.866439 9 | IIL | 2006-03-22 16:30:12.868458 10 | IIP | 2006-03-22 16:30:12.870882 11 | Pec | 2006-03-22 16:30:12.872674 (11 rows)
Top 10 relative distances for Ib/c supernovae:
cas=# select sn_name,snt.name, gal_type, gal_type_code, gal_type_code_prec, coalesce((sndist(s)).reldist,0) as rd from sn.sn_cat s, sn.sntypes snt where s.sn_type = snt.id and sn_type in (4) order by rd desc limit 10; sn_name | name | gal_type | gal_type_code | gal_type_code_prec | rd ---------+------+----------+---------------+--------------------+---------- 1997C | Ib/c | Sbc | 3.6 | 2.1 | 6.74416 2005E | Ib/c | S0-a | 0.4 | 0.6 | 2.66349 2002cp | Ib/c | SABc | 5.2 | 0.6 | 1.26045 2005N | Ib/c | Sb | 3.1 | 0.6 | 1.19668 2003dr | Ib/c | Sc | 5.8 | 0.5 | 1.01439 1999P | Ib/c | S? | 4 | 5 | 0.892924 1991R | Ib/c | S? | 4.4 | 5 | 0.85325 1996cd | Ib/c | S? | 1.1 | 5 | 0.848163 2003A | Ib/c | Sb | 3.1 | 0.4 | 0.789405 1990aa | Ib/c | Sb | 3.3 | 2.8 | 0.72177 (10 rows)
Results could be saved to file:
cas=# \o filename cas=# YOUR SELECT cas=# \o
Use '\a' for unaligned output