any matlab gurus out there???

April 2, 2007 at 9:44 am | | everyday science, help me, software

I need some help with my Matlab m-file. Any geniuses know how to save a figure without the border?

matlabfigure1.jpg

Details:

  • The m-file produces an array of numbers: columns indicate the x- and rows the y-position of a pixel of intensity denoted by the number’s value
  • I make a figure and use the command pcolor
  • I turn the axis off
  • I save using the saveas command

Basically, I want the pcolor figure alone so I can import it into a different program and click on the image to move a stage to that location. Having a border means the stage will move to the wrong place. (I know this is a clunky solution to a scanning-stage program. Shut up. Stop making fun of me.)

Any thoughts? I’ve found that imwrite saves only the image array, but I don’t know how to use pcolor or shading 'interp' with imwrite.

To encourage random people to help me with my research, I’ll send an EDS magnet to the first person who tells me how to do this correctly—or at least points me in the right direction. I’ll update y’all as soon as I know.

[Update: Here’s a good image I created. See comments below.

matlabfigure2.jpg

I know, it’s flipped. But I can easily deal with that.

We have a winner, but I might send more magnets for more elegant solutions.]

Dirty Lab

March 28, 2007 at 12:27 am | | everyday science, hardware, stupid technology

I came across this picture while surfing Physorg (having an hour to kill after missing the last call Caltrain).

What jumps out at me is how insanely dirty the air is in that picture. It’s probably a good thing they’re just trying to push water around instead of doing any type of spectroscopy.

But that got me thinking about the way optical surfaces attract dirt like the ground attracts buttered toast (polarization smolarization, it’s Murphy’s law). In the spirit of making lemonade, I propose constructing an air purification system composed exclusively of optical elements. Obviously they’ll have to be configured into a running optical cavity (because the dust loves nothing more than finding that one critical spot to screw things up). The slight increase in price will easily be off-set by the 100+% efficiency. I say >100% because the system will coerce dust particles to materialize out of vacuum fluctuations, it’s that good. Call within the next 10 minutes with your credit card, and we’ll throw in this collectors edition Walnut cracker. Operators are standing by.

50/50 Beamsplitter?

March 26, 2007 at 8:06 am | | everyday science, hardware, help me

I guess optics are harder to make in the infrared. You ask for a 50/50 beamsplitter for 3.5 to 6.5 microns and you get something like this. I guess it crosses 50% T a couple of times within the spectral window so I shouldn’t complain.

If anyone knows a good source for IR beamsplitters that have flat spectral responses and also don’t achieve their %Reflectance with multiple little reflections leading to strings of pulses separated in time by a few tens of femtoseconds let me know.

great boxes in chemistry

March 17, 2007 at 4:17 pm | | everyday science, great finds, hardware

I get excited when I find convenient containers usable in the lab. For instance, I loooove the boxes that new optical filters come in (e.g. from Chroma). They are sturdy and have little metal closing tabs you can bend over to keep the box closed. Perfect for storing, well, anything!

filter_box.jpg

I hoard these.

Second place for the coolest-boxes-in-the-lab goes to the ThorLabs “Lab Snacks” box. First, you get snacks, then you have a nice little closable box that you can store samples or small parts in:

thor_box.jpg

Probably the most available (and the most used) box in our lab is the pipet-tip box. They’re great for secondary containment for sample vials and for segregating samples. I use them all the time:

pipet_tip_boxes2.jpg

In fact, we hardly ever throw any away, which is why we have this pile:

pipet_tip_boxes1.jpg

Maybe I should take a trip to the recycling center someday soon, before it gets any more trouble-with-tribbles in here!

OK, so what are your favorite boxes?

LN2, the quicker picker upper

February 14, 2007 at 6:03 pm | | everyday science, great finds, lab safety

Introduction
While working on a mechanical pump, a leak was sprung whereby the entire oil reservoir found its way onto the ground. The beauty of mechanical pump oil is that it’s viscous, coats everything it touches, spreads like a STD in a co-ed dorm, and isn’t particularly easy to absorb. So rather than deforesting the Amazon and taking a bath in the stuff to clean it up, I decided to try a little experiment.

Experimental
1000mL of liquid nitrogen was obtain from Praxair and used without further purification. To the floor in the lab was quickly added 1000mL of liquid nitrogen. Upon addition, it was observed that the pump oil was vitrified into a glass. Upon evaporation of the residual nitrogen, a plastic scrapper (TAP Plastics) was used to scrape the frozen pump oil into a pile. Approximately 300mL of pump oil was collected and analyzed via optical spectroscopy (it looked yellow).

