mag_noaa [1] $SMEI/ucsd/gen/python/mag_noaa.py
[Previous] [Next]
 NAME:
	mag_noaa
 PURPOSE:
	Downloads daily-updated photospheric magnetic maps from NOAA and
	run's it through X's HCSS code to make a viable source surface map.
 CALLING SEQUENCE:
	mag_noaa.py <source> <destination> -ftp -sync -gzip -obs=obs
	as cron job:
	bash --login -c "mag_noaa.py"
 OPTIONAL INPUTS:
	<source>	source of photospheric magnetic field maps
			This is either a directory containing wso*.dat maps,
			or a text file with a list of fully-qualified names
			of wso*.dat files.
	<destination>	destination directory for source surface maps
	-ftp		synchronizes files on NOAA ftp server with local files.
			If -ftp is set then <source>=$DAT/map/wso_noaa and
			<destination>=$DAT/map/wso_noaa/hcss are used, unless
			-source and/or -destination are specified.
	-sync		only processes photospheric maps that do not have
			a matching source surface file in <destination>
	-gzip		gzip the output files in <destination>
	-obs=obs	observatory; must be one of wso, nso, mwo
			default is wso (Wilson Solar Observatory)
 CALLS:
	mirror [1], mirror [2], xhcs
 PROCEDURE:
	Currently  magnetic source surface map at 15 solar radii are made.
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS)
	OCT-2003, Paul Hick (UCSD/CASS)
	    Added mag_noaa_badfiles to exclude files stored in the text
	    file 'badfiles_'+obs+'.txt' located in the destination directory.
	NOV-2003, Paul Hick (UCSD/CASS)
	    Added a check to detect when a photospheric map downloaded from
	    NOAA overwrites an existing file. In this case the source surface
	    file in the destination directory (produced from the overwritten
	    file) is deleted to make sure that the new file is processed by
	    Xuepus program.
	OCT-2005, Paul Hick (UCSD/CASS)
	    Modified default for destination directory to subdirectory
	    hcss in source directory.
	JUN-2006, Paul Hick (UCSD/CASS)
	    nso_ktpk are now downloaded from remote subdirectory 2006
	FEB-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    nso_ktpk are now downloaded from remote subdirectory 2007


mag_noaa [2] $SMEI/ucsd/gen/python/mag_noaa.py
[Previous] [Next]
 NAME:
	mag_noaa
 PURPOSE:
	Downloads daily-updated photospheric magnetic maps from NOAA and
	run's it through X's HCSS code to make a viable source surface map.
 CALLING SEQUENCE:
	mag_noaa.py <source> <destination> -ftp -sync -gzip -obs=obs
	as cron job:
	bash --login -c "mag_noaa.py"
 OPTIONAL INPUTS:
	<source>	source of photospheric magnetic field maps
			This is either a directory containing wso*.dat maps,
			or a text file with a list of fully-qualified names
			of wso*.dat files.
	<destination>	destination directory for source surface maps
	-ftp		synchronizes files on NOAA ftp server with local files.
			If -ftp is set then <source>=$DAT/map/wso_noaa and
			<destination>=$DAT/map/wso_noaa/hcss are used, unless
			-source and/or -destination are specified.
	-sync		only processes photospheric maps that do not have
			a matching source surface file in <destination>
	-gzip		gzip the output files in <destination>
	-obs=obs	observatory; must be one of wso, nso, mwo
			default is wso (Wilson Solar Observatory)
 CALLS:
	mirror [1], mirror [2], xhcs
 PROCEDURE:
	Currently  magnetic source surface map at 15 solar radii are made.
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS)
	OCT-2003, Paul Hick (UCSD/CASS)
	    Added mag_noaa_badfiles to exclude files stored in the text
	    file 'badfiles_'+obs+'.txt' located in the destination directory.
	NOV-2003, Paul Hick (UCSD/CASS)
	    Added a check to detect when a photospheric map downloaded from
	    NOAA overwrites an existing file. In this case the source surface
	    file in the destination directory (produced from the overwritten
	    file) is deleted to make sure that the new file is processed by
	    Xuepus program.
	OCT-2005, Paul Hick (UCSD/CASS)
	    Modified default for destination directory to subdirectory
	    hcss in source directory.
	JUN-2006, Paul Hick (UCSD/CASS)
	    nso_ktpk are now downloaded from remote subdirectory 2006
	FEB-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    nso_ktpk are now downloaded from remote subdirectory 2007


