<commit_before>"""STEREO Map subclass definitions"""
#pylint: disable=W0221,W0222,E1121

__author__ = "<NAME>"
__email__ = "<EMAIL>"

from sunpy.map import GenericMap
from sunpy.time import parse_time
from sunpy.cm import cm

__all__ = ['EUVIMap', 'CORMap']

class EUVIMap(GenericMap):
    """EUVI Image Map definition"""
    @classmethod
    def get_properties(cls, header):
        """Parses EUVI image header"""
        properties = Map.get_properties(header)
        
        properties.update({
            "date": parse_time(header.get('date-obs',header.get('date_obs'))),
            "detector": "EUVI",
            "instrument": "SECCHI",
            "observatory": header.get('obsrvtry'),
            "cmap": cm.get_cmap('sohoeit%d' % header.get('wavelnth')),
            "nickname": "EUVI-" + header.get('obsrvtry')[-1]
        })
        return properties

    @classmethod
    def is_datasource_for(cls, data, header, **kwargs):
        """Determines if header corresponds to an EUVI image"""
        return header.get('detector') == 'EUVI'
        
class CORMap(GenericMap):
    """COR Image Map definition"""
    @classmethod
    def get_properties(cls, header):
        """Parses COR image header"""
        properties = Map.get_properties(header)
        
        # @TODO: Deal with invalid values for exptime. E.g. STEREO-B COR2
        # on 2012/03/20 has -1 for some images.
        properties.update({
            "date": parse_time(header.get('date-obs',header.get('date_obs'))),
            "detector": header.get('detector'),
            "instrument": "SECCHI",
            "observatory": header.get('obsrvtry'),
            "measurement": "white-light",
            "name": "SECCHI %s" % header.get('detector'),
            "nickname": "%s-%s" % (header.get('detector'), 
                                   header.get('obsrvtry')[-1]),
            "cmap": cm.get_cmap('stereocor%s' % properties['detector'][-1])
        })
        return properties

    @classmethod
    def is_datasource_for(cls, data, header, **kwargs):
        """Determines if header corresponds to an COR image"""
        return header.get('detector', '').startswith('COR')
        <commit_msg>Updated stereo sources to work with new-style Maps<commit_after>"""STEREO Map subclass definitions"""
#pylint: disable=W0221,W0222,E1121

__author__ = "<NAME>"
__email__ = "<EMAIL>"

from sunpy.map import GenericMap
from sunpy.time import parse_time
from sunpy.cm import cm

__all__ = ['EUVIMap', 'CORMap']

class EUVIMap(GenericMap):
    """EUVI Image Map definition"""
    
    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('sohoeit%d' % self.wavelength)
        
    @classmethod
    def is_datasource_for(cls, data, header, **kwargs):
        """Determines if header corresponds to an EUVI image"""
        return header.get('detector') == 'EUVI'
        
class CORMap(GenericMap):
    """COR Image Map definition"""
    
    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])
        
    @property
    def measurement(self):
        # TODO: This needs to do more than white-light.  Should give B, pB, etc.
        return "white-light"

    @classmethod
    def is_datasource_for(cls, data, header, **kwargs):
        """Determines if header corresponds to an COR image"""
        return header.get('detector', '').startswith('COR')
        
{'fraction_non_alphanumeric': 0.1456532791052364, 'fraction_numerical': 0.011184544992374174, 'mean_word_length': 2.650278293135436, 'pattern_counts': {'":': 14, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3487984', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1219, 'n_words': 283}