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


Python cm.get_cmap函数代码示例

本文整理汇总了Python中sunpy.cm.cm.get_cmap函数的典型用法代码示例。如果您正苦于以下问题:Python get_cmap函数的具体用法?Python get_cmap怎么用?Python get_cmap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: __init__

 def __init__(self, data, header):
     BaseMap.__init__(self, header)
     self.detector = "SWAP"
     self.instrument = "SWAP"
     self.observatory = "PROBA2"
     self.name = "SWAP %s" % header.get('wavelnth')
     self.cmap = cm.get_cmap(name='sdoaia171')
开发者ID:arabwhipmonk,项目名称:sunpy,代码行数:7,代码来源:proba2.py

示例2: __init__

 def __init__(self, data, header):
     BaseMap.__init__(self, header)
     
     self.detector = "AIA"
     self.instrument = "AIA"
     self.observatory = "SDO"
     self.cmap = cm.get_cmap('sdoaia%d' % header.get('wavelnth'))
开发者ID:arabwhipmonk,项目名称:sunpy,代码行数:7,代码来源:sdo.py

示例3: get_properties

    def get_properties(cls, header):
        """Parses XRT image header"""
        properties = Map.get_properties(header)
        # XRT uses DATE_OBS, not date-obs.
        properties["date"] = parse_time(header.get('date_obs', None))

        #TODO: proper exception handling here - report to the user that there is
        # an unexpected value
        fw1 = header.get('EC_FW1_')
        if not(fw1.lower() in [x.lower() for x in cls.filter_wheel1_measurements]):
            pass
        fw2 = header.get('EC_FW2_')
        if not(fw2.lower() in [x.lower() for x in cls.filter_wheel2_measurements]):
            pass

        # All images get the same color table - IDL Red temperature (loadct, 3)
        properties.update({
            "detector": "XRT",
            "instrument": "XRT",
            "observatory": "Hinode",
            "name": "XRT %s-%s " % (fw1.replace('_', ' '),
                                       fw2.replace('_', ' ')),
            "nickname": "XRT",
            "cmap": cm.get_cmap(name='hinodexrt')
        })
        return properties
开发者ID:JordanBallew,项目名称:sunpy,代码行数:26,代码来源:hinode.py

示例4: __init__

    def __init__(self, data, header, **kwargs):

        GenericMap.__init__(self, data, header, **kwargs)

        self.meta['CUNIT1'] = self.meta['CUNIT1'].lower()
        self.meta['CUNIT2'] = self.meta['CUNIT2'].lower()

        # Fill in some missing or broken info
        datestr = "{date}T{time}".format(date=self.meta.get('date-obs',
                                                            self.meta.get('date_obs')
                                                            ),
                                         time=self.meta.get('time-obs',
                                                            self.meta.get('time_obs')
                                                            )
                                         )
        self.meta['date-obs'] = datestr

        # If non-standard Keyword is present, correct it too, for compatibility.
        if 'date_obs' in self.meta:
            self.meta['date_obs'] = self.meta['date-obs']
        self.meta['wavelnth'] = np.nan
        self.meta['waveunit'] = 'nm'
        self._nickname = self.instrument + "-" + self.detector
        self.plot_settings['cmap'] = cm.get_cmap('soholasco{det!s}'.format(det=self.detector[1]))
        self.plot_settings['norm'] = ImageNormalize(stretch=PowerStretch(0.5))
开发者ID:SallyDa,项目名称:sunpy,代码行数:25,代码来源:soho.py

示例5: get_properties

    def get_properties(cls, header):
        """Parses SXT image header"""
        properties = Map.get_properties(header)
        
        # 2012/11/07 - the SXT headers do not have a value of the distance from
        # the spacecraft to the center of the Sun.  The FITS keyword 'DSUN_OBS'
        # appears to refer to the observed diameter of the Sun.  Until such 
        # time as that is calculated and properly included in the file, we will 
        # use the value of 1 AU as a standard.
        properties['dsun']= constants.au
        
        wavelnth = header.get('wavelnth')
        if wavelnth == 'Al.1':
            wavelnth = 'Al01'
        if wavelnth.lower() == 'open':
            wavelnth = 'white light'

        properties.update({
            "detector": "SXT",
            "instrument": "SXT",
            "observatory": "Yohkoh",
            "name": "SXT %s" % wavelnth,
            "nickname": "SXT",
            "cmap": cm.get_cmap(name='yohkohsxt' + wavelnth[0:2].lower())
        })
        return properties 
开发者ID:tsundoku,项目名称:sunpy,代码行数:26,代码来源:yohkoh.py

示例6: get_properties

    def get_properties(cls, header):
        """Parses SXT image header"""
        properties = Map.get_properties(header)

        # 2012/12/19 - the SXT headers do not have a value of the distance from
        # the spacecraft to the center of the Sun.  The FITS keyword 'DSUN_OBS'
        # appears to refer to the observed diameter of the Sun.  Until such
        # time as that is calculated and properly included in the file, we will
        # use simple trigonometry to calculate the distance of the center of
        # the Sun from the spacecraft.  Note that the small angle approximation
        # is used, and the solar radius stored in SXT FITS files is in arcseconds.
        properties["dsun"] = constants.au
        yohkoh_solar_r = header.get("solar_r", None)
        if yohkoh_solar_r == None:
            properties["dsun"] = constants.au
        else:
            properties["dsun"] = constants.radius / (np.deg2rad(yohkoh_solar_r / 3600.0))

        wavelnth = header.get("wavelnth")
        if wavelnth == "Al.1":
            wavelnth = "Al01"
        if wavelnth.lower() == "open":
            wavelnth = "white light"

        properties.update(
            {
                "detector": "SXT",
                "instrument": "SXT",
                "observatory": "Yohkoh",
                "name": "SXT %s" % wavelnth,
                "nickname": "SXT",
                "cmap": cm.get_cmap(name="yohkohsxt" + wavelnth[0:2].lower()),
            }
        )
        return properties
