Add Factors to a Momocs Coo Object

This wasn’t documented anywhere (maybe it’s obvious?), but here is a short example using the included ‘bot’ dataset.

data(bot);
# Look at the existing factors, stored in bot@fac
a<-bot@fac;
# Add another arbitrary factor
a[2]<-a;
a[2]<-c(1:40);
names(a)[2]<-“number”;
# Put your new factors back into the object
a->bot@fac;
# Look at your data based on the new factor
panel(bot,cols=col.india(40)[bot@fac[,”number”]]);

 

 

PetroMod Simulation Log Location

Simulation logs (one per processor used during simulation) are located in the out folder of your model, with the name(s) log.pma, log1.pma, log2.pma, etc.

Possible use for this information: Write a script that automatically copies log files to another location for later review if needed (watch folder in Python?).  Bonus points if you are timestamping your notes so you can identify the right file to look at.

Update!

Midsummer update: Lots of things going on here in science world.  Mostly I’ve been working with PetroMod to create some basin history models of the Williston Basin, which is fun because I get to dig way into how PetroMod works and how different variables affect hydrocarbon generation and migration.

 

Formation tops to Petra, reshaped with R

To import formation tops to Petra, your input file needs to be set up as one row per well, one column per formation top, and each value being the depth measurement.  In the example below, I am trying to rough out the depths of formations in Wyoming using only the TD (total depth) and BOTFORM (formation at total depth).  Not the most precise method of building structural maps, but it will work on a large scale.

Input file has one row per well, columns api_full, TD, and BOTFORM (at least). 

Caution: I tried to run this on the full WY well dataset (111,000 rows) and R used all 36 GB of my RAM and then crashed.  It’s advisable to subset first.

#Read data in
wells<-read.csv(“Wyoming_allwells_headers.csv”);
#Simple sample
ws<-head(wells);
#Remember column names
names (ws);
#Required libraries
library(reshape);
 
#Example: reshape the sample, because the whole dataset is over 100,000 rows.
#Melt according to API and formation at TD
wsr<-melt(ws,c(“api_full”,”BOTFORM”),”TD”);
#Cast into a new data frame
wsc<-cast(wsr, api_full ~ BOTFORM);
 
Output will be one row per well, one column for each formation name in BOTFORM, and TD as the value.
 
I can add more information if there are questions.  Reshape steps are from http://stackoverflow.com/a/1533577/2152245.

Bored? Run a Spatial Analysis!

I’m not bored, so I won’t be today.  Someone could, however, look at the early success of the Great Rides Fargo bikeshare program and compare:

  • the footprint of the stations, according to population density versus Grand Forks (or the nearby city of your choice)
  • the footprint of the stations, according to how much area it would cover in Grand Forks (or the nearby city of your choice)

That might be enough to start thinking seriously about bikeshare in other areas.  Why not Grand Forks (another great hashtag)?  Why not Winnipeg?