|
|
|
|
View previous topic :: View next topic |
Author |
Message |
thare GIS Support Team
Joined: 22 Mar 2004 Posts: 636 Location: USGS Astrogeology Research Program, Flagstaff, AZ
|
Posted: Wed Jul 11, 2007 12:42 pm Post subject: CTX process all script |
|
|
Here is a simple CShell script to help with CTX processing. It requires ISIS3 to be installed on SUSE, Solaris, or MacOSX. It will process all the required ISIS3 CTX steps and return map projected ISIS cubes and GIS-ready PNGs with worldfiles.
Not sure why I used cshell script as I usually write this stuff in PERL? I haven't tested it on Sun or Mac yet but it should work.
please test and modify as you wish,
Trent
Overview:
0.) Download script below (must be logged in to see attachment). In UNIX run chmod to make the script executable.
>chmod +x CTX_process_all.script.txt
note: I had to add a *.txt onto the script to attach it here. Normally I use a .script extension only.
1.) To help grab the CTX PDS images, use the PDS site, download the GIS footprints (I think this is the easiest) for use in a GIS or use pigwad to select the footprints you want. For the non-PDS methods, copy and paste the "DATA_LINK" files into a text file and prepend each line with "wget".
example:
wget http://pdsimg.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0003/data/T01_000806_2651_XN_85N014W.IMG
wget http://pdsimg.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0003/data/T01_000807_2638_XN_83N035W.IMG
...
The CTX footprints: ftp://ftpflag.wr.usgs.gov/dist/pigpen/mars/ctx/footprints/
2.) Before running you must first create a map file.
Use ISIS3's "maptemplate" program to create *.map. Here is the listing for a minimal N. Pole projection:
>cat npolar90.map
Code: |
Group = Mapping
ProjectionName = PolarStereographic
CenterLongitude = 0.0
CenterLatitude = 90.0
End_Group
End |
Tip: this will leave it up to ISIS to figure out the cellsize. If you want to later run mosaics in ISIS3, you should force a cellsize (i.e. resolution=6 m/p) for all images in the maptemplate program.
3.) run script:
>CTX_process_all.script.txt npolar90.map 1
where usage is: CTX_process_all.script.txt maptemplate.map [0|1]
0 = keep all files as you go
1 = delete old files as you go
Bring your PNGs into your favorite GIS. The projection will not be automatically known by the application. Consider defining it for the application or the images (will be different depending on your GIS). However, the worldfile defines the geolocation relative to the defined projection and will allow these images to register to each other without setting anything. |
|
Back to top » |
|
|
ah6p Osiris (Active Member)
Joined: 19 Mar 2004 Posts: 23
|
Posted: Tue Jul 24, 2007 11:04 am Post subject: |
|
|
Thanks. Works nicely. |
|
Back to top » |
|
|
LTY83 Horus (New Member)
Joined: 13 Mar 2008 Posts: 1
|
Posted: Thu Mar 13, 2008 8:34 am Post subject: Exactly what I was looking for |
|
|
Thank you so much for this.. BTW - Tested on MAC, worked fine! |
|
Back to top » |
|
|
Adakite Ra (Power Member)
Joined: 29 Mar 2005 Posts: 93 Location: IPGP, Paris
|
Posted: Mon Jul 07, 2008 8:05 am Post subject: |
|
|
Hi all,
I have just one recommandation:
at cam2map step, the current script won't take into account the PixRes (pixel resolution) of the map_file.map. So if mosaicking is needed afterwards, you have to change the line #80 by:
Code: |
cam2map "from=$i map=$map pixres=map to=$new"
|
otherwise, the current script will use the default pixel resolution of the cube file, which could be different for each file. |
|
Back to top » |
|
|
kainus Horus (New Member)
Joined: 19 May 2006 Posts: 4
|
Posted: Thu Oct 23, 2008 10:49 am Post subject: CTX img to jp2 script |
|
|
This is a Trent Hare script (Thanks Trent) to process CTX .img's to map projected, losslessly compressed, JPG2000 images. The conversion from lev2 cub files into jp2 format using the gdal commands is the only change between this script and Trent's other script posted above. You will still need a maptemplate .map file and it still runs in ISIS3.
If you plan to use or mosaic in most GIS apps they don't need to be the same resolution. If you want to mosaic in ISIS, then you want the same resolution, so use Adakite's tip.
When you're saving it to your special saving place, delete the .txt extension. Source or chmod the file and you're ready to go, e.g.
chmod +x CTX_process_all_jp2.csh
Enjoy.
Corey
all needed scripts bundled into one zip with a readme:
ftp://ftpflag.wr.usgs.gov/dist/pigpen/Perl/CTX_process_all_jp2.zip |
|
Back to top » |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|
|
|
|
If you are having problems logging in, accessing, or using the Isis Support Center, please contact
Isis Support Center Administration: isisweb[at]astrogeology.usgs.gov.
USGS Isis Home
|