True Life as a Continual “Student”

It’s a sign of a good attitude when you hear people say they’re perpetually a student of life. Academia is, unsurprisingly, one of the career tracks where you’re seemingly always learning something new for your job, and I think all of us are here because we love to learn. I’d venture a guess that science fields in particular garner a disproportionate number of INTJ (my Myers & Briggs type), and we like to get things as right as possible, even if that means deconstructing the current system and starting over. That’s certainly, for better of worse, who I am. It’s not good enough until it’s the best it can possibly be (and now you can see why I’m prone to perfectionism), and I relentlessly pursue the best solution to any problem. I generally see it as a strength (I guess that’s obvious because I do it), though others might see it as a hindrance, or at least a waste of time to “do something better” that works just fine as is. It has led me to learn a lot that I wouldn’t have otherwise learned. Plenty of what I’ve learned on my career track, though, is just necessity and not striving for the perfect solution. Thinking back to especially grad school and my current job, I wanted to look back at what I’ve learned when, and chronicle it here. It’s a mix of programming languages, operating systems, software/libraries, platforms and even fields of study with associated tools.

  • Before college: DOS, HTML, QBASIC, Visual Basic
  •  Undergrad
    • 2004: MATLAB, Java
    • 2006: Linux, bash scripting, using servers
  • MS
    • 2009: SAS, ArcGIS
    • 2010: Patch analyst, FRAGSTATS
    • 2011: Sigma Plot, PC-Ord, R
  • PhD
    • 2012: remote sensing (ENVI), various landscape ecology tools (introduced to Conefor, etc. through class labs)
    • 2013: Python
    • 2014: GME
    • 2015: GDAL, CSS
  • postdoc
    • 2016: STELLA
    • 2017: NetCDF, Google Earth Engine, Github

My Annoying Climate Download Process

Here’s a summary of my week: I needed mass amounts of data from the NetcdfSubset portal, but it was too much for the HTTP server to handle (they set a cap) with just selecting the products and spatial extent to download. So, instead they returned to me a URI that needed to be passed through an external program, nccopy, to download the data. I wrote a script that separated the URI into separate files by model and scenario, and thus automated the download to save each combination of model, scenario and variable into separate NetCDF files.

The problem became that the download was really slow, owing to traffic here on my work network. Since there was no file size estimate given to me, I assumed maybe the files were huge. So, I did some internal compression to get them to download faster, but at the expense of read access speed for the files. Once I realized it wasn’t the file size, I redid the request for the files without chunking. I then had to kill that request to tailor the data acquisition for our needs, so I finally got all the temperature files today.

Then, I installed CDO and wrote a script to do the monthly means for all the files: it averages a daily time step file into a monthly averaged (or whatever metric you choose) file. I got a list of the base file names as such:

cat climate_structure | cut -d . -f1 > climate_models

Then  I wrote this simple bash script to loop over them all and write out the monthly averages:

while read climate_model; do
 echo "Now averaging $climate_model"
 cdo monmean ${climate_model}.nc ${climate_model}
done < climate_models

NSF Macro-systems Grant Meeting

We had a meeting here today of some of the co-PI’s from other universities, so it was nice to finally meet some of the people who have been involved with the grant. Besides our WETLANDSCAPE group, I had never met anyone outside our institute on the grant before today. It helped me get a feel for what others had been doing on the project, and what needs to be done. I also forged some nice new connections, and I look forward to collaborating further to carry out the grant responsibilities. Today we outlined our plans for what needs to be done, in the form of planned papers. We also pinpointed tasks needed to get re-analyses done.

Thinking Out Loud: Climate Change

(Yes, the title is a shameless reference to my favorite current era singer! I haven’t decided yet whether or not this is going to become its own section of my blog.) I’m sure we’ve all had frustrating conversations at some point with hardened “climate deniers” (I’m not sure I like that term, though, as it seems to put a divisive label on an already divided situation). I know it’s something I still regularly face, and if I’m honest, fair or not, I take a lot of it on myself. I think “maybe if I just explained this better…” I’d go as far as to say I feel shame that I know some of these people up close. I feel like I’m not doing my job as a science communicator.

Recently, a conversation with a friend reopened, and I’m grateful for that. It’s led me to pontificate about where the divide is, and to better understand the gap in understanding. This meant that awhile ago, I had to first identify my own gaps in understanding! I don’t think this can be understated: even if you find yourself on the “right side” of science, you should always appraise your actual knowledge level on a subject in which you choose to converse. I’m not saying you have to be an expert, merely that you know you’re not an expert. This leads less to debate and more to conversations of shared pursuit of knowledge, if you and the other party can humble yourselves to engage honestly with each other.

So, here’s my disclaimer: I’m not a climate scientist. I have worked with climate data, and thus have a basic understanding of climatic data and methodology. My dissertation was themed on climate change, so I have read all the “classic climate change papers,” and am beginning to understand climate models and scenarios (though I certainly haven’t built any myself). Thus, I’m not actively doing anything to further climate science, and I’m not involved in it hands-on. I’m merely an end-user of climate change projections, not a creator of them.

Here’s what I do know: I had 2 climate scientists on my dissertation committee, one of whom I especially talked with often in the course of our project. I learned a lot from him, and from a Climate Change Biology course I took during my time as a Ph.D. student. The climate scientist on our grant is a co-author on all my papers (from my dissertation, incl. 1 in review) so far, so he contributed to my knowledge of climate scenarios, especially for the regions of our analyses.

Here’s what I’ve learned from my conversations with those who don’t believe in human-caused climate change: the #1 hangup seems to be the drastic climate shifts our Earth has undergone in its history. A degree of warming seems to be nothing compared to the ice age melting! How can we possibly attribute that blip on the radar to humans, when the Earth has changed so dramatically in the past, before humans could have had anything to do with it?

Here’s what I have learned: What’s behind that question/challenge to climate change reads to me as such: “the atmosphere is vast and dynamic, and things have been changing long before we were even here, so perhaps this is beyond even our understanding.” I’ve been generally interested in science as long as I can remember, because it tells us “how things work.” So of course, I’ve wanted to approach all of this scientifically by better understanding the climate system. I took a storytelling class, in which the speaker claimed we “botched the narrative” for climate change, and I thought, that couldn’t be truer! I thought that because the mechanisms behind climate change are actually pretty simple, so we’ve done a bad job of telling the story. I’m actually going to (lazily) leave it right here because I don’t think it’s my job to re-explain why climate change is human-influenced. Many more qualified have come before me to do that in cooler ways. I just sought to share my personal experiences with climate change dialogues, and what I’ve learned so far in navigating it.

How We’ve Botched the Climate Change Narrative

I went to a Story Circles workshop and the author pontificated on how we’ve screwed up the climate change narrative, from “An Inconvenient Truth” onward. I can’t help but think he’s right, and it’s something I keep coming back to in my mind, so I figured I’d write a little about my experience with it. Like perhaps most people, my first big introduction to climate change was via “An Inconvenient Truth.” I saw “An Inconvenient Truth” for free, after I did some promo for it outside of a local theater in Roanoke, VA as an undergrad. I was still a physics major at the time, but I’d always cared about the environment, and my goal if I stayed in physics was to work in the energy sector. (I’m still quite passionate about clean energy, and if I could truly choose to do whatever I wanted, I’d probably open a solar company!) I thought it was a great movie, and had no problem with the science in it.

Afterward, I heard about how it came under attack in classrooms, and how some of Al Gore’s claims may have been exaggerated. I found out that if it was shared in classrooms, it had to be shared with certain caveats. Still believing in climate change, I wondered what was true and what wasn’t, but since this was the most extensive thing I’d seen about climate change in my life to that point, I was a little disheartened. I thought what many people may have thought when the criticisms started coming out: “Is this movie trustworthy? Is this true, or is it just another lazy, loose stringing of facts for the sake of sensationalism?” Luckily, I still cared about the topic, though not as much as I would come to when I became a biology major.

I was lucky: I was a scientist who cared about the environment. Many people who saw that movie were maybe the latter, but those who saw it with just a passing curiosity could likely have had their introduction to the topic blown. Those who were skeptics had their fires fueled.

There was another problem of this being tackled by a polarizing political figure: the message became that this was a “liberal issue.” It was presented to us by someone with a definitive political slant, so did it ever have a shot of reaching the hardcore conservative audience? (I’ll add that I still considered myself a republican at the time, when I thought I had to choose a mainstream political party! Again, I was lucky in that sense to be able to hear the message because I was a scientist!) The conservatives were immediately out for blood against the person, not necessarily the idea.

Following from the information being presented according to party affiliation, I think the main problem became this: the information became seemingly inextricably attached to certain political steps to solve it (e.g., “now the federal government needs to do something”). Since it was a new topic of import to the public and political arena (though far from new to science), and plans to address the problem at a large scale were still in their infancy, I think it became more convenient for a certain segment of the population to attack the veracity of what was to them new information. They nitpicked where they could, operating from a place of wanting to preserve their beliefs instead of exploring new information (as actually most of us do). Related, but not the same: big businesses (oil, coal) were threatened by the proposed solutions to climate change, so they threw money at the problem. This resulted in an institute to disseminate information contrary to the climate change narrative.

I can’t stress enough how damaging the attachment of politics was to the climate science narrative, and “climate denial” isn’t limited to the uneducated. I had a very smart engineer friend in undergrad who, in the wake of “Al Gore’s testimony,” did not believe in climate change. He’s a notable skeptic of most things, and I don’t mean that necessarily in a bad way. He’s rigorous about pursuing ideas to their very ends, and just “didn’t buy it.” Though he came up with reasons, I’d be inclined to guess the aversion was based in politics. (As a disclaimer, he might believe in climate change now, but I’m not sure; I haven’t talked to him about it in a long time.) Our mutual buddy, Ron Paul, does not. It was a sad day that I had to “un-follow him” because of the climate denial posts. Unfortunately, mainstream libertarian platforms (did you know  there was such a thing? 😉 ) also include climate denial, as an answer to what liberals want to do about climate change.

Therein lies the problem: I do believe that much of the backlash against climate change has instead been rooted in what political parties want to do about it, not about the science itself. This fighting has unfortunately led to widespread dissemination of bad and confusing information by political leaders and businesses alike, who have a lot of money and a lot of airtime. The most damaging blow to the public opinion of climate science, I believe, has to do with previous climatic changes from other eras in Earth’s history. That’s the firmest stone that deniers will stand on, and is a stumbling block to those genuinely seeking information.

I won’t answer that here, though it’s tempting: there are many other sources who have thoroughly explored this topic and devoted entire articles, webpages, info-graphics, etc. to explaining it better. I will say this: I would bet that many scientists, besides geologists, climate scientists, and/or planetary scientists don’t know the answer well, and would be hard-pressed to explain it in a barroom debate. You’d need to draw on a napkin to explain it well, and back up to explain to them some simple dynamics of how our earth works and what its movements mean for solar radiation forcing. You’d basically have to go back and explain how seasons work (I’d bet the average person couldn’t answer that well).

My point there is we also have to be aware of our own ignorance, and not assume that just because “science backs it up” that we personally know the topic better than we do. This could damage our own conversations with others who are “on the other side of the fence,” if we don’t admit our own knowledge gaps and instead choose a debate with a winner and a loser over a conversation to mutually further understanding. If your goal is to communicate about climate change to someone else, first learn as much as you can about it, including asking yourself the mechanistic questions along the way (i.e. “how does this work?”). Still, once you enter the conversation, be confident in your knowledge but also aware that the other person might have a question you can’t answer. In the end, you’re both just human beings looking for answers, so try to remember to approach tough topics from that perspective. Maybe then, we can start to change the dialogue, and from there maybe collectively, the narrative of climate change.

Goals? I Think? Maybe Just Ideas…

It seems to me to make the most sense to update the current Stellar Python script to…

  • Python 3
  • latest version of Stella (.stmx)

Yet, I’m wondering if this is more trouble than it’s worth, given the annoying facets of navigating Python at all, much less converting someone else’s script. I have a bit of a crutch, though, in that I don’t know STELLA that well.

Maybe I can use the general framework to retool it…what’s the spectrum, though, in just rewriting the whole thing fresh, though?

Python Tips & Tricks

If you need to find the index of an item in a list that matches e.g. a part of a string you’re searching for…

indices = [i for i, s in enumerate(lines) if 'gs4row' in s]

This will return a list of indices, telling you where in the list “lines” the string “gs4row” occurs.

Debugging OPS (Other People’s Scripts)

I copied this over from last week’s post, because this is the part I’m still working on. There are pros and cons to not having marathon debugging sessions. Sometimes you lose your place and need to take more time to get back to it. On the other hand, sometimes you get a fresh perspective by getting some distance from the problem. It’s tough to try to predict which strategy will pan out. For me, there’s also a component of life balance: if I allow myself to work on this for 15 hours straight, I let it takeover my life for the day, and that can swing me into unhealthy habits. I especially need to be watchful of myself for those tendencies: I’m sure I’m not alone in loving my work so much it can get more of my time than it should. I’m also not alone in feeling the resulting burnout from never putting it down. So, especially with my current position, I’ve tried to be watchful of healthy habits, so as to make a healthy (and thereby consistently productive) research associate. So, though for this type of work, it’s tempting to not “clock out,” I think more often than not, it helps me. I put this down over the weekend and I’m already zoomed back out to the bigger picture and (hopefully) better ideas about how to debug this.