Hot answers tagged

6

Per https://lpdaac.usgs.gov/dataset_discovery/modis, the viewing swath width of MODIS is 2,330 km, thus a large portion of the image is off-nadir in some way. https://modis.gsfc.nasa.gov/about/specifications.php The following forum post gives an explanation of how to calculate pixel size based on viewing position. (Note: still an estimate due to factors ...


5

You just need the function 'toBands()' and apply that on the image collection. Unfortunately, the function cannot deal with similar band names (at least, for your MODIS collection: it works fine for landsat and Sentinel), so you will need to change the band names. For simplicity, I changed the band names to the date the image was acquired. Update: bandnames ...


4

If you check the MODIS Vegetation Index User’s Guide (page 9) or the MODIS MOD13Q1 product page you will see MODIS uses a scaling factor of 0.0001 and has a valid range from -2000 to 10000. In order to get values between -1 and 1, you have to multiply the values by the scaling factor.


3

Suppose the following files: MOD13Q1.A2007049.h26v06.006.2015161224938_MODIS_Grid_16DAY_250m_500m_VI.tif MOD13Q1.A2007051.h26v06.006.2015161224938_MODIS_Grid_16DAY_250m_500m_VI.tif and that they are stored in directory C:/modis_files Run: setwd('C:\\modis_files') #path to folder where MODIS files are. file.rename(list.files(), paste(as.Date(substr(list....


3

If you were to use R language (open source), this will work. setwd("C:/modis") #path of modis files li<-as.data.frame(list.files(pattern = ".tif|.TIF")) li$nn<-paste0(substr(li[,1],1,9),format(as.Date(substr(li[,1],10,16), "%Y%j"),"%Y.%m.%d"),substr(li[,1],17,75)) for(i in 1:nrow(li)){ file.rename(as.character(li[i,1]),li[i,2]) }


3

You partitioned your code in a way that obscures what object types you are actually using and what led you to the point that you are stuck. In the future please try to clarify your question before asking, ideally providing example data (note; we do not care about a picture of your polygons). Also, please include the package dependencies, and all of your code ...


3

Here is a modification of the first example from this presentation about tables and vectors. Note that you can "transpose" the table if there are other properties in the points that are of interest: var rectangle = ee.Geometry.Rectangle(96.01669, 18.52621, 96.04819, 18.49634); Map.centerObject(rectangle); Map.addLayer(rectangle, {}, 'rectangle') var ...


3

Below are some resources related to AppEEARS that should help with some of the things you are trying to accomplish with MODIS data. Using the AppEEARS API, you can determine product availability, and submit requests for a host of geospatial datasets from a variety of federal data archives (including MODIS version 6 data). When submitting an AppEEARS Area ...


3

As you want to calculate the number of days between the first and last day where the temperature dropped below zero, you will have to change the scaled Kelvin values first to temperature in degrees. In this post I came across a definition for that: // map over the image collection and use server side functions var tempToDegrees = NightSA.map(function(image){...


2

Using gdal in python, you could open the first file and use those values as your "base-values". Then looping over the rest of your files, comparing the base-values with the just opened values and each time selecting the maxes (or minuses). Something like this: # Create a list of files, have a look at glob.glob() to list many files. files = [r"D:\some_path\...


2

For anyone that wants a Python approach, try the following: import datetime, os, glob inws = '/path/to/tiff/workspace' tiffs = glob.glob(os.path.join(inws, "*.tif")) for tiff in tiffs: julien_date = os.path.basename(tiff)[11:16] # Extract the julien date string date = datetime.datetime.strptime(julien_date, '%y%j').date() # Format date ...


2

MODIS imagery is publicly available via satellite imagery service called LandViewer. You can download it with ease via the toolbar on the right or use dozens of tools for image analysis directly on the platform. Besides that there are already ready-made tools for obtaining multispectral indices, flexible processing of data on AOI, elementary clustering, ...


2

Alright, I found it. It turns out that cv2.imread() is not a good idea for reading TIFF files. This was distorting the data is got and consequently messing up the numbers. Now, if you use from PIL import Image, and use Image.open(), the data is read correctly.


2

Earth Engine provides very nice functionality to calculate statistics on imagery called reducers. There are plenty of ways to use reducers but as simple examples you can calculate the statistics at the pixel level or provide a geometry to calculate statistics: var modis = ee.ImageCollection("MODIS/006/MOD13Q1") .filterDate("2000-01-01","2001-01-01") .select(...


2

Something like this, append dicts to an empty list. It seems from your example output, you may want to do this inside a function that you can pass the path of the target raster. Note the ??? means you will have to implement something. Maybe your year comes from the filename? import pandas as pd raster_filename = "D:/script/NDVI2000.tif" raster = gdal.Open(...


2

It is computed directly from the MCD43A4 imagery and clamped to [-1, 1]. That's it.


2

If you're interested in just using QA information from Bands 1 and 2, this should get you started. Note that most of the code below is the same as yours, just re-organized a bit. You're off to a great start! Also note that the final image collection contains 1159 images, and only the first of those is being added to the map in the final step. var geometry = ...


2

first2001 is in milliseconds since 1970-01-01T00:00:00Z to turn that back into a date that you will be able to understand, just make this change. var first2001 = ee.Date(count2001.first().get('system:time_start')); // sort the collection in descending to find the last var last2001 = ee.Date(count2001.sort('system:time_start',false).first().get('system:...


2

If I understand you well, you want to repeat the same operation, over different time periods? Let's say you want to do this per year, I would do it along this way: Add a year property in your initial ImageCollection Extract a dictionnary of the years in the ImageCollection Now, map this dictionnary over your function of interest: filter ImageCollection for ...


2

This could be a GEE bug exporting to MODIS sinusoidal projection, I'm not sure. but, a fast workaround is to export to a different CRS: Export.image.toDrive({ image: vi, description: 'Gondiya_NDVI_30Sept', scale: 250, crs: 'EPSG:4326', region: geometry, fileFormat: 'GeoTIFF', formatOptions: { cloudOptimized: true }, maxPixels: 1e12 }); ...


2

I'm not exactly sure what you're looking for, but if it is to pare down the landcover layer to only water/not water, then you can do something like the following, which selects only the LC_Type1 band, loops through each image in the image collection and creates a boolean output for whether or not the band value equals 17. var Landcover = ee.ImageCollection("...


1

You have to do it like this: batch.Download.ImageCollection.toDrive(modisNDVI, 'modisNDVI', { scale: 250, region: geom.getInfo() }) At Exporting entire ImageCollection in Google Earth Engine using geetools for JavaScript or Python for Windows? and here Rodrigo explains how his gee tools work.


1

If you are interested in the MODIS sst of a composite image between the dates you have set at every of your sample points, you can simply use reduce regions: var addTempMODIS = modisSST.reduceRegions({collection: point_samples, reducer: ee.Reducer.mean(), scale: 500 }); ...


1

This can be easily accomplished by using reduceRegion(s) on an image. However, you have an image collection consisting of one band per image. Therefore, you will have to reduce the imagecollection to a multiband image first. How that is done, you can find HERE From that multiband image if the land surface temperature in degrees, you can get the temperature ...


1

You should improve two things: First, the GEE requires server side function, which you can read here. Secondly, you should apply this per pixel formula of temperature on images, instead of on a image collection (which temperature is). That can be achieved by mapping the collection over its images. This is how I would apply your function on the images: // ...


1

Interestingly it seems this product did not survive the transition from Version 5 to Version 6 processing and production was terminated after March 14, 2017. According to the slides presented by Crystal Shaaf at the ESA LPVE 2014 Land Product Validation and Evaluation Workshop this product was considered redundant and was discontinued in Collection 6 in ...


1

From documentation: Numeric or vector of numerics. Quality control values to keep in the data. If bit is set to TRUE QC_val is a BYTE (hexadecimal or decimal) where each bit refers to a bit in the QC layer element (i.e.: bitpos = 0xA1 targets bits 7, 5 and 0 --- 1010 0001). When bits targetted by QC_val are activated, the corresponding observation ...


1

If you read the help for the rts function you will see: Usage: rts(x, time) Arguments: x: A character vector including names of image/raster files, or ‘RasterStack’ or ‘RasterBrick’ object, or the name (character) of a raster time series file So the first argument can be a list of names, or a RasterStack.


1

The package computes the QA's but it does not produce new images which contain only the pixels with the best quality.


1

I think you just want: df2 = pd.DataFrame(data2, columns = data2[0]) See this blog post for more info: https://mygeoblog.com/2017/01/13/your-gee-data-in-pandas/


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