How to use OMNIWeb's main script from command line In order to access OMNIWeb Plus data for a moderately large number of cases/runs, it may be convenient to use command lines rather than OMNIWeb Plus Browser interactive interface because that command line can be placed in an external loop to gain the ability to automatically change any combination of parameter values. Below are three examples of how to get (1) numeric data file with header and footer lines, (2) numeric data file with neither header nor footer lines (3) image plot files (gif). using command lines which include all needed parameter names and their values. Parameter values are those used as default values in the OMNIWeb page at https://omniweb.sci.gsfc.nasa.gov/form/dx1.html, while parameter names are obtained from the source code version of this OMNIWeb page. Using a similar approach - command line specification, with correspondening valid names taken from any selected home page included in the main OMNIWeb Plus page at http://omniweb.gsfc.nasa.gov/ - a user can get any desired set of data or image files ------------------------------------------------------------------ 1. Example for getting numeric data file with header and footer lines using wget and curl methods in UNIX environment. -------------------------------------------------- For curl command: > curl -d "activity=retrieve&res=hour&spacecraft=omni2&start_date=20050101&end_date=20050301&vars=8&vars=23&scale=Linear&ymin=&ymax=&view=0&charsize=&xstyle=0&ystyle=0&symbol=0&symsize=&linestyle=solid&table=0&imagex=640&imagey=480&color=&back=" https://omniweb.gsfc.nasa.gov/cgi/nx1.cgi > test_curl.txt Requested data (home page) will be saved at "test_curl.txt" file For wget command: >wget --post-data "activity=retrieve&res=hour&spacecraft=omni2&start_date=20050101&end_date=20050301&vars=8&vars=23&scale=Linear&ymin=&ymax=&view=0&charsize=&xstyle=0&ystyle=0&symbol=0&symsize=&linestyle=solid&table=0&imagex=640&imagey=480&color=&back=" https://omniweb.gsfc.nasa.gov/cgi/nx1.cgi -O test_wget.txt Requested data (home page) will be saved at "test_wget.txt" file -------------------------------------------------------------------- 2. Example for getting numeric data file with neither header nor footer lines using perl program ------------------------------------------------------------------------- #!usr/bin/perl #use strict; #use warnings; use LWP::Simple; my $url="https://omniweb.gsfc.nasa.gov/cgi/nx1.cgi?activity=ftp&res=hour&spacecraft=omni2&start_date=20040201&end_date=20040302&maxdays=31&vars=8&vars=23&scale=Linear&view=0&nsum=1&paper=0&charsize=&xstyle=0&ystyle=0&symbol=0&symsize=&linestyle=solid&table=0&imagex=640&imagey=480&color=&back="; my $name="res.txt"; getstore( $url, $name); open(FIN, "< $name ") || die "Can't open $name file: $!\n"; my $line; while() { $line=$_; chop($line); if( $line =~ /(ftp:\/\/omniweb\.gsfc\.nasa\.gov\/staging\/omni2_\d+\.lst)/g ) { $file_ftp=$1; if( $line =~ /(omni2_\d+\.lst)/g ) { $file_out=$1; last;} else {$file_out=0;} } else {$file_ftp=0;} } #end of while close(FIN); unlink($name); if($file_ftp){ print "file_out=$file_out\n"; getstore( $file_ftp, $file_out); } #end of program ----------------------------------------------------------------------------- 3. Example for getting GIF image file using perl program -------------------------------------------------- #!usr/bin/perl use LWP::Simple; my $url="http://omniweb.gsfc.nasa.gov/cgi/nx1.cgi?activity=plot&res=hour&spacecraft=omni2&start_date=20050101&end_date=20050301&vars=8&vars=23&scale=Linear&ymin=&ymax=&view=0&charsize=&xstyle=0&ystyle=0&symbol=0&symsize=&linestyle=solid&table=0&imagex=640&imagey=480&color=&back="; # get file including name of gif file my $name="test.txt"; getstore( $url, $name); open(FIN, "< $name ") || die "Can't open $name file: $!\n"; my $line=; while($line ne "") { # find the name of gif file if( $line =~ /(ret_\d+\.gif)/ ) { $gif=$1; last;} else {$gif=0;} $line=; chop($line); } #end while close(FIN); unlink($name); # print "line=$line\n"; if($gif){ $url_gif="http://omniweb.gsfc.nasa.gov/tmp/images/" . "$gif"; # Specify the name of you gif file $gif_file='test.gif'; # Pull out omni gif file getstore( $url_gif, $gif_file); print "Your gif file is $gif_file\n"; } else { print "No gif file for your input parameters\n"; } #unlink($name); #end of program -------------------------------------------------------- ____________________________________________________________ How to use main script for COHOWeb from command line go to: https://omniweb.gsfc.nasa.gov/coho/html/cohoweb_command_line_sample.txt ----------------- How to use main script for HELIOWeb from command line go to https://omniweb.gsfc.nasa.gov/coho/helios/helioweb_command_line_sample.txt ____________________________________________________________________