mirror [1] $SMEI/ucsd/gen/python/mirror.py
[Previous] [Next]
 NAME:
	mirror
 PURPOSE:
	Simple interface to Perl script 'mirror'
 CATEGORY:
	smei/gen/python
 CALLING SEQUENCE:
	From command line:

	mirror.py job=<job> local_dir=<local_dir> remote_dir=<remote_dir>
	    remote_site=<remote_site> remote_user=<remote_user> remote_password=<remote_password>
	    recursive=<true|false> recurse_hard=<true|false> get_patt=<get_patt>

	As module:

	sts = mirror(job, local_dir, remote_site, remote_dir, remote_user,
	    remote_password, recursive, recurse_hard)
 OPTIONAL INPUT PARAMETERS:
	<job>		default: 'job'
			job name (used in the name of the temporary
			mirror package file in $TUB)
	<local_dir>	default: environment variable 'SMEI'
			local directory where the mirror copy is maintained
			The default is the location $SMEI of the local copy
			of the SMEI master tree.
	<remote_site>	    default: 'ips.ucsd.edu'
			remote server
	<remote_dir>	    default: '/loc_smei'
			directory tree on remote site to be mirrored
			The default is a copy of the SMEI master accessible
			by anonymous ftp only.
	<remote_user>	    default: 'anonymous'
	<remote_password>   default: '$USER@$HOSTNAME'
			user and password used by the mirror script to
			log into the ftp server.
			if remote_password='netrc' then an attempt is made
			to obtain the password from $HOME/.netrc
	recursive   =<true|false>
			    default: true
	recurse_hard=<true|false>
			    default: true (if recursive is set)
				     false (if recursive is not set)
	passive_ftp=<true|false>
			    default: false
	get_patt = <pattern>
	local_ignore = <local_ignore>
	-save		if set the package file created for mirror.pl is not deleted
 OUTPUTS:
	sts	    return status of mirror module
		    = None : if mirror was aborted. This currently occurs
			     only if mirror is run on ips.
		    = [list] : list of files downloaded (this list may be empty!!)

	<local_dir> updated by mirroring <remote_dir>. The results are appended
	to the log file $TUB/<job>.log
 CALLS:
	mirror [2]
 CALLED BY:
	mag_noaa [1], mag_noaa [2], mirror [1], mirror [2], sync_ace [1], sync_ace [2]
	sync_ips_mirror
 RESTRICTIONS:
	The following environment variables need to be defined:
	SMEI	points to the local copy of the SMEI master tree
	SSW points to the root of the SolarSoft tree
	    (the Perl script mirror is part of SolarSoft).
 PROCEDURE:
	Location of Perl script 'mirror' and name of
	mirror package file used to mirror the remote directory.
	(the package file is created on the fly and is deleted again).
 MODIFICATION HISTORY:
	DEC-2002, Paul Hick (UCSD/CASS)
	    Finalized original version
	DEC-2002, Paul Hick (UCSD/CASS)
	    Added a check to avoid overwriting the SMEI master tree
	    on ips.ucsd.edu
	MAR-2003, Paul Hick (UCSD/CASS)
	    Modified to allow mirror to run as a module.
	NOV-2003, Paul Hick (UCSD/CASS)
	    Instead of return 0 for failure and 1 for success, the return
	    value is now None for failure and a list of downloaded files for
	    success.
	DEC-2003, Paul Hick (UCSD/CASS)
	    Changed default of recurse_hard to false if recursive is not set.
	    It looks like recursive=false is ignored if recurse_hard=true (the
	    previous default) overrides.
	JAN-2004, Paul Hick (UCSD/CASS)
	    Added check for existence of Perl script mirror.
	    Added check for presence of Perl using first line of mirror script.
	OCT-2005, Paul Hick (UCSD/CASS)
	    Added local_ignore keyword.
	NOV-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added passive_ftp keyword.


