예제 #1
0
import glob
import numpy as np
import star
import sys
psfstars = star.readmancat(psfstarcat)
# We read the region files

for i, s in enumerate(psfstars):

    s.filenumber = (i + 1)
    possiblemaskfilepath = os.path.join(configdir,
                                        "%s_mask_%s.reg" % (psfkey, s.name))
    if os.path.exists(possiblemaskfilepath):

        s.reg = ds9reg.regions(
            128,
            128)  # hardcoded for now # THIS IS BAD MALTE, THIS IS BAD !!!!!
        s.reg.readds9(possiblemaskfilepath, verbose=False)
        s.reg.buildmask(verbose=False)

        print "You masked %i pixels of star %s." % (np.sum(s.reg.mask), s.name)
    else:
        print "No mask file for star %s." % (s.name)

#proquest(askquestions)

# Select images to treat
db = KirbyBase()

if thisisatest:
    print "This is a test run."
예제 #2
0
    usedpsfkey = "psf_" + image[deckeypsfused]
    cosmicslistpath = os.path.join(workdir, usedpsfkey, image['imgname'],
                                   "cosmicslist.pkl")
    if os.path.exists(cosmicslistpath):
        psfcosmicslist = readpickle(cosmicslistpath, verbose=False)
    else:
        psfcosmicslist = []

    # To get the number of cosmics is easier ...
    #psfcosmicskey = usedpsfkey + "_cosmics"
    #npsfcosmics = image[psfcosmicskey]
    npsfcosmics = 0

    # And the masked regions :
    ds9regfilepath = os.path.join(configdir, usedpsfkey + "_mask.reg")
    psfmaskreg = ds9reg.regions(128, 128)  # hardcoded for now ...
    if os.path.exists(ds9regfilepath):
        psfmaskreg.readds9(ds9regfilepath, verbose=False)

    ##########################################
    # PREPARING THE PLOTS
    ##########################################

    lookback_fct.posplotbydate(images,
                               image,
                               deckey,
                               ptsrc,
                               os.path.join(destdir, "overview.png"),
                               maglims=None)
    #posplotbyimg(images, nightlims, image, deckey, ptsrc, os.path.join(destdir,"zoom.png"), maglims = lookbackzoomgraphmaglims)
    lookback_fct.posplotbyimg(images,
import star
psfstars = star.readmancat(psfstarcat)
# We read the region files

for i, s in enumerate(psfstars):
	print '---------------PSF STAR------------------'
	print s.name
	print '-----------------------------------------'

	
	s.filenumber = (i+1)
	possiblemaskfilepath = os.path.join(configdir, "%s_mask_%s.reg" % (psfkey, s.name))
	print 'mask file path is: ',possiblemaskfilepath
	if os.path.exists(possiblemaskfilepath):
		
		s.reg = ds9reg.regions(64, 64) # hardcoded for now # Warning, can cause a lot of trouble when dealing with images other than ECAM
		s.reg.readds9(possiblemaskfilepath, verbose=False)
		s.reg.buildmask(verbose = False)
		
		print "You masked %i pixels of star %s." % (np.sum(s.reg.mask), s.name)
	else:
		print "No mask file for star %s." % (s.name)

if not update:
	proquest(askquestions)
		

# Select images to treat
db = KirbyBase()

예제 #4
0
import star
import ds9reg

pngdir = os.path.join(workdir, psfkey + "_png")
psfstars = star.readmancat(psfstarcat)
nbrpsf = len(psfstars)

# We read the mask files :
for i, s in enumerate(psfstars):

    s.filenumber = (i + 1)
    possiblemaskfilepath = os.path.join(configdir,
                                        "%s_mask_%s.reg" % (psfkey, s.name))
    if os.path.exists(possiblemaskfilepath):

        s.reg = ds9reg.regions(64, 64)  # hardcoded for now ...
        s.reg.readds9(possiblemaskfilepath, verbose=False)
        s.reg.buildmask(verbose=False)

        # print "You masked %i pixels of star %s." % (np.sum(s.reg.mask), s.name)
    else:
        # print "No mask file for star %s." % (s.name)
        pass

db = KirbyBase()

if thisisatest:
    print "This is a test run."
    images = db.select(imgdb, ['gogogo', 'treatme', 'testlist', psfkeyflag],
                       [True, True, True, True],
                       returnType='dict',