Example #1
0
def test4(keys):
    j = 0
    for time_actionid in [
            108583, '108583', [108583, 109754], ['108583', '109754']
    ]:
        print '\nRunning Test 4.' + str(
            j) + ': obj_id=bls, time_actionid=' + str(time_actionid)
        N = len(keys)
        for i, key in enumerate(keys):
            waitbar(i, N, extra=key)
            #    print key
            dic_astropy = ngtsio.get('NG0304-1115',
                                     'CYCLE1706', [key],
                                     obj_id='bls',
                                     time_actionid=time_actionid,
                                     fitsreader='astropy',
                                     silent=True)
            dic_fitsio = ngtsio.get('NG0304-1115',
                                    'CYCLE1706', [key],
                                    obj_id='bls',
                                    time_actionid=time_actionid,
                                    fitsreader='fitsio',
                                    silent=True)
            compare_dic(dic_astropy, dic_fitsio)
        print '\nTest 4.' + str(j) + ' succesful.'
        j += 1
Example #2
0
def test3(keys):
    j = 0
    for obj_id in [46, '046', [46, 11, 2], ['046', '11', '2']]:
        for time_date in [
                20151115, '2015-11-15', '2015/11/15',
            [20151115, 20151127, 20170101],
            ['2015-11-15', '2015-11-04', '2017-01-01']
        ]:
            print '\nRunning Test 3.' + str(j) + ': obj_id=' + str(
                obj_id) + ', time_date=' + str(time_date)
            N = len(keys)
            for i, key in enumerate(keys):
                waitbar(i, N, extra=key)
                #                    print key
                dic_astropy = ngtsio.get('NG0304-1115',
                                         'CYCLE1706', [key],
                                         obj_id=obj_id,
                                         time_date=time_date,
                                         fitsreader='astropy',
                                         silent=True)
                dic_fitsio = ngtsio.get('NG0304-1115',
                                        'CYCLE1706', [key],
                                        obj_id=obj_id,
                                        time_date=time_date,
                                        fitsreader='fitsio',
                                        silent=True)
                compare_dic(dic_astropy, dic_fitsio)
            print '\nTest 3.' + str(j) + ' succesful.'
            j += 1
Example #3
0
def test1(keys):
    print '\n'
    N = len(keys)
    for i,key in enumerate(keys):
        waitbar(i, N, extra=key)
    #    print key
        dic_astropy = ngtsio.get( 'NG0304-1115', 'CYCLE1706', [key], fitsreader='astropy', silent=True )
        dic_fitsio = ngtsio.get( 'NG0304-1115', 'CYCLE1706', [key], fitsreader='fitsio', silent=True )
        compare_dic(dic_astropy, dic_fitsio)
    print '\nTest 1 succesful.'
Example #4
0
def test4(keys):
    j = 0
    for time_actionid in [108583, '108583', [108583,109754], ['108583','109754']]:
        print '\nRunning Test 4.'+str(j)+': obj_id=bls, time_actionid='+str(time_actionid)
        N = len(keys)
        for i,key in enumerate(keys):
            waitbar(i, N, extra=key)
        #    print key
            dic_astropy = ngtsio.get( 'NG0304-1115', 'CYCLE1706', [key], obj_id='bls', time_actionid=time_actionid, fitsreader='astropy', silent=True )
            dic_fitsio = ngtsio.get( 'NG0304-1115', 'CYCLE1706', [key], obj_id='bls', time_actionid=time_actionid, fitsreader='fitsio', silent=True )
            compare_dic(dic_astropy, dic_fitsio)
        print '\nTest 4.'+str(j)+' succesful.'
        j += 1
Example #5
0
def test3(keys):
    j = 0
    for obj_id in [46, '046', [46,11,2], ['046','11','2']]:
        for time_date in [20151115, '2015-11-15', '2015/11/15', [20151115,20151127,20170101], ['2015-11-15','2015-11-04','2017-01-01']]:
            print '\nRunning Test 3.'+str(j)+': obj_id='+str(obj_id)+', time_date='+str(time_date)
            N = len(keys)
            for i,key in enumerate(keys):
                waitbar(i, N, extra=key)
#                    print key
                dic_astropy = ngtsio.get( 'NG0304-1115', 'CYCLE1706', [key], obj_id=obj_id, time_date=time_date, fitsreader='astropy', silent=True )
                dic_fitsio = ngtsio.get( 'NG0304-1115', 'CYCLE1706', [key], obj_id=obj_id, time_date=time_date, fitsreader='fitsio', silent=True )
                compare_dic(dic_astropy, dic_fitsio)
            print '\nTest 3.'+str(j)+' succesful.'
            j += 1
