Showing posts with label metis. Show all posts
Showing posts with label metis. Show all posts

Thursday, June 20, 2019

The effect of sea-level rise on Great Britain

Original Map of Great Britain
A rise in sea level of 10 meters

A rise in sea level of 50 meters

A rise in sea level of 100 meters
The graphics shown show a picture of Great Britain and the effect of sea level rising 10 meters, 50 meters, and 100 meters. The black mass represents the ocean and the lighter parts represent the land mass. You can see the white parts diminishing as sea level rises. 

I got the data from Christian Hill's online book in Chapter 7 on matplotlib.

The graphics was created from an .npy file which had arrays of the altitudes of 10 km x 10 km hectad squares of Great Britain. 

I was told to use imshow to plot the map given in the .npy file and plot the three different maps where sea level rises 10m, 50m and 100m. I also had to figure out the percentage of land area remaining, relative to its present value. 

.imshow

I used .imshow to plot the map after I opened the npy file with numpy's load function. 

The code looks like this:

plt.imshow(a, interpolation='nearest', cmap='gray')
plt.show()

where plt represents matplotlib.pyplot. Interpolation= 'nearest' was supposed to make the map more clear, but I don't think it did anything. cmap='gray' might be for the color scale.

Manipulating the arrays

To find the altitudes of the land mass when there is a sea level rise of 10m, I subtracted every element in my array by 10. This was done by just calling the given array a and subtracting 10. Since some values became negative, I had to replace all negative values by 0. That was done by the following code: 

z[z<0] = 0

where z is an array. The above code is basically saying, for all negative values in the array z, let them equal 0.

Deducing percentage of land remaining

The next step was the deduce the percentage of land mass remaining after a rise in sea level of 10m, 50m, or 100m.

Since the numpy arrays gives the average altitudes per 100km^2 of area of Great Britain, we know that we can find the total area of the map by counting the total number of elements in the arrays. There are 8118 hectad squares whose area is 811800 km^2. That counts the area of the oceans too. To just find the land mass area, we need to subtract the hectads that have an average altitude of 0. 

To count how many hectads had altitude 0, I used a for loop like so:

counter = 0
for element in a:
    for element in element:
        if element == 0:
            counter += 1
print(counter)

where a is an array.

In the original map, there were 5261 hectads with altitude 0. I subtracted the number of hectads with altitude 0 from the original number of hectads (8118) to get the number of hectads of land mass. I got that the land mass of the original map is 285700 km^2. 

I used a similar for loop to find the number of hectads of land mass with altitude greater than 0 for the latter 3 maps. Then, I compared the number with the original map's land mass. 

When sea level rises to 10m, the percentage of land remaining compared to the original land is 83.86%.

When sea level rises to 50m, the percentage of land remaining compared to the original land is 64.02%.

When sea level rises to 100m, the percentage of land remaining compared to the original land is 45.15%. 

Does it look like that in the maps?

Final Thoughts

I am very happy to know how to load some type of image through python. Although I did not create the code for the map, I have a bit of knowledge of how pictures can be created through arrays! That is very cool. I always wondered how pictures of maps were created through code, and now I know, kind of.

Climate change is also something I am very interested about. I hope to do my final project at Metis related to climate change. 

On a side note, I will be attending the Spring cohort's career day today to see them present their final projects. I am excited about that. 


Github code - Sea Level






Monday, May 27, 2019

Incoming Student at Metis

I am accelerating my learning of data science by joining Metis. Metis has an accredited 12 week intensive data science program where qualified candidates can gain the skills and connections needed to launch a career in data science. The summer cohort classes begin on July 1st.

I am excited to embark on this journey and plan to update regularly about my experiences during the program. But, I wanted to put into words my reason why I decided to pursue data science. After all, I came from a teaching background. I will start with the reason why I decided to pursue teaching first.

I first wanted to become a math teacher because I loved math and because I was fascinated by the learning process of a new language, specifically Spanish, when I studied abroad in Spain. I also liked children. But, I found out quickly that loving math and the learning process was not enough if I did not enjoy working with children, among the many frustrations of being a teacher. Maybe it was the age group--I worked with middle school and high school students but only had prior experience with kindergarteners. Teaching, for me, was 90% classroom management, which was just horrific. A fellow teacher told me that it took her 6 years to be comfortable in her own classroom and to feel that she had things together. That was fair, but I didn't think I could deal with six years of pain. So, I left teaching.

Why did I decide to go for data science? I actually did not decide to go for data science at first and instead picked up studying for the actuarial exams again. I have taken P (Probability), one of the preliminary exams, while in college. I thought being an actuary was the logical thing to do, given that I had the math skills, an exam taken, and heard good things about being an actuary. So, I studied for FM (Financial Mathematics), another preliminary exam, and passed it on the first try. But, while I was studying for FM, I also explored other career options. Data science was one of them.

It was my search to learn more about different careers that caused me to shadow a friend of mine, who is a data scientist. I learned more about what he does day to day and what it took to become a data scientist and thought it was a viable option for me. My interest in data science was still fairly new, but I felt there was a lot of potential in the field to answer important questions that can benefit humanity.

I talked to a Metis alumn and heard really great things about the program. Although I am still not 100% sure if data science is going to work out for me, I decided to join Metis to find out. Through the admissions process and pre-work, I found that learning to code in Python is difficult, but rewarding. I learned that finding a data science project was also hard, but interesting. I have also talked to more data scientists to learn more about what they are doing.

Overall, I am pumped to get learn more about data science and to start the bootcamp. I hope it works out and in the near future, I will be working in a data analyst or maybe even data scientist role.