How to use the tifffile.tifffile.TiffFile function in tifffile

To help you get started, we’ve selected a few tifffile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pf4d / cslvr / varglas / data / data_factory.py View on Github external
  @staticmethod
  def get_bedmap2(thklim = 0.0):

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home     = os.path.dirname(os.path.abspath(filename))
    direc    = home + '/antarctica/bedmap2/bedmap2_tiff/' 

    from tifffile.tifffile import TiffFile
   
    B           = TiffFile(direc + 'bedmap2_bed.tif')
    S           = TiffFile(direc + 'bedmap2_surface.tif') 
    H           = TiffFile(direc + 'bedmap2_thickness.tif')
    mask        = TiffFile(direc + 'bedmap2_icemask_grounded_and_shelves.tif') 
    rock_mask   = TiffFile(direc + 'bedmap2_rockmask.tif') 
    b_uncert    = TiffFile(direc + 'bedmap2_grounded_bed_uncertainty.tif') 
    coverage    = TiffFile(direc + 'bedmap2_coverage.tif')
    gl04c_WGS84 = TiffFile(direc + 'gl04c_geiod_to_WGS84.tif')
   
    B           = B.asarray()
    S           = S.asarray()
    H           = H.asarray()
    mask        = mask.asarray()
    rock_mask   = rock_mask.asarray()
    b_uncert    = b_uncert.asarray()
    coverage    = coverage.asarray() 
    gl04c_WGS84 = gl04c_WGS84.asarray()
    
    B = S - H
    H[H == 32767]  = thklim
github pf4d / cslvr / varglas / data / data_factory.py View on Github external
def get_bedmap2(thklim = 0.0):

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home     = os.path.dirname(os.path.abspath(filename))
    direc    = home + '/antarctica/bedmap2/bedmap2_tiff/' 

    from tifffile.tifffile import TiffFile
   
    B           = TiffFile(direc + 'bedmap2_bed.tif')
    S           = TiffFile(direc + 'bedmap2_surface.tif') 
    H           = TiffFile(direc + 'bedmap2_thickness.tif')
    mask        = TiffFile(direc + 'bedmap2_icemask_grounded_and_shelves.tif') 
    rock_mask   = TiffFile(direc + 'bedmap2_rockmask.tif') 
    b_uncert    = TiffFile(direc + 'bedmap2_grounded_bed_uncertainty.tif') 
    coverage    = TiffFile(direc + 'bedmap2_coverage.tif')
    gl04c_WGS84 = TiffFile(direc + 'gl04c_geiod_to_WGS84.tif')
   
    B           = B.asarray()
    S           = S.asarray()
    H           = H.asarray()
    mask        = mask.asarray()
    rock_mask   = rock_mask.asarray()
    b_uncert    = b_uncert.asarray()
    coverage    = coverage.asarray() 
    gl04c_WGS84 = gl04c_WGS84.asarray()
    
    B = S - H
    H[H == 32767]  = thklim
    H[H <= thklim] = thklim
    S = B + H

    vara        = dict()
github pf4d / cslvr / varglas / data / data_factory.py View on Github external
  @staticmethod
  def get_bedmap2(thklim = 0.0):

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home     = os.path.dirname(os.path.abspath(filename))
    direc    = home + '/antarctica/bedmap2/bedmap2_tiff/' 

    from tifffile.tifffile import TiffFile
   
    B           = TiffFile(direc + 'bedmap2_bed.tif')
    S           = TiffFile(direc + 'bedmap2_surface.tif') 
    H           = TiffFile(direc + 'bedmap2_thickness.tif')
    mask        = TiffFile(direc + 'bedmap2_icemask_grounded_and_shelves.tif') 
    rock_mask   = TiffFile(direc + 'bedmap2_rockmask.tif') 
    b_uncert    = TiffFile(direc + 'bedmap2_grounded_bed_uncertainty.tif') 
    coverage    = TiffFile(direc + 'bedmap2_coverage.tif')
    gl04c_WGS84 = TiffFile(direc + 'gl04c_geiod_to_WGS84.tif')
   
    B           = B.asarray()
    S           = S.asarray()
    H           = H.asarray()
    mask        = mask.asarray()
    rock_mask   = rock_mask.asarray()
    b_uncert    = b_uncert.asarray()
    coverage    = coverage.asarray() 
    gl04c_WGS84 = gl04c_WGS84.asarray()
    
    B = S - H
    H[H == 32767]  = thklim
    H[H <= thklim] = thklim
github pf4d / cslvr / varglas / data / data_factory.py View on Github external
  @staticmethod
  def get_bedmap2(thklim = 0.0):

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home     = os.path.dirname(os.path.abspath(filename))
    direc    = home + '/antarctica/bedmap2/bedmap2_tiff/' 

    from tifffile.tifffile import TiffFile
   
    B           = TiffFile(direc + 'bedmap2_bed.tif')
    S           = TiffFile(direc + 'bedmap2_surface.tif') 
    H           = TiffFile(direc + 'bedmap2_thickness.tif')
    mask        = TiffFile(direc + 'bedmap2_icemask_grounded_and_shelves.tif') 
    rock_mask   = TiffFile(direc + 'bedmap2_rockmask.tif') 
    b_uncert    = TiffFile(direc + 'bedmap2_grounded_bed_uncertainty.tif') 
    coverage    = TiffFile(direc + 'bedmap2_coverage.tif')
    gl04c_WGS84 = TiffFile(direc + 'gl04c_geiod_to_WGS84.tif')
   
    B           = B.asarray()
    S           = S.asarray()
    H           = H.asarray()
    mask        = mask.asarray()
    rock_mask   = rock_mask.asarray()
    b_uncert    = b_uncert.asarray()
    coverage    = coverage.asarray() 
    gl04c_WGS84 = gl04c_WGS84.asarray()
    
    B = S - H
github pf4d / cslvr / varglas / data / data_factory.py View on Github external
  @staticmethod
  def get_bedmap2(thklim = 0.0):

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home     = os.path.dirname(os.path.abspath(filename))
    direc    = home + '/antarctica/bedmap2/bedmap2_tiff/' 

    from tifffile.tifffile import TiffFile
   
    B           = TiffFile(direc + 'bedmap2_bed.tif')
    S           = TiffFile(direc + 'bedmap2_surface.tif') 
    H           = TiffFile(direc + 'bedmap2_thickness.tif')
    mask        = TiffFile(direc + 'bedmap2_icemask_grounded_and_shelves.tif') 
    rock_mask   = TiffFile(direc + 'bedmap2_rockmask.tif') 
    b_uncert    = TiffFile(direc + 'bedmap2_grounded_bed_uncertainty.tif') 
    coverage    = TiffFile(direc + 'bedmap2_coverage.tif')
    gl04c_WGS84 = TiffFile(direc + 'gl04c_geiod_to_WGS84.tif')
   
    B           = B.asarray()
    S           = S.asarray()
    H           = H.asarray()
    mask        = mask.asarray()
    rock_mask   = rock_mask.asarray()
    b_uncert    = b_uncert.asarray()
    coverage    = coverage.asarray() 
    gl04c_WGS84 = gl04c_WGS84.asarray()
    
    B = S - H
    H[H == 32767]  = thklim
    H[H <= thklim] = thklim
    S = B + H
github pf4d / cslvr / varglas / data / data_factory.py View on Github external
  @staticmethod
  def get_bedmap2(thklim = 0.0):

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home     = os.path.dirname(os.path.abspath(filename))
    direc    = home + '/antarctica/bedmap2/bedmap2_tiff/' 

    from tifffile.tifffile import TiffFile
   
    B           = TiffFile(direc + 'bedmap2_bed.tif')
    S           = TiffFile(direc + 'bedmap2_surface.tif') 
    H           = TiffFile(direc + 'bedmap2_thickness.tif')
    mask        = TiffFile(direc + 'bedmap2_icemask_grounded_and_shelves.tif') 
    rock_mask   = TiffFile(direc + 'bedmap2_rockmask.tif') 
    b_uncert    = TiffFile(direc + 'bedmap2_grounded_bed_uncertainty.tif') 
    coverage    = TiffFile(direc + 'bedmap2_coverage.tif')
    gl04c_WGS84 = TiffFile(direc + 'gl04c_geiod_to_WGS84.tif')
   
    B           = B.asarray()
    S           = S.asarray()
    H           = H.asarray()
    mask        = mask.asarray()
    rock_mask   = rock_mask.asarray()
    b_uncert    = b_uncert.asarray()
    coverage    = coverage.asarray() 
    gl04c_WGS84 = gl04c_WGS84.asarray()
