Assignment 4
< final statement >
i suppose that craters size is affected by geological character.
the more wider and deeper, that region's geological feature is more soft and easily erodible than other region.
from given dataset, i get mars craters data and make data management
d/D ration - Diameter graph show that middle area of MARS ( -30' ~ 30' of Latitude ) have high d/D ratio. the results suggest that surface of middle area of MARS may have fine-grained materials.
< main code >
import pandas as pdimport numpy as np
import seaborn
import matplotlib.pyplot as plt
## dataset importdata = pd.read_csv('marscrater_pds.csv', low_memory=False)
## unnecessary column delete.. just trying..
data.drop('MORPHOLOGY_EJECTA_1', axis=1, inplace=True)data.drop('MORPHOLOGY_EJECTA_2', axis=1, inplace=True)data.drop('MORPHOLOGY_EJECTA_3', axis=1, inplace=True)data.drop('NUMBER_LAYERS', axis=1, inplace=True)
# New variable making
data['d_D_ratio'] = data['DEPTH_RIMFLOOR_TOPOG'] / data['DIAM_CIRCLE_IMAGE']
# divide Latitude of mars into 6 group eg. -90~-60, -60~-30, -30~0, 0~30, 30~60, 60~90
def LATI (row):
if (row['LATITUDE_CIRCLE_IMAGE'] >= -90.0) & (row['LATITUDE_CIRCLE_IMAGE'] < -60.0) :
return 1
elif (row['LATITUDE_CIRCLE_IMAGE'] >= -60.0) & (row['LATITUDE_CIRCLE_IMAGE'] < -30.0) :
return 2
elif (row['LATITUDE_CIRCLE_IMAGE'] >= -30.0) & (row['LATITUDE_CIRCLE_IMAGE'] < 0.0) :
return 3
elif (row['LATITUDE_CIRCLE_IMAGE'] >= 0.0) & (row['LATITUDE_CIRCLE_IMAGE'] < 30.0) :
return 4
elif (row['LATITUDE_CIRCLE_IMAGE'] >= 30.0) & (row['LATITUDE_CIRCLE_IMAGE'] < 60.0) :
return 5
elif (row['LATITUDE_CIRCLE_IMAGE'] >= 60.0) & (row['LATITUDE_CIRCLE_IMAGE'] < 90.0) :
return 6
else:
return 0
# subset data to d_D_ratio over 0.001 and creating 'LATI' variable
sub1 = data[(data['d_D_ratio'] > 0.001)]
sub1['LATI'] = sub1.apply (lambda row : LATI (row), axis=1)
#check data set
print("<<< sub1 data set info check >>>")
sub1.info()
print(sub1)
desc1 = sub1['d_D_ratio'].describe()
print (desc1)
desc2 = sub1['DIAM_CIRCLE_IMAGE'].describe()
print (desc2)
desc3 = sub1['DEPTH_RIMFLOOR_TOPOG'].describe()
print (desc3)
desc4 = sub1['LATI'].describe()
print (desc4)
print("<<< Diameter according to LATITUDE >>>")
c11 = sub1.groupby('LATI')['DIAM_CIRCLE_IMAGE'].describe()
print(c11)
print("<<< Depth according to LATITUDE >>>")
c12 = sub1.groupby('LATI')['DEPTH_RIMFLOOR_TOPOG'].describe()
print(c12)
print("<<< d/D ratio according to LATITUDE >>>")
c13 = sub1.groupby('LATI')['d_D_ratio'].describe()
print(c13)
## basic plot Association Between DIAM_CIRCLE_IMAGE and DEPTH_RIMFLOOR_TOPOG
scat1 = seaborn.regplot(x="DIAM_CIRCLE_IMAGE", y="DEPTH_RIMFLOOR_TOPOG", data=sub1)
plt.xlabel('DIAM_CIRCLE_IMAGE')
plt.ylabel('DEPTH_RIMFLOOR_TOPOG')
plt.title('Basic Scatterplot for the Association Between DIAM_CIRCLE_IMAGE and DEPTH_RIMFLOOR_TOPOG')
## bivariate bar graph plot
seaborn.factorplot(x='LATI', y='DIAM_CIRCLE_IMAGE', data=sub1, kind="bar", ci=None)
plt.xlabel('Latitude group')
plt.ylabel('Diameters')
plt.title('Crater Diameter')
seaborn.factorplot(x='LATI', y='DEPTH_RIMFLOOR_TOPOG', data=sub1, kind="bar", ci=None)
plt.xlabel('Latitude group')
plt.ylabel('Depth')
plt.title('Crater Depth')
seaborn.factorplot(x='LATI', y='d_D_ratio', data=sub1, kind="bar", ci=None)
plt.xlabel('Latitude group')
plt.ylabel('d_D_ratio')
plt.title('d/D ratio')
< console output >
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
sub1['LATI'] = sub1.apply (lambda row : LATI (row), axis=1)
<<< sub1 data set info check >>>
<class 'pandas.core.frame.DataFrame'>
Int64Index: 76742 entries, 0 to 374206
Data columns (total 8 columns):
CRATER_ID 76742 non-null object
CRATER_NAME 76742 non-null object
LATITUDE_CIRCLE_IMAGE 76742 non-null float64
LONGITUDE_CIRCLE_IMAGE 76742 non-null float64
DIAM_CIRCLE_IMAGE 76742 non-null float64
DEPTH_RIMFLOOR_TOPOG 76742 non-null float64
d_D_ratio 76742 non-null float64
LATI 76742 non-null int64
dtypes: float64(5), int64(1), object(2)
memory usage: 5.3+ MB
CRATER_ID CRATER_NAME ... d_D_ratio LATI
0 01-000000 ... 0.002680 6
1 01-000001 Korolev ... 0.024019 6
2 01-000002 ... 0.001130 6
3 01-000003 ... 0.001738 6
4 01-000004 ... 0.001496 6
5 01-000005 ... 0.002615 6
6 01-000006 ... 0.001426 6
8 01-000008 ... 0.001884 6
10 01-000010 ... 0.001337 6
11 01-000011 ... 0.002534 6
12 01-000012 Dokka ... 0.034064 6
13 01-000013 ... 0.003214 6
14 01-000014 ... 0.002832 6
15 01-000015 ... 0.021704 6
16 01-000016 ... 0.001858 6
18 01-000018 ... 0.003476 6
20 01-000020 ... 0.040691 6
21 01-000021 ... 0.001829 6
23 01-000023 ... 0.011387 6
24 01-000024 ... 0.001222 6
25 01-000025 ... 0.052645 6
26 01-000026 ... 0.053731 6
27 01-000027 ... 0.052183 6
28 01-000028 Louth ... 0.038864 6
29 01-000029 ... 0.001117 6
30 01-000030 ... 0.003085 6
31 01-000031 ... 0.004045 6
32 01-000032 ... 0.002968 6
33 01-000033 ... 0.003009 6
34 01-000034 ... 0.002124 6
... ... ... ... ...
374163 30-003511 ... 0.023102 1
374168 30-003516 ... 0.006601 1
374169 30-003517 ... 0.016556 1
374170 30-003518 ... 0.009934 1
374173 30-003521 ... 0.039735 1
374175 30-003523 ... 0.016556 1
374176 30-003524 ... 0.019868 1
374178 30-003526 ... 0.023179 1
374179 30-003527 ... 0.016556 1
374183 30-003531 ... 0.016556 1
374184 30-003532 ... 0.006645 1
374185 30-003533 ... 0.023256 1
374186 30-003534 ... 0.039867 1
374187 30-003535 ... 0.026578 1
374188 30-003536 ... 0.009967 1
374190 30-003538 ... 0.046512 1
374191 30-003539 ... 0.026578 1
374192 30-003540 ... 0.013289 1
374193 30-003541 ... 0.013289 1
374194 30-003542 ... 0.013289 1
374196 30-003544 ... 0.009967 1
374197 30-003545 ... 0.013289 1
374199 30-003547�� ... 0.029900 1
374200 30-003548 ... 0.009967 1
374201 30-003549 ... 0.006667 1
374202 30-003550 ... 0.013333 1
374203 30-003551 ... 0.020000 1
374204 30-003552 ... 0.053333 1
374205 30-003553 ... 0.013333 1
374206 30-003554 ... 0.013333 1
[76742 rows x 8 columns]
count 76742.000000
mean 0.051168
std 0.039368
min 0.001003
25% 0.018692
50% 0.038339
75% 0.079695
max 0.230769
Name: d_D_ratio, dtype: float64
count 76742.000000
mean 11.022934
std 15.450993
min 1.060000
25% 3.580000
50% 5.870000
75% 12.120000
max 512.750000
Name: DIAM_CIRCLE_IMAGE, dtype: float64
count 76742.000000
mean 0.379789
std 0.360992
min 0.010000
25% 0.120000
50% 0.270000
75% 0.520000
max 4.950000
Name: DEPTH_RIMFLOOR_TOPOG, dtype: float64
count 76742.000000
mean 3.161163
std 1.163746
min 1.000000
25% 2.000000
50% 3.000000
75% 4.000000
max 6.000000
Name: LATI, dtype: float64
<<< Diameter according to LATITUDE >>>
count mean std min 25% 50% 75% max
LATI
1 5067.0 13.575891 16.627828 3.00 4.280 7.30 15.7800 201.29
2 17870.0 12.929284 17.166422 1.11 4.010 7.05 14.8700 427.15
3 25221.0 10.968872 15.588188 1.16 3.480 5.90 12.3300 512.75
4 18715.0 9.506109 14.491434 1.06 3.140 4.92 9.8000 408.23
5 7950.0 9.692323 12.558601 1.14 3.770 5.62 10.2975 220.30
6 1919.0 7.545571 9.244252 1.08 3.425 4.57 7.5850 120.58
<<< Depth according to LATITUDE >>>
count mean std min 25% 50% 75% max
LATI
1 5067.0 0.298145 0.361430 0.01 0.08 0.16 0.36 2.57
2 17870.0 0.346001 0.360894 0.01 0.11 0.22 0.44 3.64
3 25221.0 0.453349 0.364987 0.01 0.19 0.37 0.61 4.95
4 18715.0 0.406766 0.353687 0.01 0.14 0.31 0.57 3.03
5 7950.0 0.270597 0.312241 0.01 0.07 0.15 0.35 3.14
6 1919.0 0.132460 0.249356 0.01 0.02 0.05 0.12 2.36
<<< d/D ratio according to LATITUDE >>>
count mean std ... 50% 75% max
LATI ...
1 5067.0 0.023837 0.015140 ... 0.020942 0.031774 0.125940
2 17870.0 0.036521 0.027535 ... 0.028986 0.049502 0.176849
3 25221.0 0.065411 0.041892 ... 0.065287 0.100806 0.207944
4 18715.0 0.063493 0.040681 ... 0.059524 0.092308 0.230769
5 7950.0 0.035955 0.032962 ... 0.024933 0.048222 0.188811
6 1919.0 0.015370 0.015885 ... 0.009772 0.018972 0.152381
< variables ( Diameter and Depth ) relationship >
< 2nd Variable - crater according to MARS Latitude >


