TwiceAsNice  2019-02-18
Public Member Functions | Public Attributes | List of all members
VizLN.AppWin Class Reference
Inheritance diagram for VizLN.AppWin:
Inheritance graph
Collaboration diagram for VizLN.AppWin:
Collaboration graph

Public Member Functions

def __init__ (self)
 
def initVar (self)
 
def initUI (self)
 
def startThread (self)
 
def stopThread (self)
 
def gotData (self, theTxt)
 
def loadSet (self)
 
def drawChart (self, cType, tScn)
 
def getBigPmap (self)
 
def drawNE (self, cType, tScn)
 
def drawElAz (self, cType, tScn)
 
def drawArrow (self, theScn, x1, y1, x2, y2, theCol, theFont, lbl, pos)
 
def drawRefStars (self, cType, tScn)
 
def skyMousePress (self, theText)
 
def sciMousePress (self, theText)
 
def GsxMousePress (self, theText)
 
def GdxMousePress (self, theText)
 
def HsxMousePress (self, theText)
 
def HdxMousePress (self, theText)
 
def PsxMousePress (self, theText)
 
def PdxMousePress (self, theText)
 
def bigMousePress (self, theText)
 
def shutdown (self)
 
def __init__ (self)
 
def initVar (self)
 
def initUI (self)
 
def startThread (self)
 
def stopThread (self)
 
def gotData (self, theTxt)
 
def loadSet (self)
 
def drawChart (self, cType, tScn)
 
def getBigPmap (self)
 
def drawNE (self, cType, tScn)
 
def drawElAz (self, cType, tScn)
 
def drawArrow (self, theScn, x1, y1, x2, y2, theCol, theFont, lbl, pos)
 
def drawRefStars (self, cType, tScn)
 
def skyMousePress (self, theText)
 
def sciMousePress (self, theText)
 
def GsxMousePress (self, theText)
 
def GdxMousePress (self, theText)
 
def HsxMousePress (self, theText)
 
def HdxMousePress (self, theText)
 
def PsxMousePress (self, theText)
 
def PdxMousePress (self, theText)
 
def bigMousePress (self, theText)
 
def shutdown (self)
 

Public Attributes

 gwsRad
 
 hwsRad
 
 sciFld
 
 bB
 
 cutOut
 
 gScl
 
 pScl
 
 sScl
 
 bBfactor
 
 whichBig
 
 usePNG
 
 pMap
 
 km
 
 small
 
 i
 
 DBG
 
 ui
 
 skyScn
 
 sciScn
 
 GsxScn
 
 GdxScn
 
 HsxScn
 
 HdxScn
 
 PsxScn
 
 PdxScn
 
 bigScn
 
 timTh
 
 par
 
 gsR
 
 gdR
 
 psR
 
 pdR
 
 scR
 
 rsk
 
 rgs
 
 rgd
 
 rps
 
 rpd
 
 rsc
 
 fitsSize
 
 pxScl
 
 skyFld
 
 iScl
 
 skyPIL
 
 gwsPIL
 
 pcmPIL
 
 sciPIL
 
 gPA
 

Detailed Description

    AppWin for VizLN

Constructor & Destructor Documentation

◆ __init__() [1/2]

def VizLN.AppWin.__init__ (   self)

◆ __init__() [2/2]

def VizLN.AppWin.__init__ (   self)

Member Function Documentation

◆ bigMousePress() [1/2]

def VizLN.AppWin.bigMousePress (   self,
  theText 
)

◆ bigMousePress() [2/2]

def VizLN.AppWin.bigMousePress (   self,
  theText 
)

◆ drawArrow() [1/2]

def VizLN.AppWin.drawArrow (   self,
  theScn,
  x1,
  y1,
  x2,
  y2,
  theCol,
  theFont,
  lbl,
  pos 
)
    Draws an arrow in the QGraphicsScene theScn, with colour theCol and
    font theFont from x1,y1 to x2,y2. Then place the label lbl at the
    location coded by pos.

◆ drawArrow() [2/2]

def VizLN.AppWin.drawArrow (   self,
  theScn,
  x1,
  y1,
  x2,
  y2,
  theCol,
  theFont,
  lbl,
  pos 
)
    Draws an arrow in the QGraphicsScene theScn, with colour theCol and
    font theFont from x1,y1 to x2,y2. Then place the label lbl at the
    location coded by pos.

◆ drawChart() [1/2]

def VizLN.AppWin.drawChart (   self,
  cType,
  tScn 
)
    Draws and annotates the specified type of chart (cType) in the 
    supplied graphicsscene (tScn). The variable cType is one of:

      cType = "Sky","Sci","Gsx","Gdx","Hsx","Hdx","Psx", or "Pdx"

    The variable tScn is one of:

      tScn = skyScn, sciScn, GsxScn, GdxScn, HsxScn, HdxScn, PsxScn, PdxScn, or bigScn

    The routine does the following:

       - clears tScn to prevent buildup of elements
       - adds the appropriate rotated / scaled PixMap
       - calls addArrows to add NE and Az/El arrows

    Depending on cType, the code also puts the following onscreen:

       - Circles and boxes (black) representing FoV of GWS, HWS, science
       - Circles for catalog stars (Green for GWS, Blue for HWS)
       - Shapes indicating pupils in the HWS Metapupil

    Note that if tScn is bigScn, the routine must check self.whichBig to
    determine what to do (self.whichBig takes on the same values as cType).

◆ drawChart() [2/2]

def VizLN.AppWin.drawChart (   self,
  cType,
  tScn 
)
    Draws and annotates the specified type of chart (cType) in the 
    supplied graphicsscene (tScn). The variable cType is one of:

      cType = "Sky","Sci","Gsx","Gdx","Hsx","Hdx","Psx", or "Pdx"

    The variable tScn is one of:

      tScn = skyScn, sciScn, GsxScn, GdxScn, HsxScn, HdxScn, PsxScn, PdxScn, or bigScn

    The routine does the following:

       - clears tScn to prevent buildup of elements
       - adds the appropriate rotated / scaled PixMap
       - calls addArrows to add NE and Az/El arrows

    Depending on cType, the code also puts the following onscreen:

       - Circles and boxes (black) representing FoV of GWS, HWS, science
       - Circles for catalog stars (Green for GWS, Blue for HWS)
       - Shapes indicating pupils in the HWS Metapupil

    Note that if tScn is bigScn, the routine must check self.whichBig to
    determine what to do (self.whichBig takes on the same values as cType).

◆ drawElAz() [1/2]

def VizLN.AppWin.drawElAz (   self,
  cType,
  tScn 
)
    Draws Elevation and Azimuth arrows in the specified chart type (cType, which
    can be "Sky","Sci","Gsx","Gdx","Hsx","Hdx","Psx", or "Pdx"). Note
    that this may target the Big window, so we have to check if tScn = self.bigScn.

    The routine simply calls the needed utility routines in LNA with vectors
    corresponding to El and Az, and then calls DrawArrow to do the honours.

    Note that we call Slit2Sky explicitly for the sky box, and that the "standard"
    meaning of NiA, and EiA actually correspond to El and Az, since we set are looking
    out the slit and use 0 deg and 270 deg to calculate.

◆ drawElAz() [2/2]

def VizLN.AppWin.drawElAz (   self,
  cType,
  tScn 
)
    Draws Elevation and Azimuth arrows in the specified chart type (cType, which
    can be "Sky","Sci","Gsx","Gdx","Hsx","Hdx","Psx", or "Pdx"). Note
    that this may target the Big window, so we have to check if tScn = self.bigScn.

    The routine simply calls the needed utility routines in LNA with vectors
    corresponding to El and Az, and then calls DrawArrow to do the honours.

    Note that we call Slit2Sky explicitly for the sky box, and that the "standard"
    meaning of NiA, and EiA actually correspond to El and Az, since we set are looking
    out the slit and use 0 deg and 270 deg to calculate.

◆ drawNE() [1/2]

def VizLN.AppWin.drawNE (   self,
  cType,
  tScn 
)
    Draws North and East arrows in the specified chart type (cType, which
    can be "Sky","Sci","Gsx","Gdx","Hsx","Hdx","Psx", or "Pdx"). Note
    that this may target the Big window, so we have to check if tScn = self.bigScn.

    The routine depends on the previous call to CalcAllSky with vectors corresponding
    to North and East, and then calls DrawArrow to do the honours

