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


Python AstroData.data_label方法代码示例

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


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

示例1: AstroData

# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import data_label [as 别名]
import sys
sys.path.append("/opt/gemini_python")
from astrodata import AstroData
import urllib2, urllib

# This is a GMOS_N imaging science dataset
ad = AstroData("/home/callen/SVN-AD/gemini_python/test_data/calsearch/N20110531S0114.fits")

desc_dict = {'instrument':ad.instrument().for_db(),
             'observation_type': ad.observation_type().for_db(),
             'data_label':ad.data_label().for_db(),
             'detector_x_bin':ad.detector_x_bin().for_db(),
             'detector_y_bin':ad.detector_y_bin().for_db(),
             'read_speed_setting':ad.read_speed_setting().for_db(),
             'gain_setting':ad.gain_setting().for_db(),
             'amp_read_area':ad.amp_read_area().for_db(),
             'ut_datetime':ad.ut_datetime().for_db(),
             'exposure_time':ad.exposure_time().for_db(),
             'object': ad.object().for_db(),
             'filter_name':ad.filter_name().for_db(),
             'focal_plane_mask':ad.focal_plane_mask().for_db(),
             }

print repr(desc_dict)
type_list = ad.types
ad.close()

sequence = [('descriptors', desc_dict), ('types', type_list)]
postdata = urllib.urlencode(sequence)

#postdata = urllib.urlencode({"hello":1.})
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:33,代码来源:header_cal_rq.py

示例2: main

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

#.........这里部分代码省略.........
        else:
            # If found, just use stacking recipe
            recipe = "qaStack"
    else:
        imgpath = image_path(filenm, directory, 
                             prefix=prefix, localsite=localsite)

    if imgpath is None:
        print "\nFile %s was not found.\n" % filenm
        sys.exit()

    imgname = os.path.basename(imgpath)
    print "Image path: "+imgpath

    # Check that file is GMOS LONGSLIT or IMAGE; other types are not yet supported
    # (but do allow biases and flats, too)
    try:
        ad = AstroData(imgpath)
    except IOError:
        print "\nProblem accessing file %s.\n" % filenm
        sys.exit()

    try:
        fp_mask = ad.focal_plane_mask()
    except:
        fp_mask = None

    if "RAW" not in ad.types and "PREPARED" in ad.types:
        print "AstroDataType 'RAW'  not found in types."
        print "AstroDataType 'PREPARED' found in types."
        print "\nFile %s appears to have been processed." % imgname
        print "redux halting ..."
        sys.exit()
    if "GMOS" not in ad.types:
        print "\nFile %s is not a GMOS file." % imgname
        print "Only GMOS longslit and images can be reduced at this time.\n"
        sys.exit()
    elif "GMOS_DARK" in ad.types:
        print "\nFile %s is a GMOS dark." % imgname
        print "Only GMOS longslit and images can be reduced at this time.\n"
        sys.exit()
    elif ("GMOS_IMAGE" in ad.types and
          fp_mask!="Imaging"):
        print "\nFile %s is a slit image." % imgname
        print "Only GMOS longslit and images can be reduced at this time.\n"
        sys.exit()
    elif (("GMOS_IMAGE" in ad.types and
           fp_mask=="Imaging" and 
           "GMOS_DARK" not in ad.types) or 
          "GMOS_BIAS" in ad.types or 
          "GMOS_IMAGE_FLAT" in ad.types or 
          "GMOS_LS" in ad.types):

        # Test for 3-amp mode with e2vDD CCDs. NOT commissioned.
        dettype = ad.phu_get_key_value("DETTYPE")
        if dettype=="SDSU II e2v DD CCD42-90":
            namps = ad.phu_get_key_value("NAMPS")
            if namps is not None and int(namps)==1:
                print "\nERROR: The GMOS e2v detectors should " \
                      "not use 3-amp mode!"
                print "Please set the GMOS CCD Readout Characteristics " \
                      "to use 6 amplifiers.\n"
                sys.exit()

        print "\nBeginning reduction for file %s, %s\n" % (imgname,
                                                           ad.data_label()) 
        if options.upload:
            context = "QA,upload"
        else:
            context = "QA"

        # Check for an alternate recipe for science reductions
        if ("GMOS_IMAGE" in ad.types and
            "GMOS_BIAS" not in ad.types and 
            "GMOS_IMAGE_FLAT" not in ad.types and
            recipe is not None):
            reduce_cmd = ["reduce",
                          "-r", recipe,
                          "--context",context,
                          "--loglevel","stdinfo",
                          "--logfile","gemini.log",
                          "-p", "clobber=True",
                          imgpath]
        else:
            # Otherwise call reduce with auto-selected reduction recipe
            reduce_cmd = ["reduce", 
                          "--context",context,
                          "--loglevel","stdinfo",
                          "--logfile","gemini.log",
                          "-p", "clobber=True",
                          imgpath]
            
        subprocess.call(reduce_cmd)

        print ""

    else:
        print "\nFile %s is not a supported type." % imgname
        print "Only GMOS longslit and images can be reduced at this time.\n"
        sys.exit()
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:104,代码来源:redux.py


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