Hot answers tagged

22

Your script is missing the ds.FlushCache method, that saves to disk what you have in memory at the end of the modifications. See below a corrected version of your example. Notice that I also added two lines to set projection and geotransform as input import os import gdal file = "path+filename" ds = gdal.Open(file) band = ds.GetRasterBand(1) arr = ...


14

NDVI is defined for any two bands with near-infrared and infrared data (it is an empirical remote sensing index). As such, you can calculate it straight from the DNs. This is mostly OK if you are only classifying or analyzing vegetation on a single image without significant atmospheric effects (cirrus clouds...) However, if you are performing change ...


12

Have a look at nlayers(s). The returned number of layers will equal 28 - at least for the above example with 4 multi-layer objects encompassing 7 layers each. Applying stack to multiple multi-layer files results in one huge 'RasterStack' object, i.e. all the single multi-layer objects are appended to one another. If you would like to have separate stacks ...


12

You could try filling the gaps before you aggregate them by month. USGS published a LS7 SLC-off gap-filling algorithm. This algorithm was recreated for Google Earth Engine by Noel Gorelick: https://code.earthengine.google.com/d20cba5268ccbe117e2fc1c5fefc33f3 Building upon this Genadii Donchyts changed the algorithm for faster performance: https://code....


11

For the record, here is a good way to do this: var imageCollection = ee.ImageCollection("LANDSAT/LT05/C01/T1"); var months = ee.List.sequence(1, 12); var composites = ee.ImageCollection.fromImages(months.map(function(m) { var filtered = imageCollection.filter(ee.Filter.calendarRange({ start: m, field: 'month' })); var composite = ee....


10

The Scan Line Corrector in the ETM+ instrument onboard Landsat-7 suffered a (suspected) mechanical failure in 2003, so all subsequent images suffer from the striping you are seeing in your images. The Wikipedia page for the satellite has a good explanation. Destriping Landsat Images? addresses methods for de-striping the imagery, however, note that it is ...


10

It's going to be something like this, but you'll need to play with the threshold (10 in this example) to meet your needs. Watch out for ROIs that overlap a scene's footprint, but do not contain any valid pixels. Also watch out for ROIs that are very large or span multiple WRS cells. var ic = ee.ImageCollection("LANDSAT/LC08/C01/T1_RT_TOA"); // A polygon ...


9

The Landsat reflectance data you downloaded from USGS has been scaled using a scale factor of 0.0001. So multiplying the digital number by 0.0001 will give you a value between 0 and 1. The 2000 value you are talking about, i believe, is the saturate value (which should be 20000). See this document for more details: https://landsat.usgs.gov/sites/default/...


8

I just thought I'd add that there are some 'pure' Python solutions for several nodes in this workflow, also. Some file reading and basic processing: Spectral Python: http://spectralpython.sourceforge.net/ More classification than you'll find in pure remote sensing and GIS packages: http://scikit-learn.org/stable/ More links I can't share: 6S Python ...


8

The Supplementary Materials (SM) for the Science article provides references to a number of different journal-articles that outline various parts of the methodology. The SM can be found here Extending the time-series to include Landsat-5 (and potentially Landsat-8 to make the methodology something that can be rerun "easily") data will be a challenging task,...


8

Kogan (2004) (p. 2891) provides the following formula for the Vegetation Condition Index (VCI): VCI = 100 * (NDVI - NDVImin) / (NDVImax - NDVImin) where, NDVI = Smoothed weekly NDVI value NDVImin = Multiyear minimum NDVI value NDVImax = Multiyear maximum NDVI value As you know, NDVI ranges from -1 to 1 and functionally ranges from 0 - 1. VCI rescales ...


8

gnutls.h which is required is missing from the filesystem even if you install libcurl4-gnutls-dev which supposedly has the headers files for curl. to correct for that error run: # apt-get install libgnutls28-dev to add the missing header and pip finally to install pycurl and landsat-util


8

A major reason for having panchromatic bands covering a broad spectral range is a technical reason: most of the solar energy reflected by the Earth is in the NIR wavelength. As the aim of a single panchromatic band is to achieve a better spatial resolution, you can improve the signal-to-noise ratio if your total amount of energy is larger. Originally, ...


7

If you really want to use python, and you need functionality similar to GRASS, perhaps the easiest solution would be to use GRASS via Python. That isn't specific to Landsat8, but I don't think a processing solution should be tied that closely to a specific satellite. You could implement some simple wrappers / higher level functions if you're consistently ...


7

This varies greatly on the characteristics of the scene. Fire scar mapping studies using Landsat-5 TM have used the following three band combinations: Spain: Bands 4, 5, 7 CHUVIECO, E., and CONGALTON, R., 1988, Mapping and inventory of forest fires from digital processing of TM data. Geocarto International, 4, 41–53. Amazonia: Bands 3, 4, 5 PEREIRA, M. ...


7

Landsat and Modis are optical sensors, which means that they provide digital numbers of reflected materials that are within the electromagnetic spectrum. These values correspond to the wave length of the corresponding satellite band. To get elevation from just the raw values would be impossible. The only potential means to collect elevation information would ...


7

The three sensors are all slightly different. However the OLI/TIRs setup is a marked departure from the TM/ETM+ sensors. The changes are succintly summarised by Li et al. 2013 as the: replacing of whisk-broom scanners with two separate push-broom OLI and TIRS scanners, an extended number of spectral bands (two additional bands provided) and narrower ...


7

A brief explanation can be found in the pdf file 'Landsat 8 (L8) Data Users Handbook', available from landsat.usgs.gov. On page 9, first paragraph, it is said: The OLI panchromatic band, Band 8, is also narrower relative to the ETM+ panchromatic band to create greater contrast between vegetated areas and land without vegetation cover. This would be in ...


7

for i in range(start,end-1): should be for i in range(start,end+1): Tested it, and your code works fine.


7

Here is a more flexible approach that can handle dual (or larger) bit patterns. The bit shifts are performed server-side, using the ee.Image.rightShift() and ee.Image.mod() methods. var RADIX = 2; // Radix for binary (base 2) data. var extractQABits = function (qaBand, bitStart, bitEnd) { var numBits = bitEnd - bitStart + 1; var qaBits = qaBand....


7

You should read about the Landsat 7 ETM+ SLC-off data This refers to all Landsat 7 images collected after May 31, 2003, when the Scan Line Corrector (SLC) failed. These products have data gaps, but are still useful and maintain the same radiometric and geometric corrections as data collected prior to the SLC failure. https://www.usgs.gov/landsat-missions/...


6

As you've probably found, removing clouds from Landsat imagery is not a trivial problem. There is a decent amount of scholarly research about methods for implementing masking and correction for clouds and their shadows. So due to the complexity of this issue, you probably won't find any one size fits all solutions that work perfectly out of the box. That ...


6

Satellite zenith angle Images from Landsat 1 - 7 are always nadir. In other words, their satellite zenith angle is close to 0°. Likewise, the _MTL.txt you posted corresponds to a Landsat 5 image, and so is a nadir image. Off-Nadir imagery has been introduced with Landsat 8. Landsat 8 images have a field NADIR_OFFNADIR in their _MTL.txt metadata. The ...


6

Manually using a stereoscope with a high enough resolution image, it is possible to estimate stand height. Although Landsat has a 30meter resolution and is too crude to estimate tree height. (LIDAR data would be necessary if your set on using Landsat) Depending upon the species your trying to measure NAIP imagery may be a better option, with a 1 meter ...


6

Since Landsat satellites are not placed a true polar orbit -- they are in a "near polar" orbit -- their heading (azimuth) is never zero. See NASA's Landsat Handbook and Landsat Science. It is closest to zero at the equator (8.2°) but deviates from this the closer it gets to the poles. Thus, yes, knowing the center coordinates (latitude, actually) of the ...


6

ROIs in ENVI are stored in pixel-based co-ordinates, with no geographic information at all. The size of the image used to create the ROI is stored in the ROI file, and when you open the ROI list for an image it only displays the currently loaded ROIs that match the image dimensions. Although your images are all of the same location, in the same projection ...


6

Answer for others so confused people as I am: To know how to deal with downloaded raw Landsat data - what else in pre-processing do I need? Firstly check their processing level in_MTL.txt file (included in downloaded Landsat image: http://landsat.usgs.gov/Landsat_Processing_Details.php) Processing level = DATA_TYPE L1T - terrain corrected processing. ...


6

Matt Hansen's team has a paper published on forest cover change in Eastern Europe that goes back to 1985 - see Eastern Europe's forest cover dynamics from 1985 to 2012 quantified from the full Landsat archive http://www.sciencedirect.com/science/article/pii/S0034425714004817 I'm also checking with colleagues on whether Matt Hansen's algorithm is available ...


6

This is almost a duplicate of this post, but you have an additional cropping step, so I'll post a new solution. Given your .img files all have identical extent and resolution, you can save a lot of hassle by stacking them from the start (you can pass a vector of file names to raster::stack). You can then crop the stack in one shot, and write them all out ...


6

Your question is two-fold. With regards to the actual atmospherically corrected data: there is no simple method for testing if the calculated reflectance values are right. However, the simplest approach is to compare the resulting spectras to known spectras from the literature. Which bit of literature you need to find depends on your area / local ecosystem ...


Only top voted, non community-wiki answers of a minimum length are eligible