◆ drawNE() [2/2]

def VizLN.AppWin.drawNE (   self,
  cType,
  tScn 
)
    Draws North and East arrows in the specified chart type (cType, which
    can be "Sky","Sci","Gsx","Gdx","Hsx","Hdx","Psx", or "Pdx"). Note
    that this may target the Big window, so we have to check if tScn = self.bigScn.

    The routine depends on the previous call to CalcAllSky with vectors corresponding
    to North and East, and then calls DrawArrow to do the honours

◆ drawRefStars() [1/2]

def VizLN.AppWin.drawRefStars (   self,
  cType,
  tScn 
)
    Draw circles and labels for the reference stars. We (currently)
    only do this in the BIG window, so tScn will always be self.bigScn.

    The variable cType indicates what type of view we are dealing with.
    In this instance, cType = "Sky","Gsx","Gdx","Psx", or "Pdx" since
    the other views don't show reference stars (in focus).

    We use the arrays self.hNam, self.hPA, self.hSep for the HWS stars
    and self.gNam, self.gPA, self.gSep for the GWS. Note that we have
    self.NiA (GWS/input coord) and self.NpA (Pcam coord) as vectors
    which point North!

◆ drawRefStars() [2/2]

def VizLN.AppWin.drawRefStars (   self,
  cType,
  tScn 
)
    Draw circles and labels for the reference stars. We (currently)
    only do this in the BIG window, so tScn will always be self.bigScn.

    The variable cType indicates what type of view we are dealing with.
    In this instance, cType = "Sky","Gsx","Gdx","Psx", or "Pdx" since
    the other views don't show reference stars (in focus).

    We use the arrays self.hNam, self.hPA, self.hSep for the HWS stars
    and self.gNam, self.gPA, self.gSep for the GWS. Note that we have
    self.NiA (GWS/input coord) and self.NpA (Pcam coord) as vectors
    which point North!

◆ GdxMousePress() [1/2]

def VizLN.AppWin.GdxMousePress (   self,
  theText 
)

◆ GdxMousePress() [2/2]

def VizLN.AppWin.GdxMousePress (   self,
  theText 
)

◆ getBigPmap() [1/2]

def VizLN.AppWin.getBigPmap (   self)
    Convenience function to hide a lot of ugly... This is a brute-force
    routine with a lot of if statements to generate and return the appropriate
    PixMap for the big window. Due to problems with ImageQt, we may have to
    use a temporary, intermediate .png file to do this...

◆ getBigPmap() [2/2]

def VizLN.AppWin.getBigPmap (   self)
    Convenience function to hide a lot of ugly... This is a brute-force
    routine with a lot of if statements to generate and return the appropriate
    PixMap for the big window. Due to problems with ImageQt, we may have to
    use a temporary, intermediate .png file to do this...

◆ gotData() [1/2]

def VizLN.AppWin.gotData (   self,
  theTxt 
)
    The timing thread has emitted a signal, and we want to recalculate
    the display.

    The information comes back from the thread in a string (theTxt),
    encoded as follows:

    2016/11/24 1:08:25_18:16:08.72_129.34_030.23_140.56_145.23_279.21
    |                 |           |      |      |      |      |      |
       Date and UTC     Sid.Time   ParAng   Gsx    Ksx    Gdx    Kdx

    Note that, given the nature of the displays, we only really use the
    parallactic angle and the K-mirror angle (the GWS instrument control
    GUI does not rotate the view with bearing angle).

    We rotate the PIL images and render QPixmaps for display here...

◆ gotData() [2/2]

def VizLN.AppWin.gotData (   self,
  theTxt 
)
    The timing thread has emitted a signal, and we want to recalculate
    the display.

    The information comes back from the thread in a string (theTxt),
    encoded as follows:

    2016/11/24 1:08:25_18:16:08.72_129.34_030.23_140.56_145.23_279.21
    |                 |           |      |      |      |      |      |
       Date and UTC     Sid.Time   ParAng   Gsx    Ksx    Gdx    Kdx

    Note that, given the nature of the displays, we only really use the
    parallactic angle and the K-mirror angle (the GWS instrument control
    GUI does not rotate the view with bearing angle).

    We rotate the PIL images and render QPixmaps for display here...

