index aedf4d4..200d4a3 100644 (file)
@@ -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 <sys/types.h>
 
+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)
     {