I'm trying to find ...

Clear all

# I'm trying to find the AQI values in GEE using sentinel 5 for my project but I'm referring someone else code. can anyone give me the correct code

1 Posts
1 Users
0 Likes
0 Views
Illustrious Member
Joined: 4 months ago
Posts: 57427
Topic starter

var collection = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_NO2");
select
(’ tropospheric_NO2_column_number_density ’) .
filterDate (’2020 -01 -01 ’, ’2020 -06 -30 ’) ;
var geom = geometry . buffer (500) ;
var timeSeries2019 = collection2019 . map ( function ( image ) {
var date = image . date () . format (’yyyy -MM -dd ’)
var value = image
. clip ( geom )
. reduceRegion ({
reducer : ee . Reducer . mean () ,
scale : 30
}) . get (’ tropospheric_NO2_column_number_density ’)
return ee . Feature (null , { value : value , date : date })
})
// Show rectangle around ROI
var Parada2020 = collection . median () . clip ( geometry2 )
var band_viz = {
min : 0 ,
max : 0.0002 ,
palette : [’white ’, ’blue ’, ’purple ’, ’cyan ’, ’green ’, ’yellow ’, ’red ’] ,
opacity : 0.3
}
var timeSeries = collection . map ( function ( image ) {
var date = image . date () . format (’yyyy -MM -dd ’)
var value = image
. clip ( geom )
. reduceRegion ({
reducer : ee . Reducer . mean () ,
scale : 30
}) . get (’ tropospheric_NO2_column_number_density ’)
return ee . Feature (null , { value : value , date : date })
})
Export . table . toDrive ({
collection : timeSeries ,
selectors : ’date , value ’,
fileFormat : ’CSV ’
}) ;

## LCH space and radon measure

I’m trying to solve this exercise, but I have some doubts: I think point (b) is correct, but I’m not sure about point (a).

Let X be a locally compact Hausdorff topological space and let µ: S → [0, +∞] be a positive Radon measure on X.
Let $$T = bigcup{V : V text{ is open and }mu(V) = 0}$$
and $$text{supp}(mu)=T^C$$.
Prove that:

a) T is open and $$mu(T)=0$$
b) $$x in text{supp}(mu) iff int_X phi dmu >0$$$$phi in C_c(X)$$ | $${x} prec text{supp}(phi)$$.

a) T is open because it is a union of open sets.

How do I prove that it has measure zero?
Initially, I thought of using the inner regularity on open sets and approximating the measure of T with the measures of compact sets contained in T and then, by compactness, extracting a finite subcover of open sets.
However, I do not think I can do this because I cannot say that T contains compact sets.

Perhaps I could argue by contradiction, so assume $$mu(T)=c>0$$ and consider $$x in T$$.
If I could show that $$x in text{supp}(mu)$$, then I would have a contradiction, but I do not know how to do this.

b) $$(Leftarrow)$$
Assume the thesis does not hold, i.e., $$exists phi in C_c(X)$$ with $${x} prec text{supp}(phi)$$| $$int_X phi dmu =0$$.

By continuity, since $$phi(x)=1$$, there exists an open set V containing x on which $$phi$$ is non-zero, so $$0=int_X phi dmu=0 Rightarrow mu(V)=0$$.

Since V is open, it follows that $$V in T$$ and therefore $$x in T$$.
Then, $$x notin text{supp}(mu) =T^C$$, which contradicts the assumption.

$$(Rightarrow)$$
Assume the thesis does not hold, i.e., $$x notin text{supp}(mu)=T^C$$.
Then $$x in T$$ and by definition of T, $$exists$$ an open set $$V$$ with $$x in V$$ and $$mu(V)=0$$.
Since X is LCH, $${x}$$ is compact and $$V$$ is open with $${x} subset V$$, I can use the Urysohn lemma for LCH spaces and find $$phi in C_c(X)$$ such that $${x} prec text{supp}(phi) prec V$$.
Then $$int_X phi dmu = int_V phi dmu + int_{Xsetminus V} phi dmu = 0$$ because $$mu(V) = 0$$ and $$text{supp}(phi) subset V$$.
Therefore, if I negate the hypothesis, the thesis is false.

## How do we calculate the following integral \$int_{0}^{1} e^{tx}left[frac{1 – cos(2x)}{2x}right]mathrm{d}x\$?