开发者ID:nanoclosure,项目名称:sunpy,代码行数:35,代码来源:yohkoh.py

示例7: __init__

 def __init__(self, data, header):
     BaseMap.__init__(self, header)
     self.date = parse_time(header.get('date_obs'))
     self.detector = "EUVI"
     self.instrument = "SECCHI"
     self.observatory = header.get('obsrvtry')
     self.name = "EUVI %s" % self.meas
     self.cmap = cm.get_cmap('sohoeit%d' % header.get('wavelnth'))
开发者ID:arabwhipmonk,项目名称:sunpy,代码行数:8,代码来源:stereo.py

示例8: __init__

 def __init__(self, data, header, **kwargs):
     
     GenericMap.__init__(self, data, header, **kwargs)
     
     self._name = self.observatory + " " + self.detector + " " + str(self.measurement)
     self._nickname = "{0}-{1}".format(self.detector, self.observatory[-1])
     
     self.cmap = cm.get_cmap('stereocor%s' % self.detector[-1])
开发者ID:examon,项目名称:sunpy,代码行数:8,代码来源:stereo.py

示例9: __init__

    def __init__(self, data, header, **kwargs):

        GenericMap.__init__(self, data, header, **kwargs)

        # Fill in some missing info
        self.meta['detector'] = "AIA"
        self._nickname = self.detector
        self.plot_settings['cmap'] = cm.get_cmap(self._get_cmap_name())
        self.plot_settings['norm'] = ImageNormalize(stretch=source_stretch(self.meta, AsinhStretch(0.01)))
开发者ID:Hypnus1803,项目名称:sunpy,代码行数:9,代码来源:sdo.py

示例10: __init__

 def __init__(self, data, header, **kwargs):
     
     GenericMap.__init__(self, data, header, **kwargs)
     
     # Fill in some missing or broken info
     self._fix_date()
     
     self._name = self.instrument + " " + self.detector
     self._nickname = self.instrument + "-" + self.detector
             
     self.cmap = cm.get_cmap('soholasco%s' % self.detector[1])
开发者ID:kik369,项目名称:sunpy,代码行数:11,代码来源:soho.py

示例11: __init__

    def __init__(self, data, header, **kwargs):
        
        GenericMap.__init__(self, data, header, **kwargs)
        
        # Fill in some missing info
        self.meta['detector'] = "AIA"
#        self.meta['instrme'] = "AIA"
        
        self._nickname = self.detector
        
        self.cmap = cm.get_cmap('sdoaia%d' % self.wavelength)
开发者ID:quintusdias,项目名称:sunpy,代码行数:11,代码来源:sdo.py

示例12: __init__

    def __init__(self, data, header, **kwargs):

        GenericMap.__init__(self, data, header, **kwargs)

        # Fill in some missing info
        self.meta['detector'] = "AIA"
#        self.meta['instrme'] = "AIA"

        self._nickname = self.detector
        self._name = self.detector + " " + str(self.measurement)
        self.cmap = cm.get_cmap(self._get_cmap_name())
开发者ID:bsipocz,项目名称:sunpy,代码行数:11,代码来源:sdo.py

示例13: __init__

    def __init__(self, data, header, **kwargs):

        GenericMap.__init__(self, data, header, **kwargs)

        # It needs to be verified that these must actually be set and
        # are not already in the header.
        self.meta['detector'] = "SWAP"
#        self.meta['instrme'] = "SWAP"
        self.meta['obsrvtry'] = "PROBA2"

        self._nickname = self.detector
        self.plot_settings['cmap'] = cm.get_cmap(name='sdoaia171')
开发者ID:Hypnus1803,项目名称:sunpy,代码行数:12,代码来源:proba2.py

示例14: __init__

 def __init__(self, data, header):
     BaseMap.__init__(self, header)
     
     self.date = parse_time(header.get('date_obs'))
     self.detector = header.get('telescop')
     self.instrument = header.get('telescop')
     self.measurement = [header.get('energy_l'), header.get('energy_h')]
     self.name = "RHESSI %d - %d keV" % (header.get('energy_l'), 
                                         header.get('energy_h'))
     self.cmap = cm.get_cmap('rhessi')
     self.exposure_time = (parse_time(header.get('date_end')) - 
                           parse_time(header.get('date_obs'))).seconds
开发者ID:arabwhipmonk,项目名称:sunpy,代码行数:12,代码来源:rhessi.py

示例15: __init__

    def __init__(self, data, header, **kwargs):

        GenericMap.__init__(self, data, header, **kwargs)

        # It needs to be verified that these must actually be set and are not
        # already in the header.
        self.meta['detector'] = "TRACE"
        self.meta['obsrvtry'] = "TRACE"
        self._nickname = self.detector
        # Colour maps
        self.plot_settings['cmap'] = cm.get_cmap('trace' + str(self.meta['WAVE_LEN']))
        self.plot_settings['norm'] = ImageNormalize(stretch=source_stretch(self.meta, LogStretch()))
开发者ID:Hypnus1803,项目名称:sunpy,代码行数:12,代码来源:trace.py


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