Comments on sncat design

1 Comment.

How to load sn data

Я загружаю данные так:

createdb DBNAME
createlang plpgsql DBNAME
psql DBNAME < snref.sql
psql DBNAME < sncat.sql
psql DBNAME < snproc.sql

./sncat2sntab.pl < sn.cat | psql megera -c "copy sn from stdin with delimiter as '|'"

– megera 2006-01-21 19:19 UTC


  • table sncat - old supernovae catalog
  • leda.m000 - main table of LEDA
  • ledasnall - identified sn with LEDA
cross identification with leda
select m.pgc,m.objname,m.al2000*15,m.de2000,m.logd25, m.bt, s.* 
into ledasnall
from leda.m000 as m, sn.sn as s
where q3c_join(m.al2000*15,m.de2000,s.ra,s.dec,2*(10^(m.logd25-1))/60.);
find non-matched sn
select s.* from sncat as s  
EXCEPT 
select s.* from sncat s, (select distinct id, name from ledasnall) as foo 
where s.name = foo.name;
union original sn.sn table and identified rows
select * into sum from 
  ( select id,name,gid,'XXX' from sn.sn 
    union all 
    select s.id,s.name,m.pgc,m.objname from leda.m000 as m, sn.sn as s 
    where q3c_join(m.al2000*15,m.de2000,s.ra,s.dec,2*(10^(m.logd25-1))/60.) 
  ) as aa;

– megera 2006-01-24 22:38 UTC


Q3c 1.2 supports ellipse join:

create index q3c_m000_idx on leda.m000 (q3c_ang2ipix(al2000*15,de2000));
cluster q3c_m000_idx on leda.m000;
analyze leda.m000;
-- s.ra is already in degrees !
create index q3c_sn_idx on sn.sn (q3c_ang2ipix(ra,dec));
cluster q3c_sn_idx on sn.sn;
analyze sn.sn;

select m.pgc,m.objname,m.al2000*15,m.de2000,m.logd25, m.bt, s.*
into ledasn_ell
from leda.m000 as m, sn.sn as s
where q3c_ellipse_join (m.al2000*15,m.de2000,s.ra,s.dec,2*(10^(m.logd25-1))/60.,10^(-m.logr25),m.pa);

– megera 2006-02-15 21:35 UTC