For $$t>0$$, compute $$int_0^1 e^{t x} frac{1-cos 2x}{2x},dx$$

Is using the exponential integral the only way to compute this?

## Let \$F\$ be a field; what does \$(F)\$ mean?

Let $$L,K,L_1,L_2$$ be fields where $$L/K$$ is a field extension and $$K leq L_1,L_2 leq L$$ be intermediate fields.
We define $$L_1L_2$$ to be the subfield of $$L$$ generated by $$L_1 cup L_2$$

Show the following:
$$L_1L_2=L_1(L_2)=L_2(L_1)$$

My thoughts:
I am a little bit confused what the expression $$L_1(L_2)$$ means. I have not seen $$()$$ being defined for fields, nor what the multiplication of fields is.
The thing that comes to mind is:
Let R be a ring. For $$S subset R$$

$$(S):=bigcap {A: A$$ is an Ideal of $$R$$ with $$S subseteq A}$$

In this case does $$L_1L_2$$ mean the multiplication of ideals which would be $$L_1L_2:={a_1b_1+…+a_nb_n:a in L_1, b in L_2}$$

Is the meaning of the notation the same for fields as for rings?

## Proving my function is optimized in a particular regime

Consider the optimization problem:
$$max_{x geq 0} (1-x)fleft(gleft(xright)right)$$
where $$f'(x)< 0, f(1) = 0, f(0) = 1$$, and $$f$$ is differentiable. In addition, $$g$$ has the form:

$$g(x)= begin{cases} 1 & text{if } x < frac{c}{h_{max}}\ h^{-1}(c/x) & text{if } x in [frac{c}{h_{max}},frac{c}{h_{min}} ]\ 0 & text{if } x > frac{c}{h_{min}} end{cases}$$
where $$h^{-1}$$ is the inverse function of some function $$h$$ such that $$h(x) > 0$$, $$h'(x)>0$$ and $$h$$ is differentiable. Assume also that $$g$$ is continuous.

Now if $$c > {h_{max}}$$, the function is zero or negative over the entire domain, so the solution is characterized.

I am interested in the case where $$c$$ is small. It seems to be that for “small” $$c$$, the solution should be $$x = c/h_{min}$$.

A condition for this to be true is
$$frac{1 – frac{c}{h_{min}}}{1 – x} > f(g(x));; forall x < frac{c}{h_{min}}$$

I wonder if I can say for any fixed, $$f, g, h$$ under these assumptions then there exists some value $$k$$ such that $$forall c, $$x^* = c/h_{min}$$.

## Unable to access an instanced health system

I am having an issue with a health system I am making for my game. I have been at it for 3 days now and have not made much progress. For reference, I am following this tutorial by code monkey: Code Monkey Health Tutorial. The goal is to have two buttons, one for healing and one to damage the player, and a Text Mesh Pro UI Text to show the health of the player, just for testing purposes. Unlike the tutorial, the buttons and text are just on a canvas, not attached to the player, as I am setting it up as a form of a HUD system. also, forgive the formatting, during troubleshooting, I was more focused on trying to fix my issue and my code became a bit of a mess. Sorry for that.

I have three scripts

``````    using UnityEngine;

public class HealthSystem
{
private int _health;
private int _healthMax;

public HealthSystem(int healthMax)
{
this._healthMax = healthMax;
_health = healthMax;
Debug.Log("healthSystem Created");
}
public int GetHealth()
{
return _health;
}
public void Damage(int damageAmount)
{
_health -= damageAmount;
if (_health < 0) _health = 0;
}
public void Heal(int healAmount)
{
_health += healAmount;
if (_health > _healthMax) _health = _healthMax;
}
}

``````
``````    using UnityEngine;

public class GameHandler : MonoBehaviour
{
private HealthButtons _healthButtons;

private void Start()
{
HealthSystem _healthSystem = new HealthSystem(100);
Debug.Log("Health = "+_healthSystem.GetHealth());
_healthButtons.Setup(_healthSystem);
}
}
}
``````
``````using UnityEngine;
using TMPro;

