예제 #1
0
파일: displayable.py 프로젝트: R136a1-/MOP
    def show_image(self, colorbar=False):
        # start xpans if needed
        ds9.ds9_xpans()
        # start ds9 if need, or connect to existing
        display = ds9.ds9(target='validate')
        if self.frame_number is None:
            # display.set('frame delete all')
            display.set('frame new')
            display.set('scale zscale')
            display.set('cmap invert yes')
            f = StringIO()
            self.hdulist.writeto(f)
            f.flush()
            f.seek(0)
            hdulist = fits.open(f)
            for hdu in hdulist:
                del(hdu.header['PV*'])
            display.set_pyfits(hdulist)
            self.frame_number = display.get('frame frameno')
            display.set('frame center {}'.format(self.frame_number))
            display.set('zoom to fit')
            display.set('wcs align yes')
        display.set('frame frameno {}'.format(self.frame_number))

        self._interaction_context = InteractionContext(self)

        self.number_of_images_displayed += 1
예제 #2
0
    def show_image(self, colorbar=False):
        # start xpans if needed
        ds9.ds9_xpans()
        # start ds9 if need, or connect to existing
        display = ds9.ds9(target='validate')
        if self.frame_number is None:
            # display.set('frame delete all')
            display.set('frame new')
            display.set('scale zscale')
            display.set('cmap invert yes')
            f = StringIO()
            self.hdulist.writeto(f)
            f.flush()
            f.seek(0)
            hdulist = fits.open(f)
            for hdu in hdulist:
                del(hdu.header['PV*'])
            display.set_pyfits(hdulist)
            f.close()
            del(hdulist)
            self.frame_number = display.get('frame frameno')
            display.set('frame center {}'.format(self.frame_number))
            display.set('zoom to fit')
            display.set('wcs align yes')
        display.set('frame frameno {}'.format(self.frame_number))

        self._interaction_context = InteractionContext(self)

        self.number_of_images_displayed += 1
예제 #3
0
#!/usr/bin/env python

import numpy
import os
import sys
import time
import scipy, scipy.spatial

sys.path.append("../")

import astropy.io.fits

# Import ds9 and start XPA name-server
import ds9 as pyds9
pyds9.ds9_xpans()

import podi_asteroidmetry
from podi_definitions import *

if __name__ == "__main__":

    filename = sys.argv[1]
    # pyds9.ds9.openlist()

    ds9 = pyds9.ds9(target="mpcexamine",
                    start="-scale zscale -scale scope global -file %s" %
                    (filename),
                    wait=25)

    hdulist = None
    target_name = "??????"
예제 #4
0
import scipy.stats
import math
import scipy.spatial
import itertools

sys.path.append("../")

from  podi_definitions import *
import podi_search_ipprefcat
import podi_wcs


import time

import ds9
ds9.ds9_xpans()


def fudge_wcs(input_file, ds9, output_file, target_coords):


#    ds9.set("file "+input_file)
    hdulist = pyfits.open(input_file)

  
#    ds9.set_pyfits(hdulist[extension])
#    ds9.set_np2arr(hdulist[extension].data)
    ds9.set("mosaicimage iraf "+input_file)
#    ds9.set("multiframe "+input_file)

    coords = ds9.get("imexam coordinate image")