X-Git-Url: https://cads.iiap.res.in/gitview/?p=stellar_spectrum.git;a=blobdiff_plain;f=src%2Fstellar_spectrum.c;h=200d4a3de3ca5e7ec15bb08e40b0274e99b9221b;hp=aedf4d45c15c2b7a257f5e28172a3b25f3fb7349;hb=433d85e1ab7ec6a8e1585ded43033a46de602c77;hpb=9fd9d1d4be423ec99ce1521d2b13c052c5d025db 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) {