<
0 notes
Assignment_3
< code >
import pandas as pd
import numpy as np
## dataset import
data = pd.read_csv('marscrater_pds.csv', low_memory=False)
## check data shape
print ("<<< check data shape >>>")
print (data.head().to_string())
## check data info
print ("<<< check data information >>>")
data.info()
## unnecessary column delete just trying..
print ("<<< modify original dataset >>>")
data.drop('MORPHOLOGY_EJECTA_1', axis=1, inplace=True)
data.drop('MORPHOLOGY_EJECTA_2', axis=1, inplace=True)
data.drop('MORPHOLOGY_EJECTA_3', axis=1, inplace=True)
data.drop('NUMBER_LAYERS', axis=1, inplace=True)
## check results
print ("<<< check modified data information >>>")
data.info()
## Null data check.. i don't need this
##print ("<null check>")
##data.isnull().sum()
## variable check
c1 = data['LATITUDE_CIRCLE_IMAGE'].value_counts()
##print(c1)
c2 = data['DIAM_CIRCLE_IMAGE'].value_counts()
##print(c2)
c3 = data['DEPTH_RIMFLOOR_TOPOG'].value_counts()
##print(c3)
## new variable making and add col
print ("<<< New variable and add column >>>")
data['d_D_ratio'] = data['DEPTH_RIMFLOOR_TOPOG'] / data['DIAM_CIRCLE_IMAGE']
c4 = data['d_D_ratio'].value_counts()
print(c4)
print ("<<< New variable and frequency distribution >>>")
c4 = data['d_D_ratio'].value_counts(sort=True,normalize=True)
print(c4)
##group test
depth_dia = data.groupby(['d_D_ratio','DEPTH_RIMFLOOR_TOPOG','DIAM_CIRCLE_IMAGE'])['d_D_ratio'].count()
print(depth_dia)
c5 = depth_dia.value_counts()
print(c5)
< Console Output >
<<< check data shape >>>
CRATER_ID CRATER_NAME LATITUDE_CIRCLE_IMAGE LONGITUDE_CIRCLE_IMAGE DIAM_CIRCLE_IMAGE DEPTH_RIMFLOOR_TOPOG MORPHOLOGY_EJECTA_1 MORPHOLOGY_EJECTA_2 MORPHOLOGY_EJECTA_3 NUMBER_LAYERS
0 01-000000 84.367 108.746 82.10 0.22 0
1 01-000001 Korolev 72.760 164.464 82.02 1.97 Rd/MLERS HuBL 3
2 01-000002 69.244 -27.240 79.63 0.09 0
3 01-000003 70.107 160.575 74.81 0.13 0
4 01-000004 77.996 95.617 73.53 0.11 0
<<< check data information >>>
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 384343 entries, 0 to 384342
Data columns (total 10 columns):
CRATER_ID 384343 non-null object
CRATER_NAME 384343 non-null object
LATITUDE_CIRCLE_IMAGE 384343 non-null float64
LONGITUDE_CIRCLE_IMAGE 384343 non-null float64
DIAM_CIRCLE_IMAGE 384343 non-null float64
DEPTH_RIMFLOOR_TOPOG 384343 non-null float64
MORPHOLOGY_EJECTA_1 384343 non-null object
MORPHOLOGY_EJECTA_2 384343 non-null object
MORPHOLOGY_EJECTA_3 384343 non-null object
NUMBER_LAYERS 384343 non-null int64
dtypes: float64(4), int64(1), object(5)
memory usage: 29.3+ MB
<<< modify original dataset >>>
<<< check modified data information >>>
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 384343 entries, 0 to 384342
Data columns (total 6 columns):
CRATER_ID 384343 non-null object
CRATER_NAME 384343 non-null object
LATITUDE_CIRCLE_IMAGE 384343 non-null float64
LONGITUDE_CIRCLE_IMAGE 384343 non-null float64
DIAM_CIRCLE_IMAGE 384343 non-null float64
DEPTH_RIMFLOOR_TOPOG 384343 non-null float64
dtypes: float64(4), object(2)
memory usage: 17.6+ MB
<<< New variable and add column >>>
0.000000 307529
0.062500 73
0.090909 71
0.066667 67
0.125000 66
0.058824 58
0.100000 51
0.045455 50
0.076923 50
0.031250 48
0.111111 46
0.071429 46
0.083333 45
0.055556 45
0.033333 44
0.111111 44
0.035714 44
0.040000 44
0.032258 44
0.015625 41
0.043478 40
0.019608 39
0.080000 38
0.034483 36
0.083333 36
0.047619 36
0.020000 35
0.018182 35
0.022727 34
0.038462 34
0.028612 1
0.083659 1
0.032145 1
0.011746 1
0.139583 1
0.043967 1
0.029418 1
0.058961 1
0.004144 1
0.010217 1
0.041833 1
0.006731 1
0.042339 1
0.007267 1
0.182283 1
0.057671 1
0.089941 1
0.023052 1
0.028659 1
0.035338 1
0.077572 1
0.010238 1
0.138085 1
0.019572 1
0.012155 1
0.134986 1
0.070524 1
0.031710 1
0.127566 1
0.050777 1
Name: d_D_ratio, Length: 38943, dtype: int64
<<< New variable and frequency distribution >>>
0.000000 0.800142
0.062500 0.000190
0.090909 0.000185
0.066667 0.000174
0.125000 0.000172
0.058824 0.000151
0.100000 0.000133
0.045455 0.000130
0.076923 0.000130
0.031250 0.000125
0.111111 0.000120
0.071429 0.000120
0.083333 0.000117
0.055556 0.000117
0.033333 0.000114
0.111111 0.000114
0.035714 0.000114
0.040000 0.000114
0.032258 0.000114
0.015625 0.000107
0.043478 0.000104
0.019608 0.000101
0.080000 0.000099
0.034483 0.000094
0.083333 0.000094
0.047619 0.000094
0.020000 0.000091
0.018182 0.000091
0.022727 0.000088
0.038462 0.000088
0.028612 0.000003
0.083659 0.000003
0.032145 0.000003
0.011746 0.000003
0.139583 0.000003
0.043967 0.000003
0.029418 0.000003
0.058961 0.000003
0.004144 0.000003
0.010217 0.000003
0.041833 0.000003
0.006731 0.000003
0.042339 0.000003
0.007267 0.000003
0.182283 0.000003
0.057671 0.000003
0.089941 0.000003
0.023052 0.000003
0.028659 0.000003
0.035338 0.000003
0.077572 0.000003
0.010238 0.000003
0.138085 0.000003
0.019572 0.000003
0.012155 0.000003
0.134986 0.000003
0.070524 0.000003
0.031710 0.000003
0.127566 0.000003
0.050777 0.000003
Name: d_D_ratio, Length: 38943, dtype: float64
d_D_ratio DEPTH_RIMFLOOR_TOPOG DIAM_CIRCLE_IMAGE
-0.016400 -0.42 25.61 1
-0.002582 -0.03 11.62 1
-0.001863 -0.03 16.10 1
-0.001386 -0.02 14.43 1
-0.000973 -0.01 10.28 1
-0.000925 -0.01 10.81 1
-0.000586 -0.02 34.11 1
-0.000548 -0.02 36.51 1
-0.000528 -0.01 18.95 1
-0.000405 -0.02 49.44 1
0.000000 0.00 1.00 3129
1.01 6298
1.02 6077
1.03 6035
1.04 5941
1.05 5771
1.06 5555
1.07 5454
1.08 5417
1.09 5197
1.10 5087
1.11 4883
1.12 4846
1.13 4686
1.14 4455
1.15 4559
1.16 4394
1.17 4248
1.18 4264
1.19 3995
0.194373 0.76 3.91 1
0.194667 0.73 3.75 1
0.194986 0.70 3.59 1
0.195122 0.48 2.46 1
0.195446 1.03 5.27 1
0.196203 0.93 4.74 1
0.197059 0.67 3.40 1
0.198238 0.90 4.54 1
0.198488 1.05 5.29 1
0.198661 0.89 4.48 1
0.198738 0.63 3.17 1
0.200000 1.49 7.45 1
0.200418 0.96 4.79 1
0.201172 1.03 5.12 1
0.201717 1.41 6.99 1
0.202083 0.97 4.80 1
0.202151 0.94 4.65 1
0.203008 0.81 3.99 1
0.203160 0.90 4.43 1
0.204545 0.81 3.96 1
0.205357 0.69 3.36 1
0.205479 0.75 3.65 1
0.205832 1.20 5.83 1
0.207944 0.89 4.28 1
0.208038 0.88 4.23 1
0.208417 1.04 4.99 1
0.213636 0.94 4.40 1
0.222527 0.81 3.64 1
0.230461 1.15 4.99 1
0.230769 0.96 4.16 1
Name: d_D_ratio, Length: 52716, dtype: int64
1 38357
2 7535
3 3089
4 1546
5 777
6 427
7 233
8 125
9 88
10 44
11 35
13 20
12 15
16 11
15 10
24 8
14 8
32 7
50 7
28 6
30 6
44 6
18 6
21 6
29 6
33 5
27 5
23 5
25 5
34 5
1009 1
1077 1
1299 1
565 1
277 1
117 1
85 1
1908 1
1396 1
884 1
372 1
308 1
276 1
84 1
1971 1
435 1
1201 1
2450 1
51 1
1650 1
786 1
338 1
306 1
114 1
6035 1
1745 1
5555 1
1393 1
1233 1
591 1
Name: d_D_ratio, Length: 281, dtype: int64
0 notes
Assignment
1. I choose marscraters and simple question -->
" is crater's location associated with diameters? "
2. my topic is relationship between crater location(Latitude) and diameter size
3. i'm interested in exploring the association between location and crater's size ( diameter and new variable - d/D ratio)
4. according to "Geographical Distribution of Crater Depths on Mars" by Tomasz F.Stepinski, global distribution of d/D ratio provide "observational" support for existence of cryosphere with varing depth.
6. if i get data of crater's size according to latitude, we can guess geological character of mars
< Literature Review >
Introduction
The purpose of this review is to examine the distribution and formation of mars craters for finding second topic.
There are many kind of formation and shape of mars craters. first topic simply is that what associated with diameter and depth of craters.
From literature review, depth-diameter ratio can be indicator of MARS geological charcacter.
Methodology of Review
http://scholar.google.com were employed to search for literature review
The keywords used in searching websites were : Mars Craters, Mars Surface, Astronomical Photometry, Depth, Diameters, Impact Damage, Mars Photographs
Overview of Research Studies
In specific region of mars – Amazonis-Memnonia region, Depth to Diameter ratio for fresh craters display greater than expected.
Average of depth-diameter ratios are approximately 0.23(+-4), 0.25(+-3) for simple crater and complex crater repectively.
However, in Amazonis-Memnonia region, depth-diameter ratios are approximately 0.29(+-5), 0.21(+-4)
The increase in depth-diameter ratio is considered due to geologic character on mars.
Discussion and Second Topic
MARS cater formation can be affected by geologic character.
Therefore, geological material and properties of MARS can be infered by investigating depth-diameter ratios.
Using dataset that has 378,540 craters information, MARS geological character according to latitude could be obtained statistically.
Appendix
References
Barlow, N.G. (1993). Increased depth-diameter ratios in the Medusae Fossae Formation deposits of Mars
In its Twenty-fourth Lunar and Planetary Science Conference. Part 1: A-F p 61-62 (SEE N94-12015 01-91)
Barlow, N.G. (1993). Depth-diameter ratios for Martian impact craters: Implications for target properties and episodes of degradation
In its Mars: Past, Present, and Future. Results from the MSATT Program, Part 1 p 1 (SEE N94-33190 09-91)
1 note
·
View note