Calculating incoming net radiation using Google Earth Engine? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Calculating cost distance in Google Earth Engine?LinearFit with Google Earth EngineCalculating areas of different classes in Google Earth Engine?Google Earth Engine - Map.addLayerGetting image band statistics in Google Earth Engine codeTemporal segmentation algorithms using Google Earth EngineClassification of NDVI using Google Earth EngineImage Collection Statistics in Google Earth Engine?Calling Google Earth Engine scripts using Python?Using if statement in Google Earth Engine?
How do spell lists change if the party levels up without taking a long rest?
What can I do if neighbor is blocking my solar panels intentionally?
Homework question about an engine pulling a train
1960s short story making fun of James Bond-style spy fiction
Is an up-to-date browser secure on an out-of-date OS?
Button changing its text & action. Good or terrible?
how can a perfect fourth interval be considered either consonant or dissonant?
Presidential Pardon
Sort list of array linked objects by keys and values
"... to apply for a visa" or "... and applied for a visa"?
What aspect of planet Earth must be changed to prevent the industrial revolution?
Do working physicists consider Newtonian mechanics to be "falsified"?
Can withdrawing asylum be illegal?
Python - Fishing Simulator
Am I ethically obligated to go into work on an off day if the reason is sudden?
My body leaves; my core can stay
Example of compact Riemannian manifold with only one geodesic.
Could an empire control the whole planet with today's comunication methods?
Are there continuous functions who are the same in an interval but differ in at least one other point?
How do I design a circuit to convert a 100 mV and 50 Hz sine wave to a square wave?
Did the new image of black hole confirm the general theory of relativity?
Intergalactic human space ship encounters another ship, character gets shunted off beyond known universe, reality starts collapsing
Is 'stolen' appropriate word?
Was credit for the black hole image misappropriated?
Calculating incoming net radiation using Google Earth Engine?
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Calculating cost distance in Google Earth Engine?LinearFit with Google Earth EngineCalculating areas of different classes in Google Earth Engine?Google Earth Engine - Map.addLayerGetting image band statistics in Google Earth Engine codeTemporal segmentation algorithms using Google Earth EngineClassification of NDVI using Google Earth EngineImage Collection Statistics in Google Earth Engine?Calling Google Earth Engine scripts using Python?Using if statement in Google Earth Engine?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am a beginner with GEE and I am trying to calculate the incoming net radiation for that I need the square inverse of relative earth sun distance using the expression dr = 1 + 0.033*cos(J*2*pi/365) where J is the day of year.
Can someone help me with this code?
var sequence = ee.List.sequence(1, 365);
var dr2 = sequence.divide(365).multiply(Math.PI).cos().add(1);
and alternatively I used
var addDate = function(image)
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
return image.addBands(doyBand);
;
var image = ee.ImageCollection('LANDSAT/LT05/C01/T2')
.filterDate('1987-01-01', '1990-05-01')
.filterBounds(geometry);
var withDate = image.map(addDate);
print(withDate);
Map.addLayer(withdate);
var dr = withDate.divide(365).multiply(Math.PI).cos().add(1);
google-earth-engine statistics
New contributor
add a comment |
I am a beginner with GEE and I am trying to calculate the incoming net radiation for that I need the square inverse of relative earth sun distance using the expression dr = 1 + 0.033*cos(J*2*pi/365) where J is the day of year.
Can someone help me with this code?
var sequence = ee.List.sequence(1, 365);
var dr2 = sequence.divide(365).multiply(Math.PI).cos().add(1);
and alternatively I used
var addDate = function(image)
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
return image.addBands(doyBand);
;
var image = ee.ImageCollection('LANDSAT/LT05/C01/T2')
.filterDate('1987-01-01', '1990-05-01')
.filterBounds(geometry);
var withDate = image.map(addDate);
print(withDate);
Map.addLayer(withdate);
var dr = withDate.divide(365).multiply(Math.PI).cos().add(1);
google-earth-engine statistics
New contributor
add a comment |
I am a beginner with GEE and I am trying to calculate the incoming net radiation for that I need the square inverse of relative earth sun distance using the expression dr = 1 + 0.033*cos(J*2*pi/365) where J is the day of year.
Can someone help me with this code?
var sequence = ee.List.sequence(1, 365);
var dr2 = sequence.divide(365).multiply(Math.PI).cos().add(1);
and alternatively I used
var addDate = function(image)
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
return image.addBands(doyBand);
;
var image = ee.ImageCollection('LANDSAT/LT05/C01/T2')
.filterDate('1987-01-01', '1990-05-01')
.filterBounds(geometry);
var withDate = image.map(addDate);
print(withDate);
Map.addLayer(withdate);
var dr = withDate.divide(365).multiply(Math.PI).cos().add(1);
google-earth-engine statistics
New contributor
I am a beginner with GEE and I am trying to calculate the incoming net radiation for that I need the square inverse of relative earth sun distance using the expression dr = 1 + 0.033*cos(J*2*pi/365) where J is the day of year.
Can someone help me with this code?
var sequence = ee.List.sequence(1, 365);
var dr2 = sequence.divide(365).multiply(Math.PI).cos().add(1);
and alternatively I used
var addDate = function(image)
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
return image.addBands(doyBand);
;
var image = ee.ImageCollection('LANDSAT/LT05/C01/T2')
.filterDate('1987-01-01', '1990-05-01')
.filterBounds(geometry);
var withDate = image.map(addDate);
print(withDate);
Map.addLayer(withdate);
var dr = withDate.divide(365).multiply(Math.PI).cos().add(1);
google-earth-engine statistics
google-earth-engine statistics
New contributor
New contributor
edited Apr 7 at 7:51
PolyGeo♦
53.9k1782246
53.9k1782246
New contributor
asked Apr 7 at 5:47
Bhumika OjhaBhumika Ojha
83
83
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You prabably want to calculate the dr on a per image basis, similar as you did for calculating the doy. That's why you will have to map over the image collection. You could add the dr function inside the function were you calculate the doy.
As your function in the question differs from the function you typed in the code below it, I assumed you want to use this: dr = 1 + 0.033*cos(J*2*pi/365):
// and alternatively I used
var addDate = function(image)
// calculate the doy band
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
// calculate the dr using: dr = 1 + 0.033*cos(J*2*pi/365)
var temp = doyBand.multiply(2).multiply(Math.PI).divide(365);
var temp2 = temp.cos();
var dr = temp2.multiply(0.033).add(1).rename('dr');
// add the bands to the image
return image.addBands([doyBand, dr]);
;
I wrote it down in multiple lines so you are less likely to mix up the order of the functions. Link code.
For the list you calculated (possibly as check), you will need to cast the list to an ee.Array() to be able to do element-wise operations:
var sequence = ee.Array(ee.List.sequence(1, 365));
var dr2 = sequence.multiply(2).divide(365).multiply(Math.PI).cos().multiply(0.033).add(1);
print(dr2)
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Bhumika Ojha is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318013%2fcalculating-incoming-net-radiation-using-google-earth-engine%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You prabably want to calculate the dr on a per image basis, similar as you did for calculating the doy. That's why you will have to map over the image collection. You could add the dr function inside the function were you calculate the doy.
As your function in the question differs from the function you typed in the code below it, I assumed you want to use this: dr = 1 + 0.033*cos(J*2*pi/365):
// and alternatively I used
var addDate = function(image)
// calculate the doy band
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
// calculate the dr using: dr = 1 + 0.033*cos(J*2*pi/365)
var temp = doyBand.multiply(2).multiply(Math.PI).divide(365);
var temp2 = temp.cos();
var dr = temp2.multiply(0.033).add(1).rename('dr');
// add the bands to the image
return image.addBands([doyBand, dr]);
;
I wrote it down in multiple lines so you are less likely to mix up the order of the functions. Link code.
For the list you calculated (possibly as check), you will need to cast the list to an ee.Array() to be able to do element-wise operations:
var sequence = ee.Array(ee.List.sequence(1, 365));
var dr2 = sequence.multiply(2).divide(365).multiply(Math.PI).cos().multiply(0.033).add(1);
print(dr2)
add a comment |
You prabably want to calculate the dr on a per image basis, similar as you did for calculating the doy. That's why you will have to map over the image collection. You could add the dr function inside the function were you calculate the doy.
As your function in the question differs from the function you typed in the code below it, I assumed you want to use this: dr = 1 + 0.033*cos(J*2*pi/365):
// and alternatively I used
var addDate = function(image)
// calculate the doy band
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
// calculate the dr using: dr = 1 + 0.033*cos(J*2*pi/365)
var temp = doyBand.multiply(2).multiply(Math.PI).divide(365);
var temp2 = temp.cos();
var dr = temp2.multiply(0.033).add(1).rename('dr');
// add the bands to the image
return image.addBands([doyBand, dr]);
;
I wrote it down in multiple lines so you are less likely to mix up the order of the functions. Link code.
For the list you calculated (possibly as check), you will need to cast the list to an ee.Array() to be able to do element-wise operations:
var sequence = ee.Array(ee.List.sequence(1, 365));
var dr2 = sequence.multiply(2).divide(365).multiply(Math.PI).cos().multiply(0.033).add(1);
print(dr2)
add a comment |
You prabably want to calculate the dr on a per image basis, similar as you did for calculating the doy. That's why you will have to map over the image collection. You could add the dr function inside the function were you calculate the doy.
As your function in the question differs from the function you typed in the code below it, I assumed you want to use this: dr = 1 + 0.033*cos(J*2*pi/365):
// and alternatively I used
var addDate = function(image)
// calculate the doy band
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
// calculate the dr using: dr = 1 + 0.033*cos(J*2*pi/365)
var temp = doyBand.multiply(2).multiply(Math.PI).divide(365);
var temp2 = temp.cos();
var dr = temp2.multiply(0.033).add(1).rename('dr');
// add the bands to the image
return image.addBands([doyBand, dr]);
;
I wrote it down in multiple lines so you are less likely to mix up the order of the functions. Link code.
For the list you calculated (possibly as check), you will need to cast the list to an ee.Array() to be able to do element-wise operations:
var sequence = ee.Array(ee.List.sequence(1, 365));
var dr2 = sequence.multiply(2).divide(365).multiply(Math.PI).cos().multiply(0.033).add(1);
print(dr2)
You prabably want to calculate the dr on a per image basis, similar as you did for calculating the doy. That's why you will have to map over the image collection. You could add the dr function inside the function were you calculate the doy.
As your function in the question differs from the function you typed in the code below it, I assumed you want to use this: dr = 1 + 0.033*cos(J*2*pi/365):
// and alternatively I used
var addDate = function(image)
// calculate the doy band
var doy = image.date().getRelative('day', 'year');
var doyBand = ee.Image.constant(doy).uint16().rename('doy');
doyBand = doyBand.updateMask(image.select('B2').mask());
// calculate the dr using: dr = 1 + 0.033*cos(J*2*pi/365)
var temp = doyBand.multiply(2).multiply(Math.PI).divide(365);
var temp2 = temp.cos();
var dr = temp2.multiply(0.033).add(1).rename('dr');
// add the bands to the image
return image.addBands([doyBand, dr]);
;
I wrote it down in multiple lines so you are less likely to mix up the order of the functions. Link code.
For the list you calculated (possibly as check), you will need to cast the list to an ee.Array() to be able to do element-wise operations:
var sequence = ee.Array(ee.List.sequence(1, 365));
var dr2 = sequence.multiply(2).divide(365).multiply(Math.PI).cos().multiply(0.033).add(1);
print(dr2)
edited Apr 7 at 8:48
answered Apr 7 at 8:43
KuikKuik
2,4521214
2,4521214
add a comment |
add a comment |
Bhumika Ojha is a new contributor. Be nice, and check out our Code of Conduct.
Bhumika Ojha is a new contributor. Be nice, and check out our Code of Conduct.
Bhumika Ojha is a new contributor. Be nice, and check out our Code of Conduct.
Bhumika Ojha is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318013%2fcalculating-incoming-net-radiation-using-google-earth-engine%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown