OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
cyan_conus_tiles Namespace Reference

Variables

 parser
 
 action
 
 version
 
 help
 
 args = parser.parse_args()
 
int nXtiles = 9
 
int nYtiles = 6
 
 sourcefile = args.ifile
 
 sourcefilebase = sourcefile.rstrip('.tif')
 
 srcDS = gdal.Open(sourcefile)
 
 T0 = Affine.from_gdal(*srcDS.GetGeoTransform())
 
 xy2rc = lambda xm, ym: (ym, xm) * ~T0
 
 xoff = int(xoff)
 
 yoff = int(yoff)
 
 endx = int(endx)
 
 endy = int(endy)
 
 xstride = int((endx-xoff)/nXtiles)
 
 ystride = int((endy-yoff)/nYtiles)
 
int ytile = y + 1
 
 uly = y * ystride + yoff
 
int xtile = x +1
 
 ulx = x * xstride + xoff
 
list srcwin = [ulx,uly,xstride,ystride]
 
string tileFile = sourcefilebase + '_' + str(xtile) + '_' + str(ytile) + '.tif'
 
 transop = gdal.TranslateOptions(creationOptions=['COMPRESS=LZW'],srcWin=srcwin)
 
 options
 

Variable Documentation

◆ action

action

Definition at line 22 of file cyan_conus_tiles.py.

◆ args

args = parser.parse_args()

Definition at line 26 of file cyan_conus_tiles.py.

◆ endx

endx = int(endx)

Definition at line 42 of file cyan_conus_tiles.py.

◆ endy

endy = int(endy)

Definition at line 42 of file cyan_conus_tiles.py.

◆ help

help

Definition at line 23 of file cyan_conus_tiles.py.

◆ nXtiles

int nXtiles = 9

Definition at line 28 of file cyan_conus_tiles.py.

◆ nYtiles

int nYtiles = 6

Definition at line 29 of file cyan_conus_tiles.py.

◆ options

options

Definition at line 61 of file cyan_conus_tiles.py.

◆ parser

Initial value:
1 = argparse.ArgumentParser(prog='cyan_conus_tiles',
2  description='This script generates 54 GeoTIFF tiles in a 9x6 grid from an input full\nCONUS GeoTIFF\n' +
3  'The output tile names are based on the input file name with\n'+
4  '_row_col.tif appended')

Definition at line 18 of file cyan_conus_tiles.py.

◆ sourcefile

sourcefile = args.ifile

Definition at line 31 of file cyan_conus_tiles.py.

◆ sourcefilebase

sourcefilebase = sourcefile.rstrip('.tif')

Definition at line 32 of file cyan_conus_tiles.py.

◆ srcDS

srcDS = gdal.Open(sourcefile)

Definition at line 34 of file cyan_conus_tiles.py.

◆ srcwin

list srcwin = [ulx,uly,xstride,ystride]

Definition at line 56 of file cyan_conus_tiles.py.

◆ T0

T0 = Affine.from_gdal(*srcDS.GetGeoTransform())

Definition at line 36 of file cyan_conus_tiles.py.

◆ tileFile

tileFile = sourcefilebase + '_' + str(xtile) + '_' + str(ytile) + '.tif'

Definition at line 57 of file cyan_conus_tiles.py.

◆ transop

transop = gdal.TranslateOptions(creationOptions=['COMPRESS=LZW'],srcWin=srcwin)

Definition at line 60 of file cyan_conus_tiles.py.

◆ ulx

ulx = x * xstride + xoff

Definition at line 55 of file cyan_conus_tiles.py.

◆ uly

uly = y * ystride + yoff

Definition at line 51 of file cyan_conus_tiles.py.

◆ version

version

Definition at line 22 of file cyan_conus_tiles.py.

◆ xoff

xoff = int(xoff)

Definition at line 39 of file cyan_conus_tiles.py.

◆ xstride

xstride = int((endx-xoff)/nXtiles)

Definition at line 46 of file cyan_conus_tiles.py.

◆ xtile

int xtile = x +1

Definition at line 54 of file cyan_conus_tiles.py.

◆ xy2rc

xy2rc = lambda xm, ym: (ym, xm) * ~T0

Definition at line 37 of file cyan_conus_tiles.py.

◆ yoff

yoff = int(yoff)

Definition at line 39 of file cyan_conus_tiles.py.

◆ ystride

ystride = int((endy-yoff)/nYtiles)

Definition at line 47 of file cyan_conus_tiles.py.

◆ ytile

int ytile = y + 1

Definition at line 50 of file cyan_conus_tiles.py.