~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to gui/XFilter/src/save_mod.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*===========================================================================
 
2
  Copyright (C) 1995-2009 European Southern Observatory (ESO)
 
3
 
 
4
  This program is free software; you can redistribute it and/or 
 
5
  modify it under the terms of the GNU General Public License as 
 
6
  published by the Free Software Foundation; either version 2 of 
 
7
  the License, or (at your option) any later version.
 
8
 
 
9
  This program is distributed in the hope that it will be useful,
 
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
  GNU General Public License for more details.
 
13
 
 
14
  You should have received a copy of the GNU General Public 
 
15
  License along with this program; if not, write to the Free 
 
16
  Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
17
  MA 02139, USA.
 
18
 
 
19
  Corresponding concerning ESO-MIDAS should be addressed as follows:
 
20
        Internet e-mail: midas@eso.org
 
21
        Postal address: European Southern Observatory
 
22
                        Data Management Division 
 
23
                        Karl-Schwarzschild-Strasse 2
 
24
                        D 85748 Garching bei Muenchen 
 
25
                        GERMANY
 
26
 
 
27
.VERSION
 
28
 090826         last modif
 
29
 
 
30
===========================================================================*/
 
31
 
 
32
 
 
33
#include <stdio.h>
 
34
#include <string.h>
 
35
#include <globaldef.h>
 
36
#include <model.h>
 
37
 
 
38
 
 
39
extern void endname();
 
40
 
 
41
 
 
42
 
 
43
 
 
44
 
 
45
void    save_mod(name)
 
46
char    name[];
 
47
{
 
48
extern  struct s_trans  T;
 
49
extern  struct s_gui    G;
 
50
 
 
51
FILE    *out;
 
52
char    term[10];
 
53
 
 
54
endname(name,term);
 
55
 
 
56
if(strcmp(term,"trans"))
 
57
        strcat(name,".trans");
 
58
 
 
59
strcpy(T.transfile,name);
 
60
 
 
61
out=fopen(name,"w");
 
62
 
 
63
 
 
64
fprintf(out,"# Configuration file for Transmission model : %s\n",name);
 
65
fprintf(out,"instrument      %s\n\n",G.sel_inst);
 
66
 
 
67
if (T.ispectra !=0)
 
68
        fprintf(out,"spectrum        %d %s %s\n",
 
69
                                T.ispectra,T.spectrapath,T.spectrafile);
 
70
else
 
71
        fprintf(out,"spectrum        %d no_path no_spectrum\n",T.ispectra);
 
72
fprintf(out,"sky             %d %d %d\n",T.isky,T.darkness,T.emlines);
 
73
fprintf(out,"atmosphere      %d %f\n",T.iatmos,T.airmass);
 
74
fprintf(out,"mirror          %d\n",T.imirror);
 
75
fprintf(out,"optics          %d\n",T.ioptics);
 
76
fprintf(out,"dispersor       %d %d\n",T.igrism,T.ngrism);
 
77
fprintf(out,"filter          %d %d\n",T.ifilter,T.nfilter);
 
78
fprintf(out,"ccd             %d %d\n",T.iccd,T.nccd);
 
79
fprintf(out,"gain            %f\n",T.einadu);
 
80
fprintf(out,"ron             %f\n",T.ron);
 
81
fprintf(out,"etime_snr       %d %f %f\n",T.itimeSN,T.etime,T.SN);
 
82
fprintf(out,"extractsky      %d\n",1);
 
83
 
 
84
fclose(out);
 
85
}