public class HealthButtons : MonoBehaviour
{
[SerializeField]
private TextMeshProUGUI numberText;
private static HealthSystem _healthSystem;
private int intToStringHealth;

public void DamageButton()
{
_healthSystem.Damage(10);
Debug.Log(_healthSystem.GetHealth());
}
public void HealButton()
{
_healthSystem.Heal(10);
Debug.Log(_healthSystem.GetHealth());
}
public void Setup(HealthSystem healthSystem)
{
if (healthSystem == null) Debug.Log("healthSystem");
Debug.Log(healthSystem);
_healthSystem = healthSystem;
Debug.Log("Setup is running");
}
private void Update()
{
intToStringHealth = _healthSystem.GetHealth();
numberText.text = intToStringHealth.ToString();
}
}
``````

my issue currently is Im trying to create an instance of `HealthSystem` in `GameHandler`, which I am successful in, then pass the information to `HealthButtons` using `_healthButtons.Setup()`. This is where I become unsuccessful as I am getting a NullReferenceException error.

from my efforts of troubleshooting currently, I have determined I am not calling the instance correctly, but I do not want to use code monkey’s libraries. I have tried making all classes monoclasses and attaching them to game objects and using SerializeFields for all my variables, which does work, but I am not sure that is best practice as I do know linking everything up in the inspector can be a chore if something goes wrong.

This tells me the solution should be fairly simple, I am just not able to articulate the question into google to get the correct answer. It may be a bit overkill just to test a function, but I would like to understand what I am doing wrong and get better. Thank you very much for your help.

## Deriving the log likelihood of the observed data

Hi, I am deriving the log likelihood of the observed data in part a. However, I am not sure if I am deriving it the right way.

Below is my solution:

Yi ~ N(mu, sigma^2) = f(Yi = xi) = ∅ (xi; mu, sigma^2) (for ri =1)

Yi ~ N(mu, sigma^2) = f(Yi = xi) = Φ (xi; mu, sigma^2) (for ri =0)

Then I multiply these two terms

f(xi,ri) = ∅ (xi; mu, sigma^2)^ri*Φ (xi; mu, sigma^2)^1-ri

and then I form the likelihood equation:

L(mu,sigma^2|x,r) = n i=1 prod ∅ (xi; mu, sigma^2)^ri*Φ (xi; mu, sigma^2)^1-ri

Is this the correct way to derive the equation in part a?
I have also attached the picture of the question.

## How would you authenticate requests for player specific data in a server authoritative game?

I am creating a server authoritative game that uses a public game service API to manage player specific data in the game. The client will authenticate with the auth server, get a token, then use that token to access player specific data in the API. This works well if the API calls to the game services occur on the game client. However, in a server authoritative model, the game server itself would need to make those calls on behalf of the client. My current idea is to replicate the access token to the server and then have the server figure out which token to use when it is requesting data for a specific client. I was curious if this is the best way to do this or is there another approach I should be considering?

## TypeError: ‘NoneType’ object is not iterable using Zonal Statistics

I’m trying do looping zonal statistics to many polygons in a folder, and rasters in aonther folder. Each polygon from a specific folder need to get the mean values from a many rasters from another folders, like slope, standard deviation, etc. But when I run this code the error is:

Traceback (most recent call last):
File “D:/ZONAL1.py”, line 10, in
for shp in shapefiles:
TypeError: ‘NoneType’ object is not iterable

What this means?
My code:

``````import arcpy
import os

arcpy.env.workspace = r'D:pontos_modelagembuffers'
arcpy.env.workspace = r'D:slopes'
arcpy.env.overwriteOutput = True
output = "D:tractebelpontos_modelagembufferdbf"
rasters = arcpy.ListRasters()
shapefiles = arcpy.ListFeatureClasses()
for shp in shapefiles:
for rst in rasters:
table_out = output + "\" + shp + "_Zonal_Est"
arcpy.gp.ZonalStatisticsAsTable_sa(shp,'FID',rst, table_out,"MEAN")
``````

## Solve \$1= (x^2+y^2)^{1/2} +((x-1)^2+y^2)^{1/2}.\$

Solve $$1= (x^2+y^2)^{1/2} +((x-1)^2+y^2)^{1/2}$$
for real numbers $$x,y$$. A accept a curve if it is possible or a picture. It may be a cusp.

## QGIS – after restarting project WFS Layer only displays after opening attribute table and changing zoom

When i close my project and restart, some WFS Layers are behaving strange. They only display the data after loading/opening attribute table and changing zoom. I’ve tried refreshing with F5 but it is not helping. Any ideas?

Share: