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.

This program assumes the far field approximation. Although I solved the trigonometric relations myself, useful relations for the geometry and coordinate description of an oblate spheroid can be found at NASA's PDS Atmospheres Node.

### MSL AREOCENTRIC LONGITUDE TABLE (msl_LS_table.txt)

This table gives the areocentric longitude (LS, a measure of the season) during the MSL mision. LS values are given at the beginning (midnight) of each sol. Calculations used the IDL routines available at ASU, which follow the methods of Piqueux et al. (2015). To determine the times for each mission sol, I used the landing time given in e.g., Blake et al. (2013), and the duration of Mars sols given in Allison and McEwen (2000). The Mars year numbering follows Clancy et al. (2000).

### OUTER PLANET GEOMETRY TABLE (kmdeg.txt)

The Outer Planet Geometry Table (kmdeg.txt) 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.

File updated 2014 to correct an error and provide km/deg scaling factors in latitude for both planetographic and planetocentric coordinates.

### 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