In [1]:
import sys
sys.path.append('../alma-calibrator/src/utils/')

from galenv import *

%matplotlib inline

In [2]:
ga = Galenv()

In [3]:
objlist = ['J0541-0211', 'J1733-3722', 'J1610-3958', 'J1743-0350', 'J2253+1608', 
           'J1851+0035', 'J0541-0541', 'J0601-7036', 'J1130-1449', 'J1305-4928', 
           'J0336+3218', 'J0006-0623', 'J1717-3342', 'J1833-210B', 'J0237+2848', 
           'J0750+1231', 'J1751+0939', 'J0948+0022', 'J1107-4449', 'J1256-0547', 
           'J1830+0619', 'J1225+1253',
           'J0747-3310', 'J1516+1932', 'J0438+3004', 'J2134-0153', 'J2226+0052', 
           'J0426+2327', 'J1626-2951', 'J1058-8003']

# typical size (diameter) of galaxy cluster => 2 - 10 Mpc
tangential_dist = 7.5 # Mpc 
dv = 2000 #km/s


for obj in objlist:
    objname = 'PKS ' + obj
    try:
        print(objname)
        #z, v0, ra, dec = ga.queryobject_byname(objname)
        #print(z, v0, ra, dec)

        #obj_coord = coordinates.SkyCoord(ra=ra, dec=dec, unit=(u.deg, u.deg))

        #dA, theta = ga.calc_dA_theta(z, tangential_dist)
        #print(dA, theta)
        
        #result = Irsa.query_region(objname, catalog="fp_xsc", spatial="Cone", radius= theta * u.deg)
        
        # plot_cone(obj_coord, theta, result, savefig=True, imgname=objname + '.extended.png')
        ga.conedv_byname(objname, tangential_dist, dv, show=True, savefig=True, imgname=objname+"_env.png")
        
        print("----")
        
    except:
        print(f"{objname}: error! maybe can not identify from name") 
        print("----")


