Example #1
0
targetSet = lya.TargetSet()
numTargetsRead = lya.TargetSet.readTargetSet(targetSet, opts.input)

otherTargetSet = lya.TargetSet()
otherTargetsRead = lya.TargetSet.readTargetSet(otherTargetSet, opts.jnput)
camera = lya.BLUE_CAMERA

targetmap = {}
force = False

if (not os.path.isfile("targetmap.p")) or force:
    for target in targetSet:
        if int(target()[0]) >= 6307:
            continue    

        myspec = lya.spec(finder.spec(target))

        numExposures = myspec.getNumExposures()
        spectroflux = myspec.spAll('SPECTROFLUX')
        ra = myspec.spAll('PLUG_RA')
        dec = myspec.spAll('PLUG_DEC')

        # myrun = myspec.spAll('RUN')
        # myrerun = myspec.spAll('RERUN')
        # mycamcol = myspec.spAll('CAMCOL')
        # myfield = myspec.spAll('FIELD')
        # myid = myspec.spAll('ID')

        print len(otherTargetSet.targets)
        for other in otherTargetSet:
            otherspec = lya.spec(dr8finder.spec(other))
Example #2
0
camera = lya.BLUE_CAMERA

# loop over targets
for target in targetSet:
    # Open this target's combined spectrum file.
    # if finder.spPlate(target) != plateFile:
    #     plateFile = finder.spPlate(target)
    #     myPlate = spPlate(plateFile)
    #     numPlatesOpened += 1
    # frameIDs = myPlate.getFrameIDs(target.getFiber(),camera)
    # for exposure in range(0,len(frameIDs)):
    #     print frameIDs[exposure],
    # print

    myspec = lya.spec(finder.spec(target))
    numExposures = myspec.getNumExposures()
    psfmag = myspec.spAll('PSFMAG')
    spectroflux = myspec.spAll('SPECTROFLUX')

    # spectromag = 22.5 - 2.5*np.log10(spectroflux)

    # myobjid = int(myspec.spAll('OBJID'))

    # print int(bin(myobjid)[-48:-32],2), int(bin(myobjid)[-59:-48],2), int(bin(myobjid)[-32:-29],2), int(bin(myobjid)[-28:-16],2), int(bin(myobjid)[-16:],2)

    myrun = myspec.spAll('RUN')
    myrerun = myspec.spAll('RERUN')
    mycamcol = myspec.spAll('CAMCOL')
    myfield = myspec.spAll('FIELD')
    myid = myspec.spAll('ID')