Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- img=gdal.Open("D:datasub_66")
- inputArray=img.ReadAsArray()
- from osgeo import gdal
- import sys
- import numpy as np
- img = gdal.Open( "D:datasub_66.tif" ) # This is an example, please use the real extension of the image file instead of '.tif'
- for band in range( img.RasterCount ):
- band += 1
- print "[ GETTING BAND ]: ", band
- srcband = img.GetRasterBand(band)
- inputArray = np.array(img.GetRasterBand(1).ReadAsArray())
- print "[ ARRAY ]: ", inputArray
- [ GETTING BAND ]: 1
- [ ARRAY ]: [[1900 1900 1898 1895 1892 1887 1879 1871 1863 1852 1845 1837 1824 1802
- 1743 1725 1713 1705 1699 1693 1687 1683]
- [1897 1896 1894 1892 1890 1884 1877 1869 1862 1854 1847 1838 1820 1800
- 1745 1729 1719 1712 1706 1701 1696 1695]
- [1892 1891 1890 1888 1885 1881 1875 1868 1861 1855 1849 1837 1817 1794
- 1747 1732 1725 1720 1714 1710 1707 1706]
- [1887 1885 1884 1882 1880 1878 1873 1867 1860 1855 1849 1833 1815 1789
- 1749 1738 1732 1728 1723 1720 1718 1715]
- [1882 1880 1878 1876 1875 1873 1871 1866 1861 1855 1849 1832 1817 1795
- 1756 1744 1740 1737 1733 1730 1728 1725]
- [1880 1877 1874 1873 1870 1868 1867 1865 1860 1855 1850 1841 1834 1817
- 1795 1769 1749 1746 1743 1740 1736 1731]
- [1880 1876 1873 1870 1869 1866 1863 1862 1859 1856 1852 1847 1843 1841
- 1824 1812 1802 1775 1758 1747 1740 1733]
- [1879 1876 1873 1870 1869 1866 1863 1860 1858 1855 1852 1850 1847 1843
- 1831 1819 1803 1782 1763 1747 1738 1730]
- [1879 1877 1874 1872 1869 1866 1864 1861 1858 1855 1852 1850 1850 1848
- 1836 1816 1794 1775 1754 1744 1736 1728]
- [1880 1877 1875 1872 1869 1867 1864 1862 1858 1854 1850 1848 1850 1850
- 1840 1806 1786 1767 1749 1742 1734 1726]
- [1881 1879 1876 1873 1870 1866 1864 1861 1857 1851 1843 1840 1841 1850
- 1827 1797 1782 1769 1752 1742 1733 1723]
- [1882 1879 1876 1873 1870 1867 1864 1861 1855 1848 1839 1835 1833 1836
- 1810 1794 1783 1771 1758 1747 1737 1729]
- [1882 1880 1876 1873 1869 1866 1862 1858 1854 1849 1838 1833 1826 1814
- 1800 1792 1782 1773 1762 1752 1742 1733]
- [1881 1878 1874 1870 1867 1863 1860 1856 1853 1849 1840 1835 1821 1813
- 1798 1790 1783 1774 1766 1757 1748 1738]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement