{"id":6907,"date":"2020-02-04T17:00:50","date_gmt":"2020-02-04T22:00:50","guid":{"rendered":"https:\/\/blogs.mathworks.com\/community\/?p=6907"},"modified":"2020-02-05T11:06:26","modified_gmt":"2020-02-05T16:06:26","slug":"community-qa-kelly-kearney","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2020\/02\/04\/community-qa-kelly-kearney\/","title":{"rendered":"Community Q&#038;A \u2013 Kelly Kearney"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Kelly Kearney is a top contributor to MATLAB Answers and File Exchange.\u00a0 Here is a Q&amp;A I did with Kelly who is a research scientist for the University of Washington in their Joint Institute for the Study of the Atmosphere and Ocean.<\/span>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #ffffff;\">.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"347\" height=\"350\" class=\"size-full wp-image-6927 aligncenter\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/Kelly-Kearney-QA-1.1.png\" alt=\"\" \/><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>Thanks for agreeing to this interview.\u00a0 You live in Seattle. Did you also go to school there?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">For undergrad, I studied marine science and biology at the University of Miami.\u00a0 I later earned my Ph.D. in the Geosciences department at Princeton University, focusing on ocean biogeochemistry and ecosystem modeling.\u00a0<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>Can you describe your work?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">I work as a research scientist for the University of Washington in their Joint Institute for the Study of the Atmosphere and Ocean.\u00a0 The joint institute is a partnership between the UW and NOAA (the National Oceanic and Atmospheric Administration); my office is located at the NOAA Alaska Fisheries Science Center (which has its main office in Seattle, not Alaska).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As for what I do\u2026 I try to understand the processes that control how matter and energy cycle through the ocean food web, starting from the nutrients dissolved in the water that are then used by microscopic plants that then provide food to a complex web of critters both large and small (including humans).\u00a0 I do this through mathematical modeling of the physics, chemistry, and food webs in the ocean.<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>According to your GitHub.io page, <a href=\"https:\/\/kakearney.github.io\">https:\/\/kakearney.github.io<\/a>, your work revolves around the development and application of a regional ocean model (ROMS) domain that covers the Bering Sea region.\u00a0 What does that mean to someone who is not familiar with this kind of work?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">I\u2019ll try to break it into pieces a bit.\u00a0 First, the Bering Sea\u2026 that\u2019s the body of water between Alaska and Russia, north of the Aleutian Islands.\u00a0 It\u2019s home to the one of the largest fisheries in the world, and provides nearly half the US catches, including the largest single-species fishery, walleye pollock (i.e. the fish used for most breaded and battered fish dishes around the world). So, a very economically-important region.\u00a0 There\u2019s a lot of great field data collected to support the science needed for management of these fisheries. But data collection is mostly limited to summer, and it\u2019s difficult and expensive to get good spatial coverage all the time in such a remote, seasonally-ice-covered region. So models can help us fill in the gaps, learn more about how the system works on a larger scale, and forecast how the ecosystem might change in the future.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The ROMS model part of that description refers to a high-resolution ocean model.\u00a0 It works similarly to the ocean part of the bigger global climate models. At their core, these models use physical equations for motion on a rotating sphere and thermodynamic energy balance to figure out how air and water move.\u00a0 <\/span><\/p>\n<p><span style=\"font-weight: 400;\">(I don\u2019t know what the policy is for adding images to these blog posts, but it\u2019s hard to describe climate models without them\u2026 I stole this one from Wikipedia\u2019s General circulation model page: https:\/\/en.wikipedia.org\/wiki\/General_circulation_model).<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"540\" height=\"512\" class=\"aligncenter size-full wp-image-6911\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/General-Circulation-Model.png\" alt=\"\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Coastal areas aren\u2019t able to be well-resolved by the grid cell sizes in global models (1 grid cell ~100 km per side in most global models).\u00a0 So smaller models with finer grids covering the coastal areas are used; ROMS is one such framework. We use the same primitive equations of motion to move the water in our modeled ocean, and also add the chemistry and biology to calculate how well phytoplankton (microscopic plants) can grow, and how many zooplankton can eat them, and how many fish can eat them, etc., etc.<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>When and why did you first get introduced to MATLAB?\u00a0 How did you learn to use MATLAB? When and why were you first exposed to MATLAB Central? Can you please explain the role MATLAB Answers played in teaching you MATLAB?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">I started using MATLAB for my first job after undergrad, working at the Naval Oceanographic Office, back in 2003.\u00a0 In that job, I was modeling high-frequency sonar performance, i.e. how sound moves through water. My boss gave me some MATLAB scripts written by a previous scientist to analyze the output of our primary sonar model, and I got to work tinkering with it.\u00a0 For context, my previous computer coding experience was all with Fortran and unix shell scripting. Fortran may seem like an ancient language to many computer scientists, but it\u2019s still the workhorse language of scientific numerical computing; the sonar model I used at that time was in Fortran, as are the ROMS model and all the global climate models I mentioned above.\u00a0 Fortran is fast and powerful, and one of the few choices available for high performance computing\u2026 but it is not exactly user-friendly, especially for an undergrad without any formal programming classes under her belt. I spent so much time during my undergrad research trying to debug unclear error messages, fix code, recompile, over and over, in my first venture into scientific coding.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">By contrast, MATLAB seemed so friendly!\u00a0 Immediate feedback! No compilation necessary!\u00a0 Visual inspection of variables! And plots! So many plot options!\u00a0 I\u2019m a very visual thinker, and like to slice and rearrange and plot data to my heart\u2019s content when wading through complex datasets.\u00a0 Unlike Fortran, and other languages I\u2019d briefly fiddled around with (perl, javascript), MATLAB seemed to think like me. I loved it.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As I mentioned, I didn\u2019t have any formal training in programming.\u00a0 That\u2019s true of most scientists; we learn by looking at other people\u2019s older code, and fiddling with it, and googling a lot.\u00a0 That led me to the MATLAB Newsgroup, which at the time was a part of the MATLAB Central website alongside File Exchange. Originally I used the Newsgroup to figure out specific problems I encountered, but after a month or two it became part of my morning routine; every morning I\u2019d start work by checking email and browsing the newsgroup for 15-20 minutes.\u00a0 I started to learn the fundamentals of good programing, beyond just \u201cmake it work\u201d, and storing away tidbits of MATLAB knowledge that might come in handy down the road. I continued that routine through my three years in that job and then into grad school; I migrated to MATLAB Answers when it started eclipsing the Newsgroup (RIP CSSM). Though my time is more limited these days, I still browse Answers when I need a mental break, am waiting for code to finish running, etc.<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>How does MATLAB make your work easier?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">It\u2019s the primary tool I use for, well, everything.\u00a0 I\u2019ve built several numerical models in it to run various experiments, and do almost all my data analysis and visualization in MATLAB.\u00a0 I even made my wedding seating chart in MATLAB, much to everyone\u2019s amusement! I\u2019ve learned other languages now, and will move to those if there\u2019s a specific need (R is favored for fisheries statistics, python is better when I need to set up batch jobs on the supercomputer), but MATLAB is still my go-to default.<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>How do you use GitHub?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">I started using git for two reasons.\u00a0 The first was to keep track of changes I made to my code.\u00a0 One of the advantages to being a self-taught coder is that you get the chance to \u201cdiscover\u201d the need for certain things by doing it the wrong way first.\u00a0 During grad school, my previous methods for saving backup copies of things before making any major changes to code started getting hopelessly complex, and I decided there simply *must* be a better way to do that.\u00a0 That led to my discovery of version control software, and git seemed to be the consensus favorite at the time, so I started using it.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The second advantage of git is that it allows me to sync my MATLAB library across computers.\u00a0 At first I was wary of making unpolished code publically-accessible, so all my git repos were local and private.\u00a0 But that was a hassle to maintain, and I started moving a few repos to GitHub, and eventually started making them all public.\u00a0 It turns out there\u2019s too much code out there to worry about people judging unpolished code; the repos people tend to find and use are the ones I intentionally publicize<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>How do you use File Exchange?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">I use the File Exchange as a curated exhibition of what I consider to be my most useful functions.\u00a0 These are functions I\u2019ve taken the time to fully polish, test across MATLAB versions and operating systems, and add documentation.\u00a0 It\u2019s a small collection, and I always intend to add more to it, but unfortunately, my time is limited. <\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>You are very active in <a href=\"https:\/\/github.com\/kakearney\/\">GitHub<\/a> and on the <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/?term=authorid%3A287218\">File Exchange<\/a>.\u00a0 Can you please explain your work balance about when you use GitHub vs when you use File Exchange?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">As I mentioned, GitHub is where all my code goes; I\u2019ve got over 150 repositories sitting there, mostly MATLAB stuff.\u00a0 I have a system of scripts on my local computer that I use to keep my local changes synced to their GitHub remotes. This is mostly for my own benefit, so I can get to it from anywhere, but it comes with the nice side benefit that I can easily point others to it if I think it could be useful to them.\u00a0 I save File Exchange for my most popular functions. Technically, all my File Exchange entries are linked to GitHub, so my workflow is the same for all entries, but posting on the File Exchange for me is a commitment to keep the code working and documented to the level needed by public users, rather than just myself.<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>Is there a particular <a href=\"https:\/\/github.com\/kakearney\/\">GitHub<\/a> Repo or <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/?term=authorid%3A287218\">File Exchange<\/a> submission that you are especially proud of?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">I\u2019m rather proud of my <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40082\">ecopath_matlab: A Matlab implementation of Ecopath<\/a>, a food web model mostly used in fisheries science.\u00a0 It\u2019s to date my only project utilizing MATLAB classes, and I think I did a nice job of consolidating some very convoluted, GUI-constrained, pre-existing code into an elegant, flexible, command-line tool.\u00a0 But that code is targeted at a very niche audience who unfortunately don\u2019t use MATLAB much (fisheries scientists are R devotees). Oh well, I get a lot of use out of it myself. :-)<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-6917 size-full\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/ecopath_matlab-A-Matlab-implementation-of-Ecopath.png\" alt=\"\" width=\"278\" height=\"264\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Regarding functions with wider reach, <\/span><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/31092\"><span style=\"font-weight: 400;\">legendflex.m: a more flexible, customizable legend<\/span><\/a><span style=\"font-weight: 400;\"> and <\/span><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29638\"><span style=\"font-weight: 400;\">contourfcmap: filled contour plot with precise colormap<\/span><\/a><span style=\"font-weight: 400;\"> remain two of my most popular.\u00a0 These are utilities to expand on MATLAB\u2019s legend and contourf capabilities, respectively.\u00a0 And they\u2019re the ones that I get complimented in person on the most, by colleagues who say, \u201chey, I was looking for a tool to do this thing, and I found your code and it did the thing!\u201d<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>Your functions and files on File Exchange are very user friendly, intuitive, and powerful.\u00a0 Can you please talk about your design process?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">I usually turn code into functions as soon as I find myself repeating a sequence of commands more than a handful of times.\u00a0 I once read advice (probably somewhere on CSSM) that you should code as though two people are going to use the code: you, and you 6 months later.\u00a0 That\u2019s more or less all I\u2019m doing\u2026 writing code for future me. And future me gets very annoyed by opaque, obfuscated code; that means I add in header documentation of inputs and outputs immediately, and try to keep code neat and tidy with lots of comments and ample use of whitespace for visual organization.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Occasionally, a piece of code turns into something useful for people besides just me, and if I happen to have the time, I write a more doc-like script for those that fully details the syntax and goes through a few examples; this then gets published to both html and GitHub markdown format and appears as the README in the GitHub repo for that function.<\/span><\/p>\n<div style=\"background-color: #f0f0f0; padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; font-style: italic;\"><b>Do you have any hobbies? What do you do for fun? What are your favorite things to do in Seattle?<\/b><\/div>\n<p><span style=\"font-weight: 400;\">I like to get involved in a little bit of everything! Rec sports, theater and dance, intermittent running of 10Ks and half-marathons&#8230;\u00a0 Right now, I play trumpet in a community band, take regular ballet classes (a lifelong hobby) at a local studio, and am slowly gaining some skills in various circus-y endeavors, mainly aerial silks.\u00a0 The aerials thing is a newly-acquired hobby since moving here; there\u2019s a very active circus scene in Seattle that supports both professional and amateur performers (I\u2019m firmly in the latter category!), and I\u2019m really loving it!\u00a0 I also like taking advantage of the beautiful scenery around here to hike and backpack in the Cascades and Olympics with my husband, though mostly in the summer months.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"300\" height=\"190\" class=\"aligncenter size-full wp-image-4785\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/Community-QA-Logo_300x190.png\" alt=\"\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/community\/files\/Kelly-Kearney-QA-1.1.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div>\n<p>Kelly Kearney is a top contributor to MATLAB Answers and File Exchange.\u00a0 Here is a Q&amp;A I did with Kelly who is a research scientist for the University of Washington in their Joint Institute for&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2020\/02\/04\/community-qa-kelly-kearney\/\">read more >><\/a><\/p>\n","protected":false},"author":85,"featured_media":6927,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[257],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/6907"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=6907"}],"version-history":[{"count":15,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/6907\/revisions"}],"predecessor-version":[{"id":6953,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/6907\/revisions\/6953"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media\/6927"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=6907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=6907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=6907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}