◆ GsxMousePress() [1/2]

def VizLN.AppWin.GsxMousePress (   self,
  theText 
)

◆ GsxMousePress() [2/2]

def VizLN.AppWin.GsxMousePress (   self,
  theText 
)

◆ HdxMousePress() [1/2]

def VizLN.AppWin.HdxMousePress (   self,
  theText 
)

◆ HdxMousePress() [2/2]

def VizLN.AppWin.HdxMousePress (   self,
  theText 
)

◆ HsxMousePress() [1/2]

def VizLN.AppWin.HsxMousePress (   self,
  theText 
)

◆ HsxMousePress() [2/2]

def VizLN.AppWin.HsxMousePress (   self,
  theText 
)

◆ initUI() [1/2]

def VizLN.AppWin.initUI (   self)
Initializes the GUI, especially attaching widgets to routines 

◆ initUI() [2/2]

def VizLN.AppWin.initUI (   self)
Initializes the GUI, especially attaching widgets to routines 

◆ initVar() [1/2]

def VizLN.AppWin.initVar (   self)
Initializes important variables 

◆ initVar() [2/2]

def VizLN.AppWin.initVar (   self)
Initializes important variables 

◆ loadSet() [1/2]

def VizLN.AppWin.loadSet (   self)
    Loads a catalog / finder chart / FITS file set. The default
    behaviour is to use the FITS file to generate Pixmaps for the
    various views. If the FITS file is not present, the program
    fetches it (thanks to code from ChartMaker).

    The routine makes multiple PIL images tailored to each type of
    display. For example, the GWS and PCam images have to be
    y-flipped to reverse the "parity" of the image. It also
    produces smaller images for the smaller units (i.e. science).

    We use the superior interpolation of PIL compared to previous
    versions, which used genPixMap and QPixmaps. This routine
    produces:

self.skyPIL - Full sky image in normal orientation
self.gwsPIL - Cropped and Y-flipped
self.pcmPIL - Cropped and Y-flipped
self.sciPIL - Cropped only

    PIL has the additional virtue of NOT scaling the result after
    rotation (a big headache otherwise). Instead, it offers a flag
    to expand (or not) the image.

    Note: The catalog and FITS files must have the same file root,
  and the catalog must be .cat and the FITS file .fits. The
  FITS file should be in the sub-folder FITS of the catalog's
  folder (standard Com-4 organization).

    NOTE: The program assumes North is up and East to the left!

◆ loadSet() [2/2]

def VizLN.AppWin.loadSet (   self)
    Loads a catalog / finder chart / FITS file set. The default
    behaviour is to use the FITS file to generate Pixmaps for the
    various views. If the FITS file is not present, the program
    fetches it (thanks to code from ChartMaker).

    The routine makes multiple PIL images tailored to each type of
    display. For example, the GWS and PCam images have to be
    y-flipped to reverse the "parity" of the image. It also
    produces smaller images for the smaller units (i.e. science).

    We use the superior interpolation of PIL compared to previous
    versions, which used genPixMap and QPixmaps. This routine
    produces:

self.skyPIL - Full sky image in normal orientation
self.gwsPIL - Cropped and Y-flipped
self.pcmPIL - Cropped and Y-flipped
self.sciPIL - Cropped only

    PIL has the additional virtue of NOT scaling the result after
    rotation (a big headache otherwise). Instead, it offers a flag
    to expand (or not) the image.

    Note: The catalog and FITS files must have the same file root,
  and the catalog must be .cat and the FITS file .fits. The
  FITS file should be in the sub-folder FITS of the catalog's
  folder (standard Com-4 organization).

    NOTE: The program assumes North is up and East to the left!

◆ PdxMousePress() [1/2]

def VizLN.AppWin.PdxMousePress (   self,
  theText 
)

◆ PdxMousePress() [2/2]

def VizLN.AppWin.PdxMousePress (   self,
  theText 
)

◆ PsxMousePress() [1/2]