mirror [2] $SMEI/ucsd/gen/python/mirror.py
[Previous] [Next]
 NAME:
	mirror
 PURPOSE:
	Simple interface to Perl script 'mirror'
 CATEGORY:
	smei/gen/python
 CALLING SEQUENCE:
	From command line:

	mirror.py job=<job> local_dir=<local_dir> remote_dir=<remote_dir>
	    remote_site=<remote_site> remote_user=<remote_user> remote_password=<remote_password>
	    recursive=<true|false> recurse_hard=<true|false> get_patt=<get_patt>

	As module:

	sts = mirror(job, local_dir, remote_site, remote_dir, remote_user,
	    remote_password, recursive, recurse_hard)
 OPTIONAL INPUT PARAMETERS:
	<job>		default: 'job'
			job name (used in the name of the temporary
			mirror package file in $TUB)
	<local_dir>	default: environment variable 'SMEI'
			local directory where the mirror copy is maintained
			The default is the location $SMEI of the local copy
			of the SMEI master tree.
	<remote_site>	    default: 'ips.ucsd.edu'
			remote server
	<remote_dir>	    default: '/loc_smei'
			directory tree on remote site to be mirrored
			The default is a copy of the SMEI master accessible
			by anonymous ftp only.
	<remote_user>	    default: 'anonymous'
	<remote_password>   default: '$USER@$HOSTNAME'
			user and password used by the mirror script to
			log into the ftp server.
			if remote_password='netrc' then an attempt is made
			to obtain the password from $HOME/.netrc
	recursive   =<true|false>
			    default: true
	recurse_hard=<true|false>
			    default: true (if recursive is set)
				     false (if recursive is not set)
	passive_ftp=<true|false>
			    default: false
	get_patt = <pattern>
	local_ignore = <local_ignore>
	-save		if set the package file created for mirror.pl is not deleted
 OUTPUTS:
	sts	    return status of mirror module
		    = None : if mirror was aborted. This currently occurs
			     only if mirror is run on ips.
		    = [list] : list of files downloaded (this list may be empty!!)

	<local_dir> updated by mirroring <remote_dir>. The results are appended
	to the log file $TUB/<job>.log
 CALLS:
	mirror [1]
 CALLED BY:
	mag_noaa [1], mag_noaa [2], mirror [1], mirror [2], sync_ace [1], sync_ace [2]
	sync_ips_mirror
 RESTRICTIONS:
	The following environment variables need to be defined:
	SMEI	points to the local copy of the SMEI master tree
	SSW points to the root of the SolarSoft tree
	    (the Perl script mirror is part of SolarSoft).
 PROCEDURE:
	Location of Perl script 'mirror' and name of
	mirror package file used to mirror the remote directory.
	(the package file is created on the fly and is deleted again).
 MODIFICATION HISTORY:
	DEC-2002, Paul Hick (UCSD/CASS)
	    Finalized original version
	DEC-2002, Paul Hick (UCSD/CASS)
	    Added a check to avoid overwriting the SMEI master tree
	    on ips.ucsd.edu
	MAR-2003, Paul Hick (UCSD/CASS)
	    Modified to allow mirror to run as a module.
	NOV-2003, Paul Hick (UCSD/CASS)
	    Instead of return 0 for failure and 1 for success, the return
	    value is now None for failure and a list of downloaded files for
	    success.
	DEC-2003, Paul Hick (UCSD/CASS)
	    Changed default of recurse_hard to false if recursive is not set.
	    It looks like recursive=false is ignored if recurse_hard=true (the
	    previous default) overrides.
	JAN-2004, Paul Hick (UCSD/CASS)
	    Added check for existence of Perl script mirror.
	    Added check for presence of Perl using first line of mirror script.
	OCT-2005, Paul Hick (UCSD/CASS)
	    Added local_ignore keyword.
	NOV-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added passive_ftp keyword.


mk [1] $SMEI/ucsd/gen/python/mk.py
[Previous] [Next]
 NAME:
	mk
 CALLING SEQUENCE:
	mk.py main sub1 sub2 ... -dir=<dir>
 INPUTS:
	main sub1 sub2 ...
	    name of main program, followed by additional
	    files needed for the compilation.
	    The file type, if specified, is ignored and is
	    replaced by .f
 OPTIONAL INPUTS:
	-g77	    use g77 compiler
	-intel	    use Intel Fortran 90 compiler
	-pgi	    use Portland compiler
	-absoft     use Absoft Fortran compiler

	-nogen	    do not include the forgen library
	-nofits     do not include the cfitsio library
	-noincl     do not use default include paths

	If none of these command line switches is set then
	the script will try to locate g77 first, then the Intel
	compiler.

	-dir=dir    destination directory for object files or executable/
		    The default destination is the current directory.
	-cc	    include libraries for linking C/C++ code
	-static     adds switch -static to compile command
	-obj	    only creates object files (used by olb script)
	-verbose    verbose mode
 OUTPUTS:
	The executable will be named 'main' (the name of the main program).
 CALLED BY:
	olb [1], olb [2]
 RESTRICTIONS:
	The g77 command includes the switches
	    -ffixed-line-length-none
 SIDE EFFECTS:
	Cannot be executed in the 'root' account.

	Include directories:
	    $SMEI_FOR/h, $SMEI_FOR/h/linux and $SMEI/for/h
	Library directory  :
	    Libraries should be located in $SMEI_LIB or $FOR
	    Two libraries are expected: gen and cfitsio.
	    $SMEI_LIB should always contain these.
 MODIFICATION HISTORY:
	JAN-2000, Paul Hick (UCSD/CASS)
	JAN-2001, Paul Hick (UCSD/CASS)
	    Added loop to handle compilation of  multiple files.
	SEP-2002, Paul Hick (UCSD/CASS)
	    Removed -fdollar-ok option from g77 compilations (all dollar
	    signs in variable names should have been removed by now).
	DEC-2003, Paul Hick (UCSD/CASS)
	    Added -lcfitsio to compile command (for Fortran FITS routines).
	MAY-2004, Paul Hick (UCSD/CASS)
	    Modifications to get this to run on the stesun Unix machines.
	    Use awk instead of gawk (on our Linux boxes awk is a soft link
	    to gawk). Changed the syntax for variable assignment from
		awk -v i=$i '{print $i}' to awk '{print $i}' i=$i
	    The first one doesn't work properly on the stesun machines.
	JUL-2004, Paul Hick (UCSD/CASS)
	    Added -Vaxlib switch for Intel compiler
	SEP-2004, Paul Hick (UCSD/CASS)
	    The default location for the libgen library is now $SMEI_LIB
	    (was $FOR).
	OCT-2004, Paul Hick (UCSD/CASS)
	    Added Portland compiler.
	JAN-2005, Paul Hick (UCSD/CASS)
	    Added -cc switch (will add a couple of C/C++ libraries
	    needed to cross compile Fortran and C/C++ code).
	JAN-2005, Paul Hick (UCSD/CASS)
	    Converted from bash to Python.
	JUL-2005, Paul Hick (UCSD/CASS)
	    Added code to handle .o, .c and .cpp files
	    The main program still must be a Fortran program.
	MAR-2007, Paul Hick (UCSD/CASS)
	    SpatialIndex library is no longer included for linking.
	OCT-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added -nogen and -nofits keyword
	    Added test for existence of get_compiler_<f77id> function.
	    If it exists already, use it. If not, create one.
	    Previously the file was always created, resulting with
	    a conflict with an existing one.


