Skip to content

Commit 73d237c

Browse files
committed
update readme with code example and images
1 parent 17c65aa commit 73d237c

17 files changed

+172
-1
lines changed

Diff for: README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,25 @@ Also, database architect such as:
1111
SQL Server, Oracle, MySQL, PostgreSQL and MongDB.
1212
```
1313

14-
![Screenshot](ui/images/example.png)
14+
Exoplanets analysis with R
15+
![Screenshot](R/Exoplanets/images/exo_sampling_all2.png)
16+
17+
NBA analysis and Visualization with R
18+
![Screenshot](R/NBA/images/nba_win_loses.png)
19+
20+
Magellanic Clouds Fits image with Catalog Object detected with Python (astropy lib)
21+
![Screenshot](python/photometric-analysis/images/sample3.png)
22+
23+
24+
JSON external api call and used as result feed example with NODE and Express
25+
```JS
26+
var URL = 'http://ori-nodeassets.nbcnews.com/elections/2018-05-08/races_S_counties.json';
27+
router.get('/races/:variable*?', function (req, res, next) {
28+
axios.get(URL).then(function (response) {
29+
res.json(dal.apiRaces(req.params.variable, response.data));
30+
});
31+
32+
});
33+
```
34+
35+
![Screenshot](race-feed-json/images/sample3.png)

Diff for: python/photometric-analysis/README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
### The Photometric Analysis of the Magellanic Clouds
2+
3+
The Galaxy Evolution Explorer (GALEX) satellite was an orbiting space telescope that observed galaxies at ultraviolet wavelengths. GALEX picked up an assortment of astronomical objects while surveying distant galaxies. The satellite's large field of view is 1.5° of sky. Also, the capabilities of the GALEX cameras allow photon counting that takes a picture about once every 0.05 second. This American ultraviolet astronomy satellite was launched on April 28th 2008 and collected more than 200 million source measurements at far-UV (FUV) and near-UV (NUV) wavelengths and images of extended objects.
4+
With the help of GALEX, astronomers observed the Milky Way's nearest neighbor galaxy the Magellanic Clouds (MCs). They are interested in this galaxy because of the low metallicity (Olsen et al. 2011, Cole et al. 2005) of the Clouds, combined with their proximity[Pietrzynski et al. 2013]. The astronomers performed detailed observations in stellar evolution studies and other conditions. The Magellanic Clouds have been observed using UV imaging and spectroscopy by the GALEX mission (Martin et al. 2005, Morrissey et al. 2007, Bianchi 2009, 2011). This survey provided wide-field imaging bands in the UV spectrum. In this project, we performed photometry analysis of images from the Magellanic Clouds and their environment.
5+
Photometry has traditionally played a key role in the study of a variety of astrophysical objects. Age-dating has been typically used to understand the formation of various astronomical systems however this technique is limited to optical photometry because it can capture the well known age–metallicity degeneracy (AMD). Instead, the young metal-rich stellar populations produce optical colors which are indistinguishable from optical measurements (Worthey 1994).
6+
Young stellar populations (<1 Gyr old) emit a substantial proportion of their flux in the the ultraviolet region, making UV photometry a good indicator of their presence. However, UV flux can also be generated by old, evolved stages of stellar evolution. Therefore, with a large database containing astrophysically unique sources, this study will analyse the spectrum of the objects in the Magellanic Cloud both stellar and extragalactic.
7+
8+
9+
Magellanic Clouds Fits image from GALEX satellite with no color scale process.
10+
![Screenshot](images/sample1.png)
11+
12+
Magellanic Clouds Fits image from GALEX satellite.
13+
![Screenshot](images/sample2.png)
14+
15+
16+
Magellanic Clouds Fits image with Catalog Object detected
17+
![Screenshot](images/sample3.png)
18+
19+
Spectrum analysis of an image in a visible wavelength. (3500-6000 Å)
20+
![Screenshot](images/sample4.png)
21+
22+
23+
Spectrum analysis of an image our FITS image in UV-Band (120-400 nm)
24+
![Screenshot](images/sample6.png)
25+
26+
Background Subtraction for 'lmcw-nd-intbgsub_6.0.fits'
27+
![Screenshot](images/sample7.png)
28+
29+
Flux vs Wavelength for 'lmcw-nd-intbgsub_6.0.fits'
30+
![Screenshot](images/sample8.png)

Diff for: python/photometric-analysis/images/sample1.png

30.8 KB
Loading

Diff for: python/photometric-analysis/images/sample2.png

206 KB
Loading

Diff for: python/photometric-analysis/images/sample3.png

237 KB
Loading

Diff for: python/photometric-analysis/images/sample4.png

72.5 KB
Loading

Diff for: python/photometric-analysis/images/sample5.png

15.1 KB
Loading

Diff for: python/photometric-analysis/images/sample6.png

34.8 KB
Loading

Diff for: python/photometric-analysis/images/sample7.png

37.9 KB
Loading

Diff for: python/photometric-analysis/images/sample8.png

32.8 KB
Loading

Diff for: race-feed-json/README.md

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
### This is a Node Express API
2+
3+
4+
I using an external json call to feed my examples
5+
6+
```
7+
npm install
8+
```
9+
10+
```
11+
npm start
12+
```
13+
14+
I used axios package because request and request-promise with Q didn't load the external
15+
feed.
16+
router/index.js
17+
```JS
18+
19+
var URL = 'http://ori-nodeassets.nbcnews.com/elections/2018-05-08/races_S_counties.json';
20+
21+
router.get('/races/:variable*?', function (req, res, next) {
22+
axios.get(URL).then(function (response) {
23+
res.json(dal.apiRaces(req.params.variable, response.data));
24+
});
25+
26+
});
27+
router.get('/candidates/:variable*?', function (req, res, next) {
28+
axios.get(URL).then(function (response) {
29+
res.json(dal.apiCandidates(req.params.variable, response.data));
30+
});
31+
});
32+
router.get('/counties/:variable*?', function (req, res, next) {
33+
axios.get(URL).then(function (response) {
34+
res.json(dal.apiCounties(req.params.variable, response.data));
35+
});
36+
});
37+
```
38+
dataLayer.js example:
39+
40+
```JS
41+
42+
const apiRaces = (variable, body) => {
43+
var races = variable ? body.races.filter(x => x.race_name === variable) : body.races;
44+
return races.map( c => {
45+
return {
46+
race_id: c.race_id,
47+
election_date: c.election_date,
48+
party: c.party,
49+
state_name: c.state_name,
50+
total_vote: c.total_vote,
51+
percent_in: c.percent_in
52+
53+
};
54+
});
55+
};
56+
const apiCandidates = (variable, body) => {
57+
var races = variable ? body.races.map(x => {
58+
if (x.candidates.filter(y => y.candidate_code == parseInt(variable))){
59+
return x;
60+
}
61+
62+
63+
}) : body.races;
64+
return races.reduce((acc, val) => acc.concat(val.candidates.filter(y => variable ? y.candidate_code == parseInt(variable) : y.candidate_code).map(c => {
65+
return {
66+
67+
candidate_code: c.candidate_code,
68+
major_party: c.major_party,
69+
race_name: val.race_name,
70+
vote: c.vote,
71+
electoral_vote: c.electoral_vote
72+
};
73+
})), []);
74+
};
75+
const apiCounties = (variable, body) => {
76+
var races = variable ? body.races.map(x => {
77+
if (x.counties.filter(y => y.county_name === variable)){
78+
return x;
79+
}
80+
81+
}) : body.races;
82+
83+
console.log(races);
84+
return races.reduce((acc, val) =>
85+
acc.concat(val.counties.filter(x => variable ? x.county_name === variable : x.county_name).map(c =>
86+
87+
88+
{
89+
return {
90+
county_code: c.county_code,
91+
party_stratum_name: c.party_stratum_name,
92+
registered: c.registered,
93+
total_vote: c.total_vote,
94+
fips_code: c.fips_code,
95+
race_id: val.race_id
96+
};
97+
})), []);
98+
99+
};
100+
module.exports = {
101+
// export methods here
102+
apiRaces: apiRaces,
103+
apiCandidates: apiCandidates,
104+
apiCounties: apiCounties
105+
};
106+
```
107+
api call screenshots:
108+
109+
![Screenshot](images/sample1.png)
110+
111+
![Screenshot](images/sample2.png)
112+
113+
114+
![Screenshot](images/sample3.png)
115+
116+
![Screenshot](images/sample4.png)
117+
118+
![Screenshot](images/sample5.png)
119+
120+
![Screenshot](images/sample6.png)

Diff for: race-feed-json/images/sample1.png

83.3 KB
Loading

Diff for: race-feed-json/images/sample2.png

32.5 KB
Loading

Diff for: race-feed-json/images/sample3.png

55.5 KB
Loading

Diff for: race-feed-json/images/sample4.png

67.5 KB
Loading

Diff for: race-feed-json/images/sample5.png

95.7 KB
Loading

Diff for: race-feed-json/images/sample6.png

50.8 KB
Loading

0 commit comments

Comments
 (0)