github pf4d / cslvr / varglas / data / data_factory.py View on Github external
  @staticmethod
  def get_bedmap2(thklim = 0.0):

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home     = os.path.dirname(os.path.abspath(filename))
    direc    = home + '/antarctica/bedmap2/bedmap2_tiff/' 

    from tifffile.tifffile import TiffFile
   
    B           = TiffFile(direc + 'bedmap2_bed.tif')
    S           = TiffFile(direc + 'bedmap2_surface.tif') 
    H           = TiffFile(direc + 'bedmap2_thickness.tif')
    mask        = TiffFile(direc + 'bedmap2_icemask_grounded_and_shelves.tif') 
    rock_mask   = TiffFile(direc + 'bedmap2_rockmask.tif') 
    b_uncert    = TiffFile(direc + 'bedmap2_grounded_bed_uncertainty.tif') 
    coverage    = TiffFile(direc + 'bedmap2_coverage.tif')
    gl04c_WGS84 = TiffFile(direc + 'gl04c_geiod_to_WGS84.tif')
   
    B           = B.asarray()
    S           = S.asarray()
    H           = H.asarray()
    mask        = mask.asarray()
    rock_mask   = rock_mask.asarray()
    b_uncert    = b_uncert.asarray()
    coverage    = coverage.asarray() 
    gl04c_WGS84 = gl04c_WGS84.asarray()
    
    B = S - H
    H[H == 32767]  = thklim
    H[H <= thklim] = thklim
    S = B + H
github pf4d / cslvr / varglas / data / data_factory.py View on Github external
p    = Proj(txt)
    
    # save the data in matlab format :
    vara['pyproj_Proj']       = p
    vara['map_western_edge']  = west 
    vara['map_eastern_edge']  = east 
    vara['map_southern_edge'] = south 
    vara['map_northern_edge'] = north
    vara['nx']                = nx
    vara['ny']                = ny
    
    # retrieve data :
    vara['dataset']   = 'measures'
    vara['continent'] = 'greenland'
    for f in files:
      data    = TiffFile(direc + f + '.tif')
      vara[f] = data.asarray()[::-1, :]
    return vara
github pf4d / cslvr / varglas / data / data_factory.py View on Github external
  @staticmethod
  def get_bedmap2(thklim = 0.0):

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home     = os.path.dirname(os.path.abspath(filename))
    direc    = home + '/antarctica/bedmap2/bedmap2_tiff/' 

    from tifffile.tifffile import TiffFile
   
    B           = TiffFile(direc + 'bedmap2_bed.tif')
    S           = TiffFile(direc + 'bedmap2_surface.tif') 
    H           = TiffFile(direc + 'bedmap2_thickness.tif')
    mask        = TiffFile(direc + 'bedmap2_icemask_grounded_and_shelves.tif') 
    rock_mask   = TiffFile(direc + 'bedmap2_rockmask.tif') 
    b_uncert    = TiffFile(direc + 'bedmap2_grounded_bed_uncertainty.tif') 
    coverage    = TiffFile(direc + 'bedmap2_coverage.tif')
    gl04c_WGS84 = TiffFile(direc + 'gl04c_geiod_to_WGS84.tif')
   
    B           = B.asarray()
    S           = S.asarray()
    H           = H.asarray()
    mask        = mask.asarray()
    rock_mask   = rock_mask.asarray()
    b_uncert    = b_uncert.asarray()
    coverage    = coverage.asarray() 
    gl04c_WGS84 = gl04c_WGS84.asarray()