mk [2] $SMEI/ucsd/gen/python/mk.py
[Previous] [Next]
 NAME:
	mk
 CALLING SEQUENCE:
	mk.py main sub1 sub2 ... -dir=<dir>
 INPUTS:
	main sub1 sub2 ...
	    name of main program, followed by additional
	    files needed for the compilation.
	    The file type, if specified, is ignored and is
	    replaced by .f
 OPTIONAL INPUTS:
	-g77	    use g77 compiler
	-intel	    use Intel Fortran 90 compiler
	-pgi	    use Portland compiler
	-absoft     use Absoft Fortran compiler

	-nogen	    do not include the forgen library
	-nofits     do not include the cfitsio library
	-noincl     do not use default include paths

	If none of these command line switches is set then
	the script will try to locate g77 first, then the Intel
	compiler.

	-dir=dir    destination directory for object files or executable/
		    The default destination is the current directory.
	-cc	    include libraries for linking C/C++ code
	-static     adds switch -static to compile command
	-obj	    only creates object files (used by olb script)
	-verbose    verbose mode
 OUTPUTS:
	The executable will be named 'main' (the name of the main program).
 CALLED BY:
	olb [1], olb [2]
 RESTRICTIONS:
	The g77 command includes the switches
	    -ffixed-line-length-none
 SIDE EFFECTS:
	Cannot be executed in the 'root' account.

	Include directories:
	    $SMEI_FOR/h, $SMEI_FOR/h/linux and $SMEI/for/h
	Library directory  :
	    Libraries should be located in $SMEI_LIB or $FOR
	    Two libraries are expected: gen and cfitsio.
	    $SMEI_LIB should always contain these.
 MODIFICATION HISTORY:
	JAN-2000, Paul Hick (UCSD/CASS)
	JAN-2001, Paul Hick (UCSD/CASS)
	    Added loop to handle compilation of  multiple files.
	SEP-2002, Paul Hick (UCSD/CASS)
	    Removed -fdollar-ok option from g77 compilations (all dollar
	    signs in variable names should have been removed by now).
	DEC-2003, Paul Hick (UCSD/CASS)
	    Added -lcfitsio to compile command (for Fortran FITS routines).
	MAY-2004, Paul Hick (UCSD/CASS)
	    Modifications to get this to run on the stesun Unix machines.
	    Use awk instead of gawk (on our Linux boxes awk is a soft link
	    to gawk). Changed the syntax for variable assignment from
		awk -v i=$i '{print $i}' to awk '{print $i}' i=$i
	    The first one doesn't work properly on the stesun machines.
	JUL-2004, Paul Hick (UCSD/CASS)
	    Added -Vaxlib switch for Intel compiler
	SEP-2004, Paul Hick (UCSD/CASS)
	    The default location for the libgen library is now $SMEI_LIB
	    (was $FOR).
	OCT-2004, Paul Hick (UCSD/CASS)
	    Added Portland compiler.
	JAN-2005, Paul Hick (UCSD/CASS)
	    Added -cc switch (will add a couple of C/C++ libraries
	    needed to cross compile Fortran and C/C++ code).
	JAN-2005, Paul Hick (UCSD/CASS)
	    Converted from bash to Python.
	JUL-2005, Paul Hick (UCSD/CASS)
	    Added code to handle .o, .c and .cpp files
	    The main program still must be a Fortran program.
	MAR-2007, Paul Hick (UCSD/CASS)
	    SpatialIndex library is no longer included for linking.
	OCT-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added -nogen and -nofits keyword
	    Added test for existence of get_compiler_<f77id> function.
	    If it exists already, use it. If not, create one.
	    Previously the file was always created, resulting with
	    a conflict with an existing one.


mkramdisk $SMEI/com/linux/mkramdisk
[Previous] [Next]
 NAME:
	mkramdisk
 PURPOSE:
	Set up ramdisk
 CATEGORY:
 CALLING SEQUENCE:
	. $COM/mkramdisk
 INPUTS:
	(ramdisk entry in /etc/fstab)
 OUTPUTS:
	(env var $ramdisk)
 CALLED BY:
	login
 PROCEDURE:
	The ramdisk should be set up already at mount point /tmp/ramdisk.
	This can be done as follows:
	    mkdir /tmp/ramdisk
	    mke2fs /tmp/ramdisk
	Add the following line to /etc/fstab
	    /dev/ramdisk /tmp/ramdisk ext2 noauto,user 0 0

	The ramdisk is primarily used by the IDL procedure gunzip_file
	to store temporary unzipped files.
 MODIFICATION HISTORY:
	JUL-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)