Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@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
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()
@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
@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
@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
@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()
@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
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
@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()