Results
It’s not quite as versatile as club soda and lemon juice, but it worked.

Acknowledgements
The author would like to thank the voices in his head, for the stimulating conversations on the subject. Funding: NSF #109.3008.8849

feeling predictable

February 13, 2007 at 1:37 pm | | everyday science, grad life

On my way into lab this morning, I walked into the cafe in the EE building and the server said, “An everything bagel with cream cheese and tea for here?” I suppose I order the same thing when I go in there early in the morning. Then, at lunch, the ladies in the burrito truck knew my order.

Maybe I’m too predictable.

But then, this afternoon, I was with my labmate Nick (a physical/organic chemist—wow!), who was helping me take NMR spectra of some photo-oxidation products. The NMR lab manager walked by, looked at me, and asked, “Sam, what are you doing in an NMR lab?”

Ha! Didn’t expect that, didja?

scientific article filtering

January 19, 2007 at 8:27 am | | everyday science, news, science community, software, wild web

The wave of social bookmarking is finally reaching scientific journal articles. What YouTube, de.licio.us, and digg are to stupid videos and strange websites, now biowizard, CiteULike, and BioInfoBank are to scientific articles. (See also my previous post about CiteULike.) I suspect Connotea, with some social features already existing, is on its way to more filtering of scientific articles, too.

I welcome this progress. I find it pretty tedious reading journal tables of contents every day/week, which is necessary to keep up with new ideas that you hadn’t thought of (and thus are hard to search for in a database). Also, with journals such as PLoS One (which publishes anything—whether it’s interesting or not), filtering of journal articles will become more and more useful to pinpoint only articles you’re interested in reading.

The ranking mechanism of these science social bookmarking sites is far from perfect. But it’s a good start. Go check them out and make it easier for me to find papers I want to read!

[Note: My favorite site is still CiteULike. Connotea is nice and probably less buggy, but it seems to progress at a much slower rate, probably because CUL programming is open-source and collaborative. I can’t imagine biowizard really being that helpful in the long run, because it doesn’t have any of the functionality of CUL or Connotea and only applies to biology. I’m going to stick with CUL until someone else wins unequivocally (then I’ll export my library). I’ll update you as things change.]

new Ar laser installation

January 16, 2007 at 11:41 am | | everyday science, hardware

My lab bought an Argon-ion laser to replace an older one that wasn’t working anymore. That’s good news. Then we had to physically replace the old one. That’s the bad news. (We’re chemists, not weight-lifters….) But it ended up being really fun. I missed the worst part—moving the heavy laser down the stairs into the basement—because of a well timed vacation. But after the winter break, we moved it into the lab.

First, out with the old laser:

moving_old_laser.jpg

That wasn’t too bad, but the new laser was heavier and longer. But we did it:

moving_new_laser.jpg

The old power supply was fascinating: Read more of this post…

laser cowboys

January 10, 2007 at 2:28 pm | | everyday science, grad life, hardware, lab safety, nerd

The 23rd century cowboy…

wm_laser_cowboy_small.jpg

paul_laser_cowboy_small.jpg

Hey, is there a “sexy men of the spectroscopy laboratory” calendar out there? Here are January and August for you!

better gloves

December 5, 2006 at 6:00 pm | | everyday science, hardware, lab safety, stupid technology

Man, my least favorite part about wearing nitrile gloves is that my palms get all sweaty. Gross. So I came up with a great way to avoid that discomfort:

bettergloves1.jpg

Isn’t that great. Much more comfortable. Now I can work for hours without changing my gloves, all the while feeling vented and fresh.

And then it hit me: why vent just the palm when you can vent the back of your hand, too? That’s when I came up with an even better idea:

bettergloves2.jpg

I should really patent these!

This idea was so successful that I went to work on my safety glasses. Did you know that if you remove those silly lenses, the safety glasses are much lighter? And I don’t think those lenses actually do anything, because I can see much better without them, now (they were all foggy from a bunch of solvents, acids, etc. splashing on them).

This post has been censored by your friendly lab-safety coordinator. We apologize for any inconvenience. –Sam

citeulike

November 6, 2006 at 11:19 am | | everyday science, literature, science community, software, wild web

I recently found a cool website: CiteULike. It allows you to easily post scientific articles that you find interesting. To post an article you find, you simply stay on the page with the article (or abstract) and click a CiteULike bookmark, which automatically imports the various fields (e.g. authors, title, journal, etc.) into your library; then you simply add your own “tags” (or categories) and submit the post. I love it!

This site has a two-fold benefit: (1) you can share this library with others who are in your field (see my Watchlist), and (2) you can rank them according to how much you want to read them and remember to read papers.

CiteULike was written by Richard Cameron in 2004 and is run by him. And it’s free! I was so happy to find CiteULike, because I came up with the idea a few weeks ago, but I don’t have enough programming experience to write such a website (I took a C++ in high school, but didn’t really do the homework).

There are probably several other sites like this one, but the only other one I’ve found is Connotea, which was commissioned and now part of Nature Publishing Group. I checked out Connotea, and even imported my CiteULike library (tags include). But I prefer CiteULike’s style and features, especially the ability to rate and sort how interested I am in reading each article (maybe that feature exists in Connotea, but I can’t find it). I hope that CiteULike eventually becomes an open-source, collaborative effort; but until then, I’m still really happy with it.

So start you own library and send me a link!

Not Your Parent’s Science Fair Project

November 1, 2006 at 8:18 pm | | everyday science, science@home, wild web

Ever wonder how many licks it takes to get to the centre of a tootsie roll pop? How about what is the meaning of life? I’m guessing no, because you were too busy trying to figure out how many condoms will fit on a simulated phallus, and the ramifications thereof. Well, in a seminal work, researchers at myscienceproject.org have set a lower bound on the critical condom parameter of 625. They’ve also characterized potential side effects of, uh, 625-bagging, of which priapism is evidently absent.

Another Victory for Newtonian Mechanics – take that Brownian Motion!

October 21, 2006 at 6:54 pm | | everyday science, literature

It is well known that low Reynolds number flows are reversible.

This is perhaps the best demonstration of Newtonian mechanics in fluids that I’ve ever seen. It’s also a great analogy for “dephasing-rephasing” events that happen in photon echo, NMR, and other spectroscopic experiments. Take a look, and make sure to check out video 1.

resistance is futile

August 31, 2006 at 9:47 pm | | everyday science, lab safety, nerd

I needed to illuminate a vial of frozen dye solution with a laser and view the fluorescence. But I didn’t have enough hands to hold the vial, turn off the lights, and hold a long-pass filter (to block the excitation light). So I thought, What would W.E. Moerner do (WWWEMD)? Suddenly, I knew what I had to do: tape the filter to my safety glasses. Genius! (In the past, W.E. has encouraged me to tape diffraction gratings to my glasses and look in the microscope.)

glasses_filter_detail_small.jpg
Figure 1. The contraption.

This worked like a charm: I simultaneously protected my eyes and blocked the excitation light with a wink of an eye.

glasses_filter_small.jpg
Figure 2. My friends call me “seven-eyes.”

Feel free to use this idea next time you get sick of holding an optical filter in front of your eyes. Just send the royalty check to me.

Why so hard, Mr. Gaussian?

August 31, 2006 at 12:14 am | | everyday science, software

I’ve been doing some electronic structure calculations recently, and this is a job for Gaussian03. Sweet Gaussian. It’s a fine choice for electronic structure calculations, but there are some true oddities.

1. The program is probably the most popular suite for solving quantum mechanical calculations. Thousands of chemists use it and pay through the nose to do so. However, it is almost completely undocumented. For example, see the description of the transition option under the Density keyword (Figure 1). What is the transition density? Ought I know? Basically, do any calculation with any method other than B3LYP/6-31G and you’re screwed.

Transition=N or (N,M)
Use the CIS transition density between state M and state N. M defaults to 0, which corresponds to the ground state.

Figure 1. Out of context? no. See for yourself.

2. Why does it crash? I realize it’s a complicated system and lots can go wrong. But, why doesn’t the output file give any useful information about the system failure. It’s a smart program. It should know why it failed and speak its mind. Figure 2 shows one of my favorite error messages. Of course, there is no content about such errors in the documentation.

Erroneous write during file extend. write 172031 instead of 4096
Write error in NtrExt1

Figure 2. Actually, I know what this error is. The computer ran out of hard disk space. But, it wasn’t easy to figure out. Try googling the error message. You’ll find a bunch of people trying to figure out what NtrExt1 means.

Why isn’t there a wiki-gaussian? I don’t know, but I hope I’m not banned for asking.

< Previous PageNext Page >

Powered by WordPress, Theme Based on "Pool" by Borja Fernandez
Entries and comments feeds. Valid XHTML and CSS.
^Top^