home astro/eps 12 bio projects talks photos weather code links
 

Codescraps

The items on this page may make your life easier if used properly. I made some of them, and found some of them on the web; if you own something on this page and want it removed, please notify me.

 

OBLATE SPHEROID LATITUDE AND LONGITUDE

Use IDL function deprob to calculate the latitude and longitude on an oblate spheroidal planet, given the planet's radii, the sub-earth latitude and longitude, the north pole angle, etc. The deprob function code is fully commented. After loading it you can run deprob_demo to see how it works and generate some pretty spheroid images.

 

 

NICE IDL POSTSCRIPT PLOTS

Lines from this page of commands can be copied and pasted into your own scripts to improve PostScript plot quality.

 

 

DEGREE-RADIAN CONVERSION

These tiny IDL functions can convert angular units. The main advantage of them is when you're typing on the command line, it is quicker to type d2r(a) than it is to type a*!dpi/180.

COMMAND LINE EPS PRINTING

On my current systems, if I just try to print an EPS file using "lp", a blank page comes out. These little scripts let me print EPS files from the command line. Requires the enscript command. To use these, save them somewhere in your unix path, and chmod a+x them.

Example:
lpeps filename.eps

  • lpeps output goes to default printer
  • lpepsstdio output goes to a file named tmp.ps

 

 

BATCH-FIX TEXT FILES

I'm sure there are simpler and slicker ways to convert Mac to Unix line breaks or to search and replace within several text files, but these are super easy once they're installed. Also, they save the original files in case you messed up somehow.

To use these, save them somewhere in your unix path, and chmod a+x them. Perl must be installed (probably already is).

Examples:
unmac dps*.txt
searchandreplace "~/papers" "~mikewong/papers" dps*.txt

  • unmac convert mac to unix line breaks (remove those ^Ms)
  • searchandreplace search and replace text simultaneously in several text files

 

 

SCIENCE / COMPUTER REFERENCE DOCUMENTS

The Jupiter Geometry Table lists several quantities as a function of latitude: planetographic latitude, planetocentric latitude, kilometers per degree latitude and per degree longitude, conversion between east/west meters per second and degrees longitude per day, Coriolis parameter f, planetocentric radius, and latitude circle radius.