Re: [F-Script-talk] compiling a project with FSInterpreterView
Brought to you by:
pmougin
From: Roberto A. <ab...@as...> - 2002-08-04 02:27:51
|
> Could you share with us the way you are using F-Script? Sure. I'd be curious if others are doing vaguely the same thing. But bear in mind I've only been using F-Script for about 72 hours (just discovered it). On the other hand I can tell I'll be using it very heavily from now on. Short Version: To make a long story short, I've embedded an FSInterpreterView into an Objective-C document-based Cocoa app dominated by an NSTableView, and am using F-Script to let the user (me and my graduate students) manipulate data in the table directly in arbitrarily complex ways. The array-based F-Script syntax makes complex filtering and data manipulation really easy. Long Version (probably boring): I'm an astronomer who's speciality is automated classification of galaxy images (mostly taken with the Hubble Space Telescope). A while ago I wrote a command line-driven C program that takes an image as input and outputs a text data file with measurements of something like 30 properties for each galaxy. This means that for each project I'm working on I've got one or more directories with hundreds/thousands of text files representing a galaxy sample of interest. Sounds like an application crying out for a relational database, I know, but in the past I've dealt with the problem of analyzing the total sample using a bunch of kludgy perl/awk/shell scripts, but I finally decided I need something better (since my PhD students are not as nerdly as I am, and I feel guilty about asking them to hack my amateurish and ugly mismash scripts needed to get the job done). My first thought was to write some program that stores all my information in a relational database, but then it seems to me I'll just be forcing my students to learn SQL (in addition to perl/awk/shell scripting, etc) which is not the (short term) goal. [Of course they ultimately have to learn the full gamut of UNIX tools, but if one throws them in with both feet I've found some students wind up hating life]. Plus it looks to me like programs like iTunes can do a pretty good job of organizing disparate collections of MP3 files etc, so what I want is something along those lines to organize my collection of galaxy images. So I've just written/am writing a Cocoa/Objective-C program that trolls through my directory system looking for the output files from my galaxy analysis program, imports the files, parses the information in them, and displays the results in a NSTableView. It indeed kind-of does for my collection of galaxy images what iTunes does for a collection MP3s. Each each row in the table corresponds to a galaxy image file, double clicking on the row for a particular galaxy displays the object in a window which lets you manipulate it, etc etc. So far it works great. I've only been working on it in my spare time for a couple of weeks (simultaneously with trying to learn Cocoa) but it's actually surprisingly usable already... I'm amazed at how fast one can develop stuff in Cocoa. Anyway, just like the way much of the usefulness of iTunes is in letting you organize your music into subsets, in order for my program to be useful to me and my students it will need to let us organize the data, filter it in complex ways, calculate statistics from the sample, take subsets from the sample, etc. I could dump the information to a text file and do the calculations externally, but then I'm back in awk/perl land. A nicer approach would be to manipulate the objects feeding the table from within the program, but until learning about F-Script I was wondering how to manipulate the data feeding the NSTableView Cocoa object in a general way (for example, amongst the infinite number of things we might want to do is restrict some analysis to all galaxies with a certain class with a median area above some value, and then work out the mean value of a bunch of galaxy properties. That sort of thing, but one certainly can't anticipate beforehand what one will want to do with the data.). Since manipulation of the data in the table needs to be general, and the data analysis is inherently array based, embedding F-Script is perfect for this application. It replaces having to filter millions of little ascii text files with awk and perl, and since the F-Script sytax automatically threads over arrays no serious programming is needed to do really complicated stuff (I don't feel guilty about making my students learn the small amount of F-Script needed since it will take all of 30 seconds). Plus embedding the interpreter was trivially easy to do (you can see I'm hugely impressed). I might think about coding a set of PGPLOT bindings for F-Script so that one can generate nice publication-quality plots with it. Has anybody attempted this or something similar? In fact, does anyone know of anything that will let me do basic plots of X-Y data in an NSView that I can also embed in my program? Cheers, Bob -- ------------------------------------------------------------------------ Prof. Roberto Abraham | Office: Rm.1405A Dept. of Astronomy & Astrophysics | Phone (direct): 416-946-7289 University of Toronto | Phone (cellular): 416-830-8172 60 St. George St | Phone (department): 416-978-2016 Toronto, ON M5S 3H8 | Departmental FAX: 416-946-7287 Canada | ------------------------------------------------------------------------ |