PKS J0541-0211
Query from name:  PKS J0541-0211
PKS J0541-0211: error! maybe can not identify from name
----
PKS J1733-3722
Query from name:  PKS J1733-3722
PKS J1733-3722: error! maybe can not identify from name
----
PKS J1610-3958
Query from name:  PKS J1610-3958
PKS J1610-3958: error! maybe can not identify from name
----
PKS J1743-0350
Query from name:  PKS J1743-0350
RA, Dec (deg)  :  265.99523 -3.83462
Redshift :  1.054
Velocity :  315981.0
Angular-diameter distance :  1717.70727627639  Mpc
Angular radius for 7.5 Mpc seen from distance 1717.70727627639 Mpc :  0.2501697188357098  deg
Searching objects in cone section... 
theta = 0.2501697188357098 deg; v = [313981.0, 317981.0]
----
PKS J2253+1608
Query from name:  PKS J2253+1608
RA, Dec (deg)  :  343.49062 16.14821
Redshift :  0.859
Velocity :  257522.0
Angular-diameter distance :  1629.9307676687627  Mpc
Angular radius for 7.5 Mpc seen from distance 1629.9307676687627 Mpc :  0.2636420852173554  deg
Searching objects in cone section... 
theta = 0.2636420852173554 deg; v = [255522.0, 259522.0]
----
PKS J1851+0035
Query from name:  PKS J1851+0035
PKS J1851+0035: error! maybe can not identify from name
----
PKS J0541-0541
Query from name:  PKS J0541-0541
RA, Dec (deg)  :  85.40868 -5.69706
Redshift :  0.839
Velocity :  251526.0
Angular-diameter distance :  1618.0605034352159  Mpc
Angular radius for 7.5 Mpc seen from distance 1618.0605034352159 Mpc :  0.26557619164166346  deg
Searching objects in cone section... 
theta = 0.26557619164166346 deg; v = [249526.0, 253526.0]
----
PKS J0601-7036
Query from name:  PKS J0601-7036
PKS J0601-7036: error! maybe can not identify from name
----
PKS J1130-1449
Query from name:  PKS J1130-1449
RA, Dec (deg)  :  172.52939 -14.82427
Redshift :  1.184
Velocity :  354954.0
Angular-diameter distance :  1753.737300779338  Mpc
Angular radius for 7.5 Mpc seen from distance 1753.737300779338 Mpc :  0.24503005447689125  deg
Searching objects in cone section... 
theta = 0.24503005447689125 deg; v = [352954.0, 356954.0]
----
PKS J1305-4928
Query from name:  PKS J1305-4928
RA, Dec (deg)  :  196.36449 -49.46821
Redshift :  0.001878
Velocity :  563.0
Angular-diameter distance :  8.292149410020395  Mpc
Angular radius for 7.5 Mpc seen from distance 8.292149410020395 Mpc :  51.822311092083964  deg
Searching objects in cone section... 
theta = 51.822311092083964 deg; v = [-1437.0, 2563.0]
PKS J1305-4928: error! maybe can not identify from name
----
PKS J0336+3218
Query from name:  PKS J0336+3218
PKS J0336+3218: error! maybe can not identify from name
----
PKS J0006-0623
Query from name:  PKS J0006-0623
RA, Dec (deg)  :  1.55789 -6.39315
Redshift :  0.346676
Velocity :  103931.0
Angular-diameter distance :  1044.0300496957655  Mpc
Angular radius for 7.5 Mpc seen from distance 1044.0300496957655 Mpc :  0.41159576438756634  deg
Searching objects in cone section... 
theta = 0.41159576438756634 deg; v = [101931.0, 105931.0]
----
PKS J1717-3342
Query from name:  PKS J1717-3342
PKS J1717-3342: error! maybe can not identify from name
----
PKS J1833-210B
Query from name:  PKS J1833-210B
PKS J1833-210B: error! maybe can not identify from name
----
PKS J0237+2848
Query from name:  PKS J0237+2848
PKS J0237+2848: error! maybe can not identify from name
----
PKS J0750+1231
Query from name:  PKS J0750+1231
RA, Dec (deg)  :  117.71686 12.51801
Redshift :  0.889
Velocity :  266516.0
Angular-diameter distance :  1646.623423400248  Mpc
Angular radius for 7.5 Mpc seen from distance 1646.623423400248 Mpc :  0.26096941185298866  deg
Searching objects in cone section... 
theta = 0.26096941185298866 deg; v = [264516.0, 268516.0]
----
PKS J1751+0939
Query from name:  PKS J1751+0939
RA, Dec (deg)  :  267.88674 9.6502
Redshift :  0.322
Velocity :  96533.0
Angular-diameter distance :  994.3201278022433  Mpc
Angular radius for 7.5 Mpc seen from distance 994.3201278022433 Mpc :  0.43217303394826034  deg
Searching objects in cone section... 
theta = 0.43217303394826034 deg; v = [94533.0, 98533.0]
----
PKS J0948+0022
Query from name:  PKS J0948+0022
PKS J0948+0022: error! maybe can not identify from name
----
PKS J1107-4449
Query from name:  PKS J1107-4449
RA, Dec (deg)  :  166.78622 -44.81877
Redshift :  1.598
Velocity :  479068.0
Angular-diameter distance :  1793.3027653878596  Mpc
Angular radius for 7.5 Mpc seen from distance 1793.3027653878596 Mpc :  0.2396239802012333  deg
Searching objects in cone section... 
theta = 0.2396239802012333 deg; v = [477068.0, 481068.0]
----
PKS J1256-0547
Query from name:  PKS J1256-0547
RA, Dec (deg)  :  194.04653 -5.78931
Redshift :  0.5362
Velocity :  160749.0
Angular-diameter distance :  1344.817110605312  Mpc
Angular radius for 7.5 Mpc seen from distance 1344.817110605312 Mpc :  0.3195366440234375  deg
Searching objects in cone section... 
theta = 0.3195366440234375 deg; v = [158749.0, 162749.0]
----
PKS J1830+0619
Query from name:  PKS J1830+0619
PKS J1830+0619: error! maybe can not identify from name
----
PKS J1225+1253
Query from name:  PKS J1225+1253
RA, Dec (deg)  :  186.2656 12.88698
Redshift :  0.003392
Velocity :  1017.0
Angular-diameter distance :  14.949233862918131  Mpc
Angular radius for 7.5 Mpc seen from distance 14.949233862918131 Mpc :  28.745175190150867  deg
Searching objects in cone section... 
theta = 28.745175190150867 deg; v = [-983.0, 3017.0]
PKS J1225+1253: error! maybe can not identify from name
----
PKS J0747-3310
Query from name:  PKS J0747-3310
RA, Dec (deg)  :  116.83201 -33.17971
Redshift :  --
Velocity :  --
PKS J0747-3310 does not currently have any redshift measurements in NED.
Please provide your desired radial velocity or define a Metric Distance for the search center.
Radial velocity? 2000
PKS J0747-3310: error! maybe can not identify from name
----
PKS J1516+1932
Query from name:  PKS J1516+1932
RA, Dec (deg)  :  229.23665 19.53694
Redshift :  1.07
Velocity :  320778.0
Angular-diameter distance :  1722.9801220862478  Mpc
Angular radius for 7.5 Mpc seen from distance 1722.9801220862478 Mpc :  0.24940412303062362  deg
Searching objects in cone section... 
theta = 0.24940412303062362 deg; v = [318778.0, 322778.0]
----
PKS J0438+3004
Query from name:  PKS J0438+3004
PKS J0438+3004: error! maybe can not identify from name
----
PKS J2134-0153
Query from name:  PKS J2134-0153
RA, Dec (deg)  :  323.54296 -1.88812
Redshift :  1.285
Velocity :  385233.0
Angular-diameter distance :  1772.3854802599205  Mpc
Angular radius for 7.5 Mpc seen from distance 1772.3854802599205 Mpc :  0.2424519672126287  deg
Searching objects in cone section... 
theta = 0.2424519672126287 deg; v = [383233.0, 387233.0]
----
PKS J2226+0052
Query from name:  PKS J2226+0052
RA, Dec (deg)  :  336.6939 0.86981
Redshift :  2.249877
Velocity :  674496.0
Angular-diameter distance :  1741.4070377375724  Mpc
Angular radius for 7.5 Mpc seen from distance 1741.4070377375724 Mpc :  0.24676502221238603  deg
Searching objects in cone section... 
theta = 0.24676502221238603 deg; v = [672496.0, 676496.0]
----
PKS J0426+2327
Query from name:  PKS J0426+2327
PKS J0426+2327: error! maybe can not identify from name
----
PKS J1626-2951
Query from name:  PKS J1626-2951
RA, Dec (deg)  :  246.52509 -29.85749
Redshift :  0.815
Velocity :  244331.0
Angular-diameter distance :  1602.9924999664522  Mpc
Angular radius for 7.5 Mpc seen from distance 1602.9924999664522 Mpc :  0.2680725869628901  deg
Searching objects in cone section... 
theta = 0.2680725869628901 deg; v = [242331.0, 246331.0]
----
PKS J1058-8003
Query from name:  PKS J1058-8003
RA, Dec (deg)  :  164.68046 -80.06504
Redshift :  0.581
Velocity :  174179.0
Angular-diameter distance :  1398.6384248097584  Mpc
Angular radius for 7.5 Mpc seen from distance 1398.6384248097584 Mpc :  0.3072404838345317  deg
Searching objects in cone section... 
theta = 0.3072404838345317 deg; v = [172179.0, 176179.0]
----

In [ ]: