Created
January 9, 2018 08:33
-
-
Save thespacedoctor/b2975de3e75369e3559a1b8a777662eb to your computer and use it in GitHub Desktop.
[Adding Alternative, Discovery and IAU Names for Phase III Transient Catalogue] #eso #phase_iii #transient #catalogue #pessto #identification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE phase_iii_transient_catalogue_ssdr3 p, | |
(SELECT | |
transientBucketId, | |
GROUP_CONCAT(name | |
SEPARATOR ', ') alternative_ids | |
FROM | |
(SELECT DISTINCT | |
t.TransientBucketId, t.name | |
FROM | |
transientBucket t, phase_iii_transient_catalogue_ssdr3 p | |
WHERE | |
t.transientBucketId = p.TransientBucketId | |
AND name NOT LIKE 'atel_%' | |
AND name NOT LIKE 'AT2%' | |
AND name NOT LIKE 'SN2%' | |
AND name NOT LIKE '<%' | |
AND t.observationMJD > 50000 | |
AND name NOT IN (SELECT | |
TRANSIENT_DISCOVERY_ID | |
FROM | |
phase_iii_transient_catalogue_ssdr3)) s | |
GROUP BY transientBucketId) s | |
SET | |
p.TRANSIENT_ALTERNATIVE_IDS = s.alternative_ids | |
WHERE | |
p.TransientBucketId = s.TransientBucketId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update (select t.transientBucketID, name, discoveryMJD from (select transientBucketID, min(observationMJD) as discoveryMJD | |
from transientBucket | |
where name NOT LIKE 'atel_%' | |
AND name NOT LIKE 'AT2%' | |
AND name NOT LIKE 'SN2%' | |
AND name NOT LIKE '<%' | |
AND limitingMag = 0 | |
AND observationMJD > 50000 | |
group by transientBucketID) s, transientBucket t | |
WHERE | |
t.transientBucketId = s.TransientBucketId | |
and t.observationMJD = s.discoveryMJD | |
and name NOT LIKE 'atel_%' | |
AND name NOT LIKE 'AT2%' | |
AND name NOT LIKE 'SN2%' | |
AND name NOT LIKE '<%' | |
AND magnitude is not null | |
AND limitingMag = 0 | |
AND observationMJD > 50000 group by transientBucketID) s, phase_iii_transient_catalogue_ssdr3 p | |
set p.TRANSIENT_DISCOVERY_ID=name | |
where p.transientBucketId = s.TransientBucketId; | |
update phase_iii_transient_catalogue_ssdr3 set TRANSIENT_DISCOVERY_ID=TRANSIENT_IAU_ID where TRANSIENT_DISCOVERY_ID is null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE (SELECT DISTINCT | |
t.TransientBucketId, t.name | |
FROM | |
transientBucket t, phase_iii_transient_catalogue_ssdr3 p | |
WHERE | |
t.transientBucketId = p.TransientBucketId | |
AND name NOT LIKE 'atel_%' | |
AND name LIKE 'SN2%') t, | |
phase_iii_transient_catalogue_ssdr3 p | |
SET | |
p.TRANSIENT_IAU_ID = t.name | |
WHERE | |
t.transientBucketId = p.TransientBucketId | |
and p.TRANSIENT_IAU_ID is null; | |
UPDATE (SELECT DISTINCT | |
t.TransientBucketId, t.name | |
FROM | |
transientBucket t, phase_iii_transient_catalogue_ssdr3 p | |
WHERE | |
t.transientBucketId = p.TransientBucketId | |
AND name NOT LIKE 'atel_%' | |
AND name LIKE 'AT2%') t, | |
phase_iii_transient_catalogue_ssdr3 p | |
SET | |
p.TRANSIENT_IAU_ID = t.name | |
WHERE | |
t.transientBucketId = p.TransientBucketId | |
and p.TRANSIENT_IAU_ID is null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment