def get_properties(cls, header): """Parses EIT image header""" properties = Map.get_properties(header) # Solar radius in arc-seconds at 1 au # @TODO: use sunpy.sun instead radius_1au = 959.644 scale = header.get("cdelt1") properties.update({ "date": parse_time(header.get('date_obs')), "detector": "EIT", "dsun": ((radius_1au / (properties['rsun_arcseconds'] * scale)) * constants.au), "name": "EIT %s" % header.get('wavelnth'), "nickname": "EIT", "cmap": cm.get_cmap('sohoeit%d' % header.get('wavelnth')) }) return 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
def get_properties(cls, header): """Parses RHESSI image header""" properties = Map.get_properties(header) properties.update({ "date": parse_time(header.get('date_obs')), "detector": header.get('telescop'), "instrument": header.get('telescop'), "measurement": [header.get('energy_l'), header.get('energy_h')], "observatory": "SDO", "name": "RHESSI %d - %d keV" % (header.get('energy_l'), header.get('energy_h')), "cmap": cm.get_cmap('rhessi'), "exposure_time": (parse_time(header.get('date_end')) - parse_time(header.get('date_obs'))).seconds, "coordinate_system": { 'x': 'HPLN-TAN', 'y': 'HPLT-TAN' } }) return properties
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
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
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
def get_properties(cls, header): """Parses AIA image header""" properties = Map.get_properties(header) properties.update({ "detector": "AIA", "instrument": "AIA", "observatory": "SDO", "nickname": "AIA", "cmap": cm.get_cmap('sdoaia%d' % header.get('wavelnth')), "processing_level": header.get('LVL_NUM') }) return properties
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
def get_properties(cls, header): """Parses SWAP image header""" properties = Map.get_properties(header) properties.update({ "detector": "SWAP", "instrument": "SWAP", "observatory": "PROBA2", "name": "SWAP %s" % header.get('wavelnth'), "nickname": "SWAP", "cmap": cm.get_cmap(name='sdoaia171') }) return properties
def get_properties(cls, header): """Parses LASCO image header""" properties = Map.get_properties(header) datestr = "%sT%s" % (header.get('date_obs'), header.get('time_obs')) properties.update({ "date": parse_time(datestr), "measurement": "white-light", "name": "LASCO %s" % header.get('detector'), "nickname": "LASCO-%s" % header.get('detector'), "cmap": cm.get_cmap('soholasco%s' % properties['detector'][1]) }) return properties
def get_properties(cls, header): """Parses AIA image header""" properties = Map.get_properties(header) properties.update( { "detector": "AIA", "instrument": "AIA", "observatory": "SDO", "nickname": "AIA", "cmap": cm.get_cmap("sdoaia%d" % header.get("wavelnth")), } ) return properties
def get_properties(cls, header): """Parses HMI image header""" properties = Map.get_properties(header) measurement = header['content'].split(" ")[0].lower() properties.update({ "detector": "HMI", "instrument": "HMI", "measurement": measurement, "observatory": "SDO", "name": "HMI %s" % measurement, "nickname": "HMI" }) return properties
def get_properties(cls, header): """Parses AIA image header""" properties = Map.get_properties(header) properties.update({ "detector": "AIA", "instrument": "AIA", "observatory": "SDO", "nickname": "AIA", "cmap": cm.get_cmap('sdoaia%d' % header.get('wavelnth')) }) return properties
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')), "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]) }) return properties
def get_properties(cls, header): """Parses LASCO image header""" properties = Map.get_properties(header) datestr = "%sT%s" % ( header.get("date-obs", header.get("date_obs")), header.get("time-obs", header.get("time_obs")), ) properties.update( { "date": parse_time(datestr), "measurement": "white-light", "name": "LASCO %s" % header.get("detector"), "nickname": "LASCO-%s" % header.get("detector"), "cmap": cm.get_cmap("soholasco%s" % properties["detector"][1]), } ) return properties
def get_properties(cls, header): """Parses EUVI image header""" properties = Map.get_properties(header) properties.update({ "date": parse_time(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
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
def get_properties(cls, header): """Parses EIT image header""" properties = Map.get_properties(header) # Solar radius in arc-seconds at 1 au radius_1au = sun.angular_size(header.get('date_obs')) scale = header.get("cdelt1") # EIT solar radius is expressed in number of EIT pixels solar_r = header.get("solar_r") properties.update({ "date": parse_time(header.get('date_obs')), "detector": "EIT", "rsun_arcseconds": solar_r * scale, "dsun": ((radius_1au / (solar_r * scale)) * constants.au), "name": "EIT %s" % header.get('wavelnth'), "nickname": "EIT", "cmap": cm.get_cmap('sohoeit%d' % header.get('wavelnth')) }) return properties
def get_properties(cls, header): """Parses MDI image header""" properties = Map.get_properties(header) # MDI sometimes has an "60" in seconds field datestr = header.get("date-obs", header.get("date_obs")) if datestr[17:19] == "60": datestr = datestr[:17] + "30" + datestr[19:] rsun = header.get("radius") # Solar radius in arc-seconds at 1 au # previous value radius_1au = 959.644 radius_1au = constants.average_angular_size # MDI images may have radius = 0.0 if not rsun: dsun = constants.au else: scale = header.get("cdelt1") dsun = (radius_1au / (rsun * scale)) * constants.au # Determine measurement dpcobsr = header.get("dpc_obsr") meas = "magnetogram" if dpcobsr.find("Mag") != -1 else "continuum" properties.update( { "date": parse_time(datestr), "detector": "MDI", "measurement": meas, "dsun": dsun, "name": "MDI %s" % meas, "nickname": "MDI", } ) return properties
def get_properties(cls, header): """Parses MDI image header""" properties = Map.get_properties(header) # MDI sometimes has an "60" in seconds field datestr = header['date_obs'] if datestr[17:19] == "60": datestr = datestr[:17] + "30" + datestr[19:] rsun = header.get('radius') # Solar radius in arc-seconds at 1 au # @TODO: use sunpy.sun instead radius_1au = 959.644 # MDI images may have radius = 0.0 if not rsun: dsun = constants.au else: scale = header.get("cdelt1") dsun = (radius_1au / (rsun * scale)) * constants.au # Determine measurement dpcobsr = header.get('dpc_obsr') meas = "magnetogram" if dpcobsr.find('Mag') != -1 else "continuum" properties.update({ "date": parse_time(datestr), "detector": "MDI", "measurement": meas, "dsun": dsun, "name": "MDI %s" % meas, "nickname": "MDI" }) return properties