code: def setInstrumentParameters(self, instrpars):
          
          pri_header = self._image[0].header
          self.proc_unit = instrpars['proc_unit']
  
          if self._isNotValid (instrpars['gain'], instrpars['gnkeyword']):
              instrpars['gnkeyword'] = 'ADCGAIN' #gain has been hardcoded below
  
          if self._isNotValid (instrpars['rdnoise'], instrpars['rnkeyword']):
              instrpars['rnkeyword'] = None
  
          if self._isNotValid (instrpars['exptime'], instrpars['expkeyword']):
              instrpars['expkeyword'] = 'EXPTIME'
  
          for chip in self.returnAllChips(extname=self.scienceExt):
              chip._gain= 5.4 #measured gain
              chip._rdnoise   = self.getInstrParameter(
                  instrpars['rdnoise'], pri_header, instrpars['rnkeyword']
              )
              chip._exptime   = self.getInstrParameter(
                  instrpars['exptime'], pri_header, instrpars['expkeyword']
              )
  
              if chip._gain is None or self._exptime is None:
                  print('ERROR: invalid instrument task parameter')
                  raise ValueError
  
              # We need to treat Read Noise as a special case since it is
              # not populated in the NICMOS primary header
              if chip._rdnoise is None:
                  chip._rdnoise = self._getDefaultReadnoise()
  
              chip._darkrate=self._getDarkRate()
              chip.darkcurrent = self.getdarkcurrent()
  
              chip._effGain = chip._gain
              # this is used in the static mask, static mask name also defined
              # here, must be done after outputNames
              self._assignSignature(chip._chip)
  
          # Convert the science data to electrons if specified by the user.
          self.doUnitConversions()
docs: This method overrides the superclass to set default values into
              the parameter dictionary, in case empty entries are provided.