Ejemplo n.º 1
0
def main():
    alert_ids = GenerateCameraAlertStream(alert_num=1)
    alert_id = alert_ids[0]

    alert = ConstructAlertFromID(alert_id, 'E')
    print(alert)

    ## Create a replica with an associated astro object.
    replica_id1 = alert.createReplica(astro_id=17249)
    print('Created replica {0}'.format(replica_id1))
    ## Construct replica object given ID
    replica1 = ConstructAlertFromID(replica_id1, 'R')
    print(replica1)

    ## Create another replica without an associated astro object.
    replica_id2 = alert.createReplica()
    print('Created replica {0}'.format(replica_id2))

    ## Construct replica object given ID
    replica2 = ConstructAlertFromID(replica_id2, 'R')
    replica2.commit()
    print(replica2)
def main():
    alert_ids = GenerateCameraAlertStream( alert_num=1 )
    alert_id = alert_ids[ 0 ]

    alert = ConstructAlertFromID( alert_id, 'E' )
    print( alert )

    ## Create a replica with an associated astro object.
    replica_id = alert.createReplica( astro_id=17249 )
    print( 'Created replica {0}'.format(replica_id) )
    ## Construct replica object given ID
    replica = ConstructAlertFromID( replica_id, 'R' )
    #print( replica )

    # ## Create another replica from the current replica
    # replica_replica_id = replica.createReplica()
    # print( 'Created replica {0}'.format(replica_replica_id) )

    # ## Construct replica object given ID
    # replica = ConstructAlertFromID( replica_replica_id, 'R' )
    # print( replica )

    parents = []
    for i in range(0, 4):
        replica_replica_id = replica.createReplica()
        #print( replica.parent.__repr__() )
        parents.append( replica.parent )
        print( 'Replica ID: ', replica_replica_id )
        ## Construct replica object given ID
        replica = ConstructAlertFromID( replica_replica_id, 'R' )
        #print( replica )

    if parents[0] == parents[1]:
        print( 'Same object' )
    else:
        print( 'Different object' )
Ejemplo n.º 3
0
def main():
    alert_ids = GenerateCameraAlertStream( alert_num=1 )
    alert_id = alert_ids[ 0 ]

    alert = ConstructAlertFromID( alert_id, 'E' )
    print( alert )

    ## Create a replica with an associated astro object.
    replica_id1 = alert.createReplica( astro_id=17249 )
    print( 'Created replica {0}'.format(replica_id1) )
    ## Construct replica object given ID
    replica1 = ConstructAlertFromID( replica_id1, 'R', alert )
    replica1.mark_as_rare( 'Replica1 is rare' )

    ## Create another replica without an associated astro object.
    replica_id2 = alert.createReplica()
    print( 'Created replica {0}'.format(replica_id2) )

    ## Construct replica object given ID
    replica2 = ConstructAlertFromID( replica_id2, 'R', alert )
    replica2.mark_as_rare( 'Replica2 is rare' )

    #print( alert.get_annotation() )
    print( alert.annotation )
Ejemplo n.º 4
0
def main():
    alert_ids = GenerateCameraAlertStream(alert_num=1)
    alert_id = alert_ids[0]

    alert = ConstructAlertFromID(alert_id, 'E')
    print(alert)

    ## Create a replica with an associated astro object.
    replica_id1 = alert.createReplica(astro_id=17249)
    print('Created replica {0}'.format(replica_id1))
    ## Construct replica object given ID
    replica1 = ConstructAlertFromID(replica_id1, 'R', alert)
    replica1.mark_as_rare('Replica1 is rare')

    ## Create another replica without an associated astro object.
    replica_id2 = alert.createReplica()
    print('Created replica {0}'.format(replica_id2))

    ## Construct replica object given ID
    replica2 = ConstructAlertFromID(replica_id2, 'R', alert)
    replica2.mark_as_rare('Replica2 is rare')

    #print( alert.get_annotation() )
    print(alert.annotation)
        vals       = lightcurve.values # ndarray
        stdev      = np.std( vals )

    return stdev


if __name__ == '__main__':
    sys.path.append( '../' )
    from antares.helper import GenerateFakeAlerts
    from antares.helper import ConstructAlertFromID

    ## Construct a camera alert.
    alert_ids = GenerateFakeAlerts()
    alert_id = alert_ids[ 1 ]
    alert = ConstructAlertFromID( alert_id, 'E' )

    replica_id = alert.createReplica()
    print( 'Created replica {0}'.format(replica_id) )

    ## Construct replica object given ID
    replica = ConstructAlertFromID( replica_id, 'R' )

    replica.CA.P.value = derivePeriod( replica )
    replica.CA.A.value = deriveAmplitude( replica )
    replica.CA.mmed.value = deriveMmed( replica )
    replica.CA.kurt.value = deriveKurt( replica )
    replica.CA.stdev.value = deriveStdev( replica )

    print( 'Replica {0} of camera alert {1}'.format(replica.ID, replica.parent.ID) )
    print( replica.CA.P.value, replica.CA.A.value, replica.CA.mmed.value, replica.CA.stdev.value, replica.CA.kurt.value )