Example #6
0
def test2(keys):
    j = 0
    for obj_row in [100, '100', [100,102], ['100','102']]:
        for time_hjd in [700, '700', [700,702], ['700','702']]:
            print '\nRunning Test 2.'+str(j)
            N = len(keys)
            for i,key in enumerate(keys):
                waitbar(i, N, extra=key)
#                print key
                dic_astropy = ngtsio.get( 'NG0304-1115', 'CYCLE1706', [key], obj_row=obj_row, time_hjd=time_hjd, fitsreader='astropy', silent=True )
                dic_fitsio = ngtsio.get( 'NG0304-1115', 'CYCLE1706', [key], obj_row=obj_row, time_hjd=time_hjd, fitsreader='fitsio', silent=True )
                compare_dic(dic_astropy, dic_fitsio)
            print '\nTest 2-'+str(j)+' succesful.'
            j += 1
Example #7
0
def test1(keys):
    print '\n'
    N = len(keys)
    for i, key in enumerate(keys):
        waitbar(i, N, extra=key)
        #    print key
        dic_astropy = ngtsio.get('NG0304-1115',
                                 'CYCLE1706', [key],
                                 fitsreader='astropy',
                                 silent=True)
        dic_fitsio = ngtsio.get('NG0304-1115',
                                'CYCLE1706', [key],
                                fitsreader='fitsio',
                                silent=True)
        compare_dic(dic_astropy, dic_fitsio)
    print '\nTest 1 succesful.'
Example #8
0
def test2(keys):
    j = 0
    for obj_row in [100, '100', [100, 102], ['100', '102']]:
        for time_hjd in [700, '700', [700, 702], ['700', '702']]:
            print '\nRunning Test 2.' + str(j)
            N = len(keys)
            for i, key in enumerate(keys):
                waitbar(i, N, extra=key)
                #                print key
                dic_astropy = ngtsio.get('NG0304-1115',
                                         'CYCLE1706', [key],
                                         obj_row=obj_row,
                                         time_hjd=time_hjd,
                                         fitsreader='astropy',
                                         silent=True)
                dic_fitsio = ngtsio.get('NG0304-1115',
                                        'CYCLE1706', [key],
                                        obj_row=obj_row,
                                        time_hjd=time_hjd,
                                        fitsreader='fitsio',
                                        silent=True)
                compare_dic(dic_astropy, dic_fitsio)
            print '\nTest 2-' + str(j) + ' succesful.'
            j += 1
Example #9
0
Cavendish Laboratory,
JJ Thomson Avenue
Cambridge CB3 0HE
Email: [email protected]
"""



# Examples

import matplotlib.pyplot as plt
import ngtsio

# a) Get and plot the lightcurve for one object

dic = ngtsio.get( 'NG0304-1115', ['OBJ_ID','HJD','FLUX'], obj_id='00046' )
plt.figure()
plt.plot( dic['HJD'], dic['FLUX'], 'k.' )
plt.title( dic['OBJ_ID'] )

# b) Get and plot the mean locations of the first 100 listed objects on the CCD
#(note that 'CCD_X' denotes the mean location, while 'CCDX' is the location per exposure)

dic = ngtsio.get( 'NG0304-1115', ['CCD_X','CCD_Y'], obj_row=range(1,101) )
plt.figure()
plt.plot( dic['CCD_X'], dic['CCD_Y'], 'k.' )

# c) Get the BLS results of some candidates 
#(note that obj_id 11 is not a BLS candidate, and that obj_id 1337 does not exist at all)

dic = ngtsio.get( 'NG0304-1115', ['DEPTH','PERIOD','WIDTH'], obj_id=[11,46,49,54,1337] )
Example #10
0
 def test_fitsio():
     ngtsio.get('NG0304-1115', 'CYCLE1706', ['FLUX','CENTDX','CENTDY'], fitsreader='fitsio', obj_id=12118)
Example #11
0
 def test_fitsio_all():
     ngtsio.get('NG0304-1115', 'CYCLE1706', ['FLUX_MEAN','RA','DEC'], fitsreader='fitsio')
Example #12
0
 def test_fitsio():
     ngtsio.get('NG0304-1115',
                'CYCLE1706', ['FLUX', 'CENTDX', 'CENTDY'],
                fitsreader='fitsio',
                obj_id=12118)
Example #13
0
 def test_fitsio_all():
     ngtsio.get('NG0304-1115',
                'CYCLE1706', ['FLUX_MEAN', 'RA', 'DEC'],
                fitsreader='fitsio')