class_docstr: AHI standard format reader.
  
  The AHI sensor produces data for some pixels outside the Earth disk (i,e:
  atmospheric limb or deep space pixels).
  By default, these pixels are masked out as they contain data of limited
  or no value, but some applications do require these pixels.
  It is therefore possible to override the default behaviour and perform no
  masking of non-Earth pixels.
  
  In order to change the default behaviour, use the 'mask_space' variable
  as part of ``reader_kwargs`` upon Scene creation::
  
      import satpy
      import glob
  
      filenames = glob.glob('*FLDK*.dat')
      scene = satpy.Scene(filenames,
                          reader='ahi_hsd',
                          reader_kwargs={'mask_space': False})
      scene.load([0.6])
  
  The AHI HSD data files contain multiple VIS channel calibration
  coefficients. By default, the updated coefficients in header block 6
  are used. If the user prefers the default calibration coefficients from
  block 5 then they can pass calib_mode='nominal' when creating a scene::
  
      import satpy
      import glob
  
      filenames = glob.glob('*FLDK*.dat')
      scene = satpy.Scene(filenames,
                          reader='ahi_hsd',
                          reader_kwargs={'calib_mode': 'update'})
      scene.load([0.6])
  
  Alternative AHI calibrations are also available, such as GSICS
  coefficients. As such, you can supply custom per-channel correction
  by setting calib_mode='custom' and passing correction factors via::
  
      user_calibration={'chan': ['slope': slope, 'offset': offset]}
  
  Where slo and off are per-channel slope and offset coefficients defined by::
  
      rad_leo = (rad_geo - off) / slo
  
  If you do not have coefficients for a particular band, then by default the
  slope will be set to 1 .and the offset to 0.::
  
      import satpy
      import glob
  
      # Load bands 7, 14 and 15, but we only have coefs for 7+14
      calib_dict = {'B07': {'slope': 0.99, 'offset': 0.002},
                    'B14': {'slope': 1.02, 'offset': -0.18}}
  
      filenames = glob.glob('*FLDK*.dat')
      scene = satpy.Scene(filenames,
                          reader='ahi_hsd',
                          reader_kwargs={'user_calibration': calib_dict)
      # B15 will not have custom radiance correction applied.
      scene.load(['B07', 'B14', 'B15'])
  
  By default, user-supplied calibrations / corrections are applied to the
  radiance data in accordance with the GSICS standard defined in the
  equation above. However, user-supplied gain and offset values for
  converting digital number into radiance via Rad = DN * gain + offset are
  also possible. To supply your own factors, supply a user calibration dict
  using `type: 'DN'` as follows::
  
      calib_dict = {'B07': {'slope': 0.0037, 'offset': 18.5},
                    'B14': {'slope': -0.002, 'offset': 22.8},
                    'type': 'DN'}
  
  You can also explicitly select radiance correction with `'type': 'RAD'`
  but this is not necessary as it is the default option if you supply your
  own correction coefficients.
class_docstr_tok: ["AHI","standard","format","reader",".","The","AHI","sensor","produces","data","for","some","pixels","outside","the","Earth","disk","(","i",",","e",":","atmospheric","limb","or","deep","space","pixels",")",".","By","default",",","these","pixels","are","masked","out","as","they","contain","data","of","limited","or","no","value",",","but","some","applications","do","require","these","pixels",".","It","is","therefore","possible","to","override","the","default","behaviour","and","perform","no","masking","of","non-Earth","pixels",".","In","order","to","change","the","default","behaviour",",","use","the","'mask_space","'","variable","as","part","of","``","reader_kwargs","``","upon","Scene","creation",":",":","import","satpy","import","glob","filenames","=","glob.glob","(","'","*","FLDK","*",".dat","'",")","scene","=","satpy.Scene","(","filenames",",","reader='ahi_hsd","'",",","reader_kwargs=","{","'mask_space","'",":","False","}",")","scene.load","(","[","0.6","]",")","The","AHI","HSD","data","files","contain","multiple","VIS","channel","calibration","coefficients",".","By","default",",","the","updated","coefficients","in","header","block","6","are","used",".","If","the","user","prefers","the","default","calibration","coefficients","from","block","5","then","they","can","pass","calib_mode='nominal","'","when","creating","a","scene",":",":","import","satpy","import","glob","filenames","=","glob.glob","(","'","*","FLDK","*",".dat","'",")","scene","=","satpy.Scene","(","filenames",",","reader='ahi_hsd","'",",","reader_kwargs=","{","'calib_mode","'",":","'update","'","}",")","scene.load","(","[","0.6","]",")","Alternative","AHI","calibrations","are","also","available",",","such","as","GSICS","coefficients",".","As","such",",","you","can","supply","custom","per-channel","correction","by","setting","calib_mode='custom","'","and","passing","correction","factors","via",":",":","user_calibration=","{","'chan","'",":","[","'slope","'",":","slope",",","'offset","'",":","offset","]","}","Where","slo","and","off","are","per-channel","slope","and","offset","coefficients","defined","by",":",":","rad_leo","=","(","rad_geo","-","off",")","\/","slo","If","you","do","not","have","coefficients","for","a","particular","band",",","then","by","default","the","slope","will","be","set","to","1",".and","the","offset","to","0.",":",":","import","satpy","import","glob","#","Load","bands","7",",","14","and","15",",","but","we","only","have","coefs","for","7+14","calib_dict","=","{","'B07","'",":","{","'slope","'",":","0.99",",","'offset","'",":","0.002","}",",","'B14","'",":","{","'slope","'",":","1.02",",","'offset","'",":","-0.18","}","}","filenames","=","glob.glob","(","'","*","FLDK","*",".dat","'",")","scene","=","satpy.Scene","(","filenames",",","reader='ahi_hsd","'",",","reader_kwargs=","{","'user_calibration","'",":","calib_dict",")","#","B15","will","not","have","custom","radiance","correction","applied",".","scene.load","(","[","'B07","'",",","'B14","'",",","'B15","'","]",")","By","default",",","user-supplied","calibrations","\/","corrections","are","applied","to","the","radiance","data","in","accordance","with","the","GSICS","standard","defined","in","the","equation","above",".","However",",","user-supplied","gain","and","offset","values","for","converting","digital","number","into","radiance","via","Rad","=","DN","*","gain","+","offset","are","also","possible",".","To","supply","your","own","factors",",","supply","a","user","calibration","dict","using","`","type",":","'DN","'","`","as","follows",":",":","calib_dict","=","{","'B07","'",":","{","'slope","'",":","0.0037",",","'offset","'",":","18.5","}",",","'B14","'",":","{","'slope","'",":","-0.002",",","'offset","'",":","22.8","}",",","'type","'",":","'DN","'","}","You","can","also","explicitly","select","radiance","correction","with","`","'type","'",":","'RAD","'","`","but","this","is","not","necessary","as","it","is","the","default","option","if","you","supply","your","own","correction","coefficients","."]
docstr: Calibrate to radiance.
docstr_tok: ["Calibrate","to","radiance","."]
code: def convert_to_radiance(self, data):
      """Calibrate to radiance."""
      bnum = self._header["block5"]["band_number"][0]
      # Check calibration mode and select corresponding coefficients
      if self.calib_mode == "UPDATE" and bnum < 7:
          dn_gain = self._header["calibration"][
              "cali_gain_count2rad_conversion"
          ][0]
          dn_offset = self._header["calibration"][
              "cali_offset_count2rad_conversion"
          ][0]
          if dn_gain == 0 and dn_offset == 0:
              logger.info(
                  "No valid updated coefficients, fall back to default values."
              )
              dn_gain = self._header["block5"][
                  "gain_count2rad_conversion"
              ][0]
              dn_offset = self._header["block5"][
                  "offset_count2rad_conversion"
              ][0]
      else:
          dn_gain = self._header["block5"]["gain_count2rad_conversion"][
              0
          ]
          dn_offset = self._header["block5"][
              "offset_count2rad_conversion"
          ][0]
  
      # Assume no user correction
      correction_type = self._get_user_calibration_correction_type()
      if correction_type == "DN":
          # Replace file calibration with user calibration
          dn_gain, dn_offset = get_user_calibration_factors(
              self.band_name, self.user_calibration
          )
  
      data = data * np.float32(dn_gain) + np.float32(dn_offset)
      # If using radiance correction factors from GSICS or similar, apply here
      if correction_type == "RAD":
          user_slope, user_offset = get_user_calibration_factors(
              self.band_name, self.user_calibration
          )
          data = apply_rad_correction(
              data, np.float32(user_slope), np.float32(user_offset)
          )
      return data
  
imports: import logging
  import os
  import warnings
  from datetime import datetime, timedelta
  import dask.array
  import numpy
  import xarray
  from satpy._compat import cached_property
  from satpy.readers._geos_area import get_area_definition, get_area_extent
  from satpy.readers.file_handlers import BaseFileHandler
  from satpy.readers.utils import apply_rad_correction, get_earth_radius, get_geostationary_mask, get_user_calibration_factors, np2str, unzip_file
  from satpy.utils import normalize_low_res_chunks
label_desc: Use image node_id 23 for calling the AHIHSDFileHandler obj's underlying member method code with example usage: obj.convert_to_radiance(data) and returns: data