Exemple #1
0
def ObsVsFitPlot(dirin,simdir=None,**kw):
    if simdir is None:
        simdir=dirin
    obsfilename=oofcol.getpar(dirin,"fitinfo.fits","obsfilename")
    x1,y1=vectorise(obsfilename)
    x2,y2=vectorise(os.path.join(simdir,"simds.fits"))
    diff(None,y1,y2,
         os.path.join(dirin,"plots","obsvsfit.eps"),
         xlabel=r"$t$",
         ylabel=r"$f_\nu$",
         **kw
         )
Exemple #2
0
def MkGBTSfcDir(dirin, fnameout):

    "Make a GBT surface correction file from a OOF reduction output dir"

    """
    dirin is a directory where the output of OOF reduction is stored.
    """

    import oofreduce
    import oofcol

    # If the offset file exists than that is almost certainly the one
    # to use
    if os.access( os.path.join( dirin , "offsetpars.fits") , os.F_OK):
        fnamein=os.path.join( dirin , "offsetpars.fits" )
    else:
        fnamein=os.path.join( dirin , "fitpars.fits" )

    obsdsfname=  oofcol.getpar(dirin,  "fitinfo.fits", "obsfilename")
    wavel=oofreduce.GetObsWaveL(obsdsfname)

    MkGBTSfcFile( fnamein, fnameout, wavel)
Exemple #3
0
 def GetZP(parname):
     return oofcol.getpar(thisdir,
                   "offsetpars.fits",
                   parname,
                   parcol="ParName",
                   valcol="ParValue")
Exemple #4
0
def ObsVsFitGen(dirin):
    obsfilename=oofcol.getpar(dirin,"fitinfo.fits","obsfilename")
    oofreduce.genSimFile(os.path.join(dirin,"fitbeams.fits"),
                         obsfilename,
                         os.path.join(dirin,"simds.fits"), 
                         1,2)
Exemple #5
0
def PlotDir(dirnamein,
            bbox=None,
            hardcopy=False,
            odir="plots",
            fwhm=None, 
            extent=None,
            npix=None,
            ncont=None,
            decorate=True,
            obsdir=None,
            umicron=False):

    "Make all the relevant plots"

    """

    If( hardcopy) make hardcopy friendly plots

    if obsdir is set look for observed data sets here

    """
    if obsdir != None:
        rname=        obsdsfname=  oofcol.getpar(dirnamein,  "fitinfo.fits", "obsfilename")
        obsdsfname=  os.path.join( obsdir, os.path.basename(rname))
    else:
        obsdsfname=  oofcol.getpar(dirnamein,  "fitinfo.fits", "obsfilename")
        
    npix= npix or int(oofcol.getpar(dirnamein,  "fitinfo.fits", "npix") )
    oversample= float( oofcol.getpar(dirnamein,  "fitinfo.fits", "oversample") )
    fwhm=fwhm or float(oofcol.getpar(dirnamein,  "fitinfo.fits", "ds_fwhm") )
    extent=extent or float(oofcol.getpar(dirnamein,  "fitinfo.fits", "ds_extent") )

    PlotDSFile( obsdsfname,
                os.path.join(dirnamein, odir),
                prefix="obsbeam",
                oversample= oversample,
                npix=npix,
                fwhm=fwhm,
                extent=extent,
                bbox=bbox,
                ncont=ncont,
                hardcopy=hardcopy,
                decorate=decorate)

    PlotSimDrizzleBeams( obsdsfname,
                         os.path.join(dirnamein, "fitbeams.fits"),
                         os.path.join(dirnamein, odir),
                         prefix="bestfitbeams",
                         bbox=bbox,
                         fwhm=fwhm,
                         extent=extent,
                         npix=npix,
                         oversample=oversample,
                         ncont=ncont,
                         hardcopy=hardcopy,
                         decorate=decorate)

    PlotSimDrizzleBeams( obsdsfname,
                         os.path.join(dirnamein, "perfectbeams.fits"),
                         os.path.join(dirnamein, odir),
                         prefix="perfectbeams",
                         bbox=bbox,
                         fwhm=fwhm,
                         extent=extent,
                         npix=npix,
                         oversample=oversample,
                         ncont=ncont,
                         hardcopy=hardcopy,
                         decorate=decorate)

    PlotAperture(os.path.join(dirnamein, "aperture-notilt.fits"),
                 os.path.join(dirnamein, odir),
                 oversample=oversample,
                 hardcopy=hardcopy,
                 umicron=umicron)

    if os.access( os.path.join(dirnamein, "offsetbeams.fits"),
                  os.F_OK):
        PlotSimDrizzleBeams( obsdsfname,
                             os.path.join(dirnamein, "offsetbeams.fits"),
                             os.path.join(dirnamein, odir),
                             prefix="offsetbeams",
                             bbox=bbox,
                             fwhm=fwhm,
                             extent=extent,
                             npix=npix,
                             oversample=oversample,
                             ncont=ncont,
                             hardcopy=hardcopy,
                             decorate=decorate)

        PlotAperture( os.path.join(dirnamein, "aperture-offset.fits"),
                      os.path.join(dirnamein, odir),
                      oversample=oversample,
                      prefix="offsetaperture",
                      hardcopy=hardcopy,
                      umicron=umicron)