def VizLN.AppWin.PsxMousePress (   self,
  theText 
)

◆ PsxMousePress() [2/2]

def VizLN.AppWin.PsxMousePress (   self,
  theText 
)

◆ sciMousePress() [1/2]

def VizLN.AppWin.sciMousePress (   self,
  theText 
)

◆ sciMousePress() [2/2]

def VizLN.AppWin.sciMousePress (   self,
  theText 
)

◆ shutdown() [1/2]

def VizLN.AppWin.shutdown (   self)

◆ shutdown() [2/2]

def VizLN.AppWin.shutdown (   self)

◆ skyMousePress() [1/2]

def VizLN.AppWin.skyMousePress (   self,
  theText 
)

◆ skyMousePress() [2/2]

def VizLN.AppWin.skyMousePress (   self,
  theText 
)

◆ startThread() [1/2]

def VizLN.AppWin.startThread (   self)
    Launch QThread which regularly samples parallactic angle, K-mirror angle,
    GWS bearing angle etc. We send self.DBG to indicate Debug/offline mode.

◆ startThread() [2/2]

def VizLN.AppWin.startThread (   self)
    Launch QThread which regularly samples parallactic angle, K-mirror angle,
    GWS bearing angle etc. We send self.DBG to indicate Debug/offline mode.

◆ stopThread() [1/2]

def VizLN.AppWin.stopThread (   self)

◆ stopThread() [2/2]

def VizLN.AppWin.stopThread (   self)

Member Data Documentation

◆ bB

VizLN.AppWin.bB

◆ bBfactor

VizLN.AppWin.bBfactor

◆ bigScn

VizLN.AppWin.bigScn

◆ cutOut

VizLN.AppWin.cutOut

◆ DBG

VizLN.AppWin.DBG

◆ fitsSize

VizLN.AppWin.fitsSize

◆ gdR

VizLN.AppWin.gdR

◆ GdxScn

VizLN.AppWin.GdxScn

◆ gPA

VizLN.AppWin.gPA

◆ gScl

VizLN.AppWin.gScl

◆ gsR

VizLN.AppWin.gsR

◆ GsxScn

VizLN.AppWin.GsxScn

◆ gwsPIL

VizLN.AppWin.gwsPIL

◆ gwsRad

VizLN.AppWin.gwsRad

◆ HdxScn

VizLN.AppWin.HdxScn

◆ HsxScn

VizLN.AppWin.HsxScn

◆ hwsRad

VizLN.AppWin.hwsRad

◆ i

VizLN.AppWin.i

◆ iScl

VizLN.AppWin.iScl

◆ km

VizLN.AppWin.km

◆ par

VizLN.AppWin.par

◆ pcmPIL

VizLN.AppWin.pcmPIL

◆ pdR

VizLN.AppWin.pdR

◆ PdxScn

VizLN.AppWin.PdxScn

◆ pMap

VizLN.AppWin.pMap

◆ pScl

VizLN.AppWin.pScl

◆ psR

VizLN.AppWin.psR

◆ PsxScn

VizLN.AppWin.PsxScn

◆ pxScl

VizLN.AppWin.pxScl

◆ rgd

VizLN.AppWin.rgd

◆ rgs

VizLN.AppWin.rgs

◆ rpd

VizLN.AppWin.rpd

◆ rps

VizLN.AppWin.rps

◆ rsc

VizLN.AppWin.rsc

◆ rsk

VizLN.AppWin.rsk

◆ sciFld

VizLN.AppWin.sciFld

◆ sciPIL

VizLN.AppWin.sciPIL

◆ sciScn

VizLN.AppWin.sciScn

◆ scR

VizLN.AppWin.scR

◆ skyFld

VizLN.AppWin.skyFld

◆ skyPIL

VizLN.AppWin.skyPIL

◆ skyScn

VizLN.AppWin.skyScn

◆ small

VizLN.AppWin.small

◆ sScl

VizLN.AppWin.sScl

◆ timTh

VizLN.AppWin.timTh

◆ ui

VizLN.AppWin.ui

◆ usePNG

VizLN.AppWin.usePNG

◆ whichBig

VizLN.AppWin.whichBig

The documentation for this class was generated from the following file: