当前位置: 首页>>代码示例>>Python>>正文


Python AstroData.infostr方法代码示例

本文整理汇总了Python中astrodata.AstroData.infostr方法的典型用法代码示例。如果您正苦于以下问题:Python AstroData.infostr方法的具体用法?Python AstroData.infostr怎么用?Python AstroData.infostr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在astrodata.AstroData的用法示例。


在下文中一共展示了AstroData.infostr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runinsert

# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import infostr [as 别名]
def runinsert(index=None, f1=None, f2=None, auto=False):
    ad = AstroData(f1)
    md = AstroData(f2)
    pstr = "\n\n             >>>>>>>     AD     <<<<<<<<\n"
    pstr += str(ad.infostr())
    pstr += "\n\n             >>>>>>>    AD APPEND   <<<<<<<<\n"
    pstr += str(md.infostr())
    ad.insert(index=index, moredata=md, auto_number=auto)
    pstr +="\n\n             >>>>>>>  NEW AD <<<<<<<<\n"
    pstr += str(ad.infostr())
    print(pstr)
    return ad
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:14,代码来源:testutil.py

示例2: do_GET

# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import infostr [as 别名]

#.........这里部分代码省略.........
                    try:
                        f = open(tfile)
                    except:
                        return
                    self.send_response(200)
                    self.send_header('Content-type', 'image/png')
                    self.end_headers()

                    while True:
                        t = f.read(102400)
                        if t == "":
                            self.wfile.flush()
                            break
                        self.wfile.write(t)
                return

            if self.path.startswith("/fullheader"):
                realpath = self.path.split('/')
                realpath = realpath[1:]
                
                dirdict = self.getDirdict()
                print "prsw514:", repr(realpath)
                
                name = realpath[-1]
                fname = dirdict.get_full_path(name)
                ad = AstroData(fname)

                self.send_response(200)
                self.send_header('Content-type', 'text/html')
                self.end_headers()
        
                self.wfile.write("<html><body>\n")
                self.wfile.write('<h2>%s</h2>\n' % name)
                self.wfile.write(ad.infostr(as_html=True))
                alld = ad.all_descriptors()
                self.wfile.write(
                        """
                        <table cellspacing="2px">
                        <COLGROUP align="right" />
                        <COLGROUP align="left" />
                        <thead>
                        <tr>
                        <td style="background-color:grey">Descriptor</td>
                        <td style="background-color:grey">Value</td>
                        </tr>
                        </thead>
                        """)
                alldkeys = alld.keys()
                alldkeys.sort()
                for dname in alldkeys:
                    
                    if type(alld[dname]) == str and "ERROR" in alld[dname]:
                        redval = '<span  style="color:red">'+str(alld[dname])+"</span>"
                        dval = redval
                    else:
                        # print "ppw864:",type(alld[dname])
                        if not alld[dname].collapse_value():
                            import pprint
                            dval = """<pre>%s</pre> """ \
                                   % pprint.pformat(alld[dname].dict_val, indent=4, width=80)
                        else:
                            dval = str(alld[dname])
                    self.wfile.write("""
                        <tr>
                        <td style="text-align:right;border-bottom:solid grey 1px">
                        %(dname)s =
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:70,代码来源:prsproxyweb.py

示例3: AstroData

# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import infostr [as 别名]
from astrodata import AstroData
from astrodata.structuredslice import pixel_exts,bintable_exts

# some files for tests, of === the one used
ffile = "../../../../test_data/gmosspect/gsN20011222S027.fits"
od = "../../../../test_data/gndeploy1/N20110826S0336.fits"
of = nf = "../../../../test_data/multibins.fits"


od = AstroData(of) #original od
print od.infostr()


pixad = od[pixel_exts]
print pixad.infostr()

binad = od[bintable_exts]
print binad.infostr()

print od.gain()
for ext in od:
    try:
        print "<<"*20
        print "gain", ext.gain()
        
        print ">>"*20
    except:
        print "failed on "
        print ext.infostr()
        raise
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:32,代码来源:tstructures.py


注:本文中的astrodata.AstroData.infostr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。