From: Rekhesh Mohan Date: Sun, 12 Aug 2012 11:01:40 +0000 (+0530) Subject: v1.01 : New option (-p) to specify input parameter filename X-Git-Url: https://cads.iiap.res.in/gitview/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=stellar_spectrum.git v1.01 : New option (-p) to specify input parameter filename --- diff --git a/ChangeLog.txt b/ChangeLog.txt index 0143f0f..d48b091 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,3 +5,9 @@ CHANGELOG for CADS/UVS Stellar Spectrum software NOTE: This file records the changes made after the release of the stable version UVS_stellar_spectrum-1.0 ------------------------------------------------------------------------ + +v1.01 + * New option to specify the name of input parameter file (using -p) + this was needed to run multiple instances of stellar_spectrum in a folder + (for cads uvsky simulation) + diff --git a/README.txt b/README.txt index 972e5dc..57b327f 100644 --- a/README.txt +++ b/README.txt @@ -41,16 +41,23 @@ stellarspec_initparams.txt. The general usage pattern is: Options are: -h help - -g Generates a well documented default parameter file - -Once you have the default parameter file, you can edit it as per your needs -and run the program without any arguments to generate the stellar spectrum. -NOTE: This program requires the kurucz model datafiles to simulate stellar -spectrum. If you have installed it right, these files would be installed in + -g Generates a well documented default parameter file + Once you have the default parameter file, you can edit it as per your + needs and run the program without any arguments to generate the stellar + spectrum. + + -p + Default parameter file is "stellarspec_initparams.txt". You can + override this using -p flag. For eg., if several instances of this + program are running in parallel from same directory, this flag can + be used to avoid conflicts around same parameter file name. + +NOTE: This program requires the kurucz model datafiles to simulate stellar +spectrum. If you have installed it right, these files would be installed in /share/cads/data/ and the default parameter file is aware of the location. These datafiles are also available in the subdirectory named -"spectral_data" inside the source distribution as well. +"spectral_data" inside the source distribution as well. 3. DOCUMENTATION diff --git a/configure.ac b/configure.ac index 7802b7b..40948cf 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([CADS_stellar_spectrum], [1.0], [cads@iiap.res.in]) +AC_INIT([CADS_stellar_spectrum], [1.01], [cads@iiap.res.in]) AC_LANG_C AM_INIT_AUTOMAKE([-Wall -Werror]) AC_CONFIG_SRCDIR([config.h.in]) diff --git a/src/read_write.c b/src/read_write.c index 3954d8a..fcf0c37 100644 --- a/src/read_write.c +++ b/src/read_write.c @@ -105,6 +105,7 @@ void usage() printf (" Usage: uvs_stellar_spectrum [options]\n\n"); printf (" options are:\n"); printf (" [-g] Generates the default parameter file \n"); + printf (" [-p] : Use inputs from \n"); printf (" [-h] help \n\n" ); printf (" In the absence of command line options, the program would\n"); printf (" read inputs on stellar magnitude, reddening and spectral \n"); diff --git a/src/stellar_spectrum.c b/src/stellar_spectrum.c index aedf4d4..200d4a3 100644 --- a/src/stellar_spectrum.c +++ b/src/stellar_spectrum.c @@ -84,11 +84,18 @@ Reks: 01 July 2012: 1. Rebranded to CADS/UVS, reset version to 1.0 in new cads git repository 2. Renamed to stellar_spectrum 3. read/write ops shifted to read_write.c + +Reks: 12 Aug 2012: v1.01 +1. New option to specify the parameter filename - this was needed to run + multiple instances of stellar_spectrum in a folder (cads uvsky simulation) ----------------------------------------------------------------------------*/ #include "stellar_spectrum.h" #include +char *optarg; +int optindex; + /* Main program starts here*/ /****************************************************************************/ int main (int argc, char *argv[]) @@ -109,13 +116,16 @@ int main (int argc, char *argv[]) strcpy(ParamFile, paramfile);/*paramfile is defined in header file*/ /* Command line options*/ - while ( (c = my_getopt (argc, argv, "gh") ) != EOF) + while ( (c = my_getopt (argc, argv, "p:gh") ) != EOF) switch (c) { case 'g': gen_stspec_params(ParamFile); return(EXIT_SUCCESS); break; + case 'p': + strcpy(ParamFile, optarg); + break; case 'h': usage(); break; @@ -125,7 +135,7 @@ int main (int argc, char *argv[]) } /* Open and read the parameter file */ - READ_PARAMS(paramfile, &stars, OutFile); + READ_PARAMS(ParamFile, &stars, OutFile); /* try opening the wave file */ if ((wave_ptr = fopen(stars.WaveFile,"r")) == NULL) {