Land Surface Temperature in Earth Engine [GEE]
HTML-код
- Опубликовано: 30 ноя 2021
- Land Surface temperature in GEE (brief guide):
-
We follow the tutorial available: developers.google.cn/earth-en...
Comments are welcomed.
Thankyou!
-
#GoogleEarthEngine #GEE
// CODES HERE
///
///
///
// Import country boundaries feature collection.
var dataset = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017');
var np = dataset.filter(ee.Filter.eq('country_na', 'Nepal'));
print(np);
Map.centerObject(np, 6);
Map.addLayer(np);
// Import LST image collection.
var modis = ee.ImageCollection('MODIS/MOD11A2');
// Define a date range of interest; here, a start date is defined and the end
// date is determined by advancing 1 year from the start date.
var start = ee.Date('2015-01-01');
var dateRange = ee.DateRange(start, start.advance(5, 'year'));
// Filter the LST collection to include only images intersecting the desired
// date range.
var mod11a2 = modis.filterDate(dateRange);
// Select only the 1km day LST data band.
var modLST = mod11a2.select('LST_Day_1km', 'LST_Night_1km');
print(modLST);
var inCelsius = modLST.map(function(img){
return img.multiply(0.02).subtract(273.15)
.copyProperties(img, ['system:time_start']);
});
print('converted', inCelsius);
// Chart time series of LST for Uganda in 2015.
var ts1 = ui.Chart.image.series({
imageCollection: inCelsius,
region: np,
reducer: ee.Reducer.median(),
scale: 1000,
xProperty: 'system:time_start'})
.setOptions({
title: 'LST 2015 Time Series',
vAxis: {title: 'LST Celsius'}});
print(ts1);
var clippedDay = inCelsius.select('LST_Day_1km').median().clip(np);
var clippedNight = inCelsius.select('LST_Night_1km').median().clip(np)
// Add clipped image layer to the map.
Map.addLayer(clippedDay, {
min: 3, max: 30,
palette: ['blue', 'limegreen', 'yellow', 'darkorange', 'red']},
'Mean Day temperature, 2015');
Map.addLayer(clippedNight, {
min: 3, max: 30,
palette: ['blue', 'limegreen', 'yellow', 'darkorange', 'red']},
'Mean Night temperature, 2015');
// Export the image to your Google Drive account.
Export.image.toDrive({
image: clippedDay,
description: 'LST_Celsius_ug',
folder: 'my_folder',
region: np,
scale: 1000,
crs: 'EPSG:4326',
maxPixels: 1e10});
Thanks 😊 🫂
That's fine..... Based on you have sent code, we have calculated day and night time temperature and we will get one chart..... after that in your video, you got *two different charts* which mean you were separated *day time temperature of the year and night time temperature of the year in the Nepal* and got two different charts also
*'LST_Day_1km', 'LST_Night_1km'*
👆That code, i want..... because i did based on your video but i have got some errors *to define two different charts....* That's why i ask the code.
So, Could you please make your code available? It would be helpful to me
Madam,
I'm also, want to get two different chars that mean LST_DAY_1KM AND LST_Night_1km charts per year. According to your code we got one charts. But on your video, you got two different charts. And you didn't make the code for that one. If you don't mind, could you please modify and pin it. It will be helpful.
Could you please make a code for average land surface temperature in nepal based on your video?
@@pavanathankalistan9212 you can adapt these codes for the cart, above is the rough codes:
developers.google.cn/earth-engine/guides/charts_image_collection?hl=zh-cn#uichartimagedoyseriesbyyear
nice
:)
Great job Sir.Sir please make your code available. Me too working on MODIS monthly LST data.
Codes are from the earth engine tutorials:
developers.google.cn/earth-engine/tutorials/community/ph-ug-temp?hl=zh-cn
If you need more help, let me know. You can message in the facebook page. facebook.com/ktmagarsYT
Thankyou for the comments.
Great video. Can u pls tell me how to do the average land surface temparature for the past 50 years and show it like the heatmap
Thankyou for the comment and the question. We can probably do this by filtering the temperature data for the past fifty years and doing the .mean() to that image collection. Then apply colors to the averaged image.
There is this data giving us the surface temperature from 1948. But we can see the data is too coarse with resolution of 278300m.
developers.google.com/earth-engine/datasets/catalog/NCEP_RE_surface_temp#bands
The popular one is the MODIS based available from the year 2000.
developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD11A1
We can do such average map for small area as this might be intensive for earth engine to show up if you do of the whole world. But the basic idea is to do the .mean() after filtering the image collection or selecting the band.
Hope my comment helps.
Thankyou for the comment.
@@ksabmagar7 Can I do that for Assam ?
@@Rishav_Sinha Yes, use the shape file of Assam as geometry.
Thanks you so much this tutorials, its very useful. While doing this analysis I am getting this error 'Unexpected arguments to function doySeriesByYear(): sameDay" . I think this is due to region is geometry. Also, in your code no where you have mentioned geometry as variable. Need your help!
Thanking you!
For charts, please find the page there: developers.google.cn/earth-engine/guides/charts_image_collection?hl=zh-cn
For the geometry, we are filtering the country from boundary dataset, we can make create our own geometry too from the drawing tools, hope this helps
Excellent job....
Could you please make your code available? I'm trying to do work on LSTdata set.
codes in the pinned comment, hope it helps, thanks!
Good job. Pls any links to the code? Maybe on the youtube notes
Thankyou for the comment. We are learning the tutorial from the guides from this link, it also contains many other resources. developers.google.cn/earth-engine/tutorials/community/ph-ug-temp?hl=zh-cn
codes in the pinned comment now, should have done earlier, thanks!
Excellent job. Could you make your code available? I'm trying to work with MODIS monthly climatologies from 2000 to 2020. Thank you very much.
We are following most of the codes from the earth engine guides and tutorials: developers.google.cn/earth-engine/tutorials/community/ph-ug-temp?hl=zh-cn
developers.google.cn/earth-engine/guides/charts_image_collection?hl=zh-cn#uichartimagedoyseriesbyyear
--- If there are any more questions, please let me know. Thankyou for the comment.
codes in the pinned comment, if it's still relevant please check, thankyou
Hi! How do I calculate the LSD for a specific state ir field?...
Hi, there are different geometry boundaries dataset in earth engine. If there are any of your area, you can we use that. You can also upload your own shape file in the assets. Or you can use drawing tools to create your own geometry. Thanks
Hi is there a way I can change it from an 8-day average for the year to instead every day of the year?
You can check daily LST data. developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD11A1
How we could convert and aggregate 8-day MODIS to monthly?
If possible find the monthly data otherwise, we can develop the function to aggregate all the 8 days data contained within a month to calculate their mean/median.
If its for few months, then try filtering and summing the data. May be my comment helps. Thankyou for the comment.
I'm doing LST for nepal based on your coding so, why am i change scale?
I got errors from region. Can you please sent your code for last one which mean.. *To define the chart and print it to the console part...* Please
codes in the pinned comment, thanks
Could you please make a code for average land surface temperature in nepal based on your video?
.mean() does it.
How get training from you. How can I get that .
No such trainings from me now. I hope I will be create such materials in future. thankyou for your question.
What is the data type used be in here? And how do we identify the data type?
If you wish to check the data type of the band, you can try printing few of the data on the console, and try checking the data type by further inspection in the bands.
I hope my comment helps in some extent.
Thankyou
@@ksabmagar7 Thank you so much.... I think "MODIS" is the data type. Is that correct??
@@tharshikatharshi5767 no, MODIS is the satellite, anything that the satellite captures are made as the products.
You can see them in earth engine data catalogue:
developers.google.com/earth-engine/datasets/catalog/modis
We can say probably MODIS product, the product here is MOD11A1 V6.1 product.
developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD11A1
Data types are the something else, they are just how the values are stored in the computer.
en.wikipedia.org/wiki/Data_type
Hope this helps.
thankyou
Dear sir/ madam
I'm following to make the Land surface temperature in nepal but i got one of error which mean
*to define the chart and print it to the console*
On that part to define *region : geometry ;*
Could you please explain why are you putting the geometry? If i put region: np;
👆 That one also error.....
Please help to me... It would be grateful.
probably changing the scale will work, thankyou
Very useful tutorial. Would you share us validation approaches for LST from Satellite?
I wish I could share more on that, however, I do not have that much knowledge in the validation approaches. The best I can think of is to compare with the data from the weather stations if near by. -Thankyou for the comment.
@@ksabmagar7 Thank you for your immediate response. The available weather station data is commonly air temperature ,but not LST.
- yes, but i think that will be the one way to relate the weather station data with land surface temperature, i think we need to be sure at what height the weather station data takes the weather station data, and similar for the case of satellite based data (i know usually of 2 m above the surface), there I think are works relating the two.
-there may also be the ground bases sensors for temperatures also
(again i am saying all from the guesses, hope this helps)
thanks!
@@ksabmagar7 Thank you!
Is it possible to download MODIS data in hdf or nc format from google earth engine?
I see that is not possible for now. If we check the reference page, it says "Currently only 'GeoTIFF' and 'TFRecord' are supported, defaults to 'GeoTIFF'."
developers.google.com/earth-engine/apidocs/export-image-todrive
@@ksabmagar7 Thanks for your reply.Do you think is there any way to download data?
@@annmaryvincent4209 Yes, you can download from earth explorer in hdf.
earthexplorer.usgs.gov
@@ksabmagar7 thank youuu!
Could you provide the code from step 5 as there are some problems occurred during my work ?
Which line?
@@ksabmagar7
linewidth:2
colors:['red','blue','green','black','orange'],
});
Print(Chart1); ....SyntaxError: Unexpected token (107:3)
Check commas and brackets here and there. They can cause errors sometimes.
@@ksabmagar7 It would be better if you share the Codes form //5 to last. Thank You.
You can do something like this
///////////////////
var bands = ee.ImageCollection('MODIS/061/MOD11A2')
.filter(ee.Filter.or(
ee.Filter.date('2001-01-01', '2002-01-01'),
ee.Filter.date('2019-01-01', '2020-01-01')))
.select(['LST_Day_1km'])
.map(function(img){
return img.multiply(0.02).subtract(273.15)
.copyProperties(img, ['system:time_start']);
});
// Define the chart and print it to the console.
var chart = ui.Chart.image
.doySeriesByYear({
imageCollection: bands,
bandName:'LST_Day_1km',
region: np,
regionReducer: ee.Reducer.mean(),
scale: 1000,
sameDayReducer: ee.Reducer.mean(),
startDay: 1,
endDay: 365
})
.setOptions({
title: 'Temperature',
hAxis: {
title: 'Day of year',
titleTextStyle: {italic: false, bold: true}
},
vAxis: {
title: 'Celsius',
titleTextStyle: {italic: false, bold: true}
},
lineWidth: 3,
colors: ['39a8a7', '9c4f97'],
});
print(chart);
////////////////////
codes are from the guides.
developers.google.com/earth-engine/guides/charts_image_collection
No features contain non-null values of "system:time_start".
No images in the collection intersect the specified regions.
these two type of error it give me when i uploaded my area of interest. pls help me to this issue. thanks
Thankyou for the question. This happens when the system:time_start property is missing when we are just selecting the bands, do some operations, and try to do charts.
There, I see, has a discussion about it. The way to minimize is to add the time property by .set
please check the link.
stackoverflow.com/questions/51542758/error-generating-chart-no-features-contain-non-null-values-of-systemtime-star
hope it helps.
thankyou
respected i am from pakistan, and it will give me big help if you people solve this problem.
@@farhadullah9933 not far, I am from Nepal too. Actually there is only me. I am a learner too. I will try to help if I can. : )
@@ksabmagar7 thank u sir alot, i am trying ti remove that, because i need this analysis badly
@@ksabmagar7 sir i did't solve the issue from this. sir if possible pls solve this problem, i will share my province shapfile with you.
Sir/madam....
I'm doing that but i have some of errors.
Could you please upload the land surface temperature coding for nepal....
Hi, the codes are from the earthengine tutorials, change the region there, you will be fine.
Thanks!
developers.google.cn/earth-engine/tutorials/community/ph-ug-temp?hl=zh-cn
@@ksabmagar7 Thank u so much😍 but i want to know the nepal Land surface temperature..... Plz let me know 🙏
Yes, the video content is trying to do for Nepal.