parameters: (self, document)
docstring: overridden to write file for the document after parent
          makes a record of it in the store
docstring_summary: overridden to write file for the document after parent
          makes a record of it in the store
docstring_tokens: overridden to write file for the document after parent makes a record of it in the store
function: def insert(self, document):
          """overridden to write file for the document after parent
          makes a record of it in the store"""
          super(FileStore, self).insert(document)
  
          fname = self._get_filename(document.descriptor, readingFile=False)
  
          dirname = os.path.dirname(fname)
          if not os.path.exists(dirname):
              # In batch mode '-sym', the dir might be created by a different
              # rank.
              try:
                  os.makedirs(dirname)
              except OSError:
                  print("OSError: Could not make dirs! " +
                        "This is expected if running in batch mode with '-sym'")
                  pass
  
          if document.data is not None:
              adjustedfname = None
  
              for parname, parvalue in py23iteritems(document.descriptor):
                  params = self.get_parameter(parname)
                  if 'role' in params:
                      if params['role'] == 'field':
                          if 'image_size' not in self.metadata:
                              self.add_metadata(
                                  {'image_size': document.data.shape[:2]})
                              self.add_metadata({'endian': sys.byteorder})
  
              doctype = self.determine_type(document.descriptor)
              if doctype == 'RGB' or doctype == 'LUMINANCE':
                  adjustedfname = self.raster_wrangler.rgbwriter(document.data, fname)
              elif doctype == 'VALUE':
                  # find the range for the value that this raster shows
                  vrange = [0, 1]
                  for parname, parvalue in py23iteritems(document.descriptor):
                      param = self.get_parameter(parname)
                      if 'valueRanges' in param:
                          # we now have a color parameter, look for the range
                          # for the specific array we have a raster for
                          vr = param['valueRanges']
                          if parvalue in vr:
                              vrange = vr[parvalue]
                  adjustedfname = self.raster_wrangler.valuewriter(document.data, fname, vrange)
              elif doctype == 'Z':
                  adjustedfname = self.raster_wrangler.zwriter(document.data, fname)
              elif doctype == 'MAGNITUDE':
                  pass
              else:
                  adjustedfname = self.raster_wrangler.genericwriter(document.data, fname)
              if adjustedfname is not None:
                  self.__new_files.append((document.descriptor,adjustedfname))
function_tokens: def insert ( self , document ) : super ( FileStore , self ) . insert ( document ) fname = self . _get_filename ( document . descriptor , readingFile = False ) dirname = os . path . dirname ( fname ) if not os . path . exists ( dirname ) : # In batch mode '-sym', the dir might be created by a different # rank. try : os . makedirs ( dirname ) except OSError : print ( "OSError: Could not make dirs! " + "This is expected if running in batch mode with '-sym'" ) pass if document . data is not None : adjustedfname = None for parname , parvalue in py23iteritems ( document . descriptor ) : params = self . get_parameter ( parname ) if 'role' in params : if params [ 'role' ] == 'field' : if 'image_size' not in self . metadata : self . add_metadata ( { 'image_size' : document . data . shape [ : 2 ] } ) self . add_metadata ( { 'endian' : sys . byteorder } ) doctype = self . determine_type ( document . descriptor ) if doctype == 'RGB' or doctype == 'LUMINANCE' : adjustedfname = self . raster_wrangler . rgbwriter ( document . data , fname ) elif doctype == 'VALUE' : # find the range for the value that this raster shows vrange = [ 0 , 1 ] for parname , parvalue in py23iteritems ( document . descriptor ) : param = self . get_parameter ( parname ) if 'valueRanges' in param : # we now have a color parameter, look for the range # for the specific array we have a raster for vr = param [ 'valueRanges' ] if parvalue in vr : vrange = vr [ parvalue ] adjustedfname = self . raster_wrangler . valuewriter ( document . data , fname , vrange ) elif doctype == 'Z' : adjustedfname = self . raster_wrangler . zwriter ( document . data , fname ) elif doctype == 'MAGNITUDE' : pass else : adjustedfname = self . raster_wrangler . genericwriter ( document . data , fname ) if adjustedfname is not None : self . __new_files . append ( ( document . descriptor , adjustedfname ) )