However, we've gotten capabilities to do much more data processing, possibly looking as much as 300-400 sets from a run. Using the hand methods at this point doesn't seem like it's going to work well.
Fortunately, I have access to perl, so I've developed several small scripts that help me along. However, thinking about the big picture, I've been starting to 'wrap' the usage of the DOS programs into perl code, and also breaking apart the other parts of the perl code to smaller functions, such that I can write a very simply code to process my data. For example, my end goal would be to write something like this (in perl):
(Not actual function names, but the idea is there.)foreach my $dataset (1..50) { my $data = myread( "$filename.$dataset" ); $data = shiftfunction( $data, $shiftvalue ); $data = normalize( $data, { normconstant => 1 } ); mywrite( $data, "$newfilename.$dataset" ); }
This will be great for me, since perl's quite easy to use, but I'm thinking down the road that others will possibly want access to this data processing. And while I'm sure that others could learn and use perl (Remember, I'm in a chemical environment, not comp.sci.), I'm thinking that using a lightweight language would be easier for them to learn and pick up. For example, I'm considering the above script to be written in this microlanguage as:
Note that every 'function' would be of the form <function_name> <required args> [<optional args in name=value pairs>]. There would be some basic variable knowledge, and there would be cases where one could access internals of variables using dot notation, instead of ->{} as with perl. The semi-colons would be used only because the name=value pair sets could be numerous for a given command. The only programming syntax that would be used would be the 'for' construct, at least at this stage.for $i in 1-50 { $data = read "datafile.$i"; shift $data 0.05; normalize $data constant=1.0; write $data "outfile.$i"; }
Conceptionally, this doesn't seem hard. But there's obviously several gotchas that I haven't processed completely. But I'm wondering if anyone has done a similar task in developing a microlanguage, and could provide any pointers for writing one?
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
|
---|