44 char *
ccdCorrKC[] = {{
"DREM"}, {
"PIX"}, {
"PITM"}, {
"COL"}, {
"CITM"}, {
"ROW"}, {
"RITM"}, {
"DEND"}};
60 buf[t] = (
unsigned char)ch;
93 for(c = 0; c <
CLEN; c++)
110 int i, a, b, c, d, e, f;
115 for (i=0; i<
PItem;i++)
118 sscanf(&
Istruction[IsCnt],
"%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
137 int i, a, b, c, d, e;
142 for (i=0; i<
CItem;i++)
145 sscanf(&
Istruction[IsCnt],
"%d%d%d%d%d", &a, &b, &c, &d, &e);
161 int i, a, b, c, d, e;
166 for (i=0; i<
RItem;i++)
169 sscanf(&
Istruction[IsCnt],
"%d%d%d%d%d", &a, &b, &c, &d, &e);
192 fs = open(buff, O_RDONLY);
194 siz = filelength(fs);
214 case PIX: ccdCommand = 0;
E_Pix();
break;
216 case COL: ccdCommand = 0;
E_Col();
break;
218 case ROW: ccdCommand = 0;
E_Row();
break;
220 case DEND: ccdCommand = 0; exit=0;
break;
238 char str[80], dpath[
_MAX_PATH], buff[255];
248 fs = fopen(dpath,
"r");
253 sprintf(buff,
"File: %s\nNOT FOUND\nPlease check the existence of this file", dpath);
266 fscanf(fs,
"%d", &ni);
273 fscanf(fs,
"%d%lf%lf%lf%d", &DOAS.
wlc[i], &DOAS.
k1[i], &DOAS.
k2[i], &DOAS.
wlref[i], &DOAS.
pixref[i]);
296 fs = fopen(buff,
"r");
298 if(fs == NULL)
return 1;
309 fscanf(fs,
"%s", DFTP.
ftpuser);
315 fscanf(fs,
"%s", DFTP.
ftppwd);
327 static char *erroption[] = {{
"NULL"},
328 {
"File OPTION.INI Not Found"},
329 {
"Error in Saving Mode Option"},
330 {
"Error in File Name Option"},
331 {
"Error in Image Type Option"},
332 {
"Error in Pixel Correction Option"},
333 {
"Error in Averaging Mode Option"},
334 {
"Error in Fixed Number of Measurement for Average Option"},
335 {
"Error in Total Exposure Time for Average Option"},
336 {
"Error in Dark Remove Option"},
337 {
"Error in Dark Source Option"},
338 {
"Error in Set CCD Temperature Flag"},
339 {
"Error in Plot Scale Flag"},
340 {
"Error in Plot Display Flag"},
341 {
"Error in Plot Y Scale Flag"},
342 {
"Error in SZAMax Parameter"},
343 {
"Error in Hidden Lines in Plot Before the Central one Option"},
344 {
"Error in Hidden Lines in Plot After the Central one Option"},
345 {
"Error in Display Blind Pixel Flag"},
346 {
"Error in Perform FTP Back-UP Option"},
347 {
"Error in Reference temperature for OMU Thermo-Regulation Option"},
348 {
"Error in OMU Thermo-Regulation mode"},
349 {
"Error in Mirroring CCD Image along X axis Option"},
350 {
"Error in Mirroring CCD Image along Y axis Option"},
351 {
"Error in AMS Option - Stepper motor Positioning mode"},
352 {
"Error in AMS Option - Display Progression Bars"},
353 {
"Error in Autorange before Average Option"},
354 {
"Error in MIGE Linked Parameter"},
355 {
"Error in MIGE Type Parameter"},
356 {
"Error in MIGE Operating mode Option"},
357 {
"Error in Shutter Connection Option"},
358 {
"Error in Shutter Type Option"},
359 {
"Error in DeltaSZA Flag"},
360 {
"Error in DeltaSZA Value"},
361 {
"Error: MinSZA < 0"},
362 {
"Error: MaxSZA < 0 "},
363 {
"Error: MinSZA > MaxSZA Value"},
364 {
"Error in the Defective pixel file"}};
366 return erroption[ercode];
374 static char *EqName[] = {{
"SPATRAM"},
397 int NUMLINESGOOD = 107;
402 fs = fopen(buff,
"r");
404 if(fs == NULL)
return 1;
419 sprintf(CARAT,
"%c", str[0]);
421 if ( (strcmp(CARAT,
"#") == 0) && (numlines == NUMLINESGOOD) )
424 fs = fopen(buff,
"r");
426 if(fs == NULL)
return 1;
490 fscanf(fs,
"%d", &
N_AVG);
492 if (N_AVG < 1 || N_AVG > 200)
499 if (TOTTEXP < 0 || TOTTEXP > 100)
525 fscanf(fs,
"%d", &
FLAG.
Wl);
546 fscanf(fs,
"%d", &
SZAMax);
548 if (SZAMax < 0 || SZAMax > 180)
589 fscanf(fs,
"%d", &OMUTHR.
TRType);
819 fs = fopen(buff,
"r");
821 if(fs == NULL)
return 1;
913 int c, dr=0,dg=0,db=0;
916 if(fs == NULL)
return 1;
920 for(c = 0; c < 256; c++)
953 int c, dr=0,dg=0,db=0;
957 fs = fopen(buff,
"r");
959 if(fs == NULL)
return 1;
963 for(c = 0; c < 256; c++)
1013 sprintf(str,
"%.1lf%%",(
double)OMUTHR.
PCPower / 10);
1099 fs = fopen(buff,
"r");
1100 if(fs == NULL)
return 1;
1180 fs = fopen(buff,
"r");
1181 if(fs == NULL)
return 1;
1227 fs = fopen(buff,
"r");
1228 if(fs == NULL)
return 1;
1257 fscanf(fs,
"%d", &OMUTHR.
PCPower);
1440 fd = fopen(buff,
"r");
1441 if(fd == NULL)
return 1;
1484 fd = fopen(buff,
"r");
1485 if(fd == NULL)
return 1;
1522 fs = fopen(
"LOG\\Paramini.LOG",
"r");
1523 if(fs == NULL)
return 2;
1525 fscanf(fs,
"%d", &c);
1541 fs = open(fname, O_RDONLY );
1542 if(fs < 0)
return 0;
1543 siz = filelength(fs);
1560 sprintf(lb,
"%s", tit);
1569 goal = wait + clock();
1570 while( goal > clock() )
short DB_BG_lblUP[3]
Background Capital Letters Labels Color UP.
stepm StepM
Stepper motors parameters structure.
int LoadGeoCoord(void)
Load Geographic Coordinate of the station. Procedure that load the Geographic Coordinate of the stati...
double k2[20]
k2 dispersion parameter -slope (x stretch2
gui Gui
Graphic User Interface Structure.
int LoadEquipment(void)
Load the type of Equipment. {homedir}/config/param.ini.
MOBJECT speed[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "speed".
void MSetInputPromptRGB(int r, int g, int b)
short DB_FG_Plbl[3]
Foreground PASSIVE Label Colors.
optionini DOption
Options for DAS execution.
int LoadTestPalette(char *nf)
Load a test palette. Procedure that load a test palette.
void sleep(clock_t wait)
Pauses for a specified number of milliseconds. .
int savingmode
Flag to set saving mode: 0=ASCII, 1=Binary.
int LoadTruePalette(void)
Load the palette map. Procedure that load the palette map from file {homedir}/Palettes/Danbomap1.map.
double alititude
Station altitude.
MTColor MBlackColor(void)
#define TESTCCD
execution for testing CCD Camera
int MaskedRow[100][6]
Masked rows array.
int NAMS
Number of AMSs Devices.
int TRType
Type of thermo regulation (0=TRTCOOL, 1 = TRTHEAT, 2= TRTBOTH)
#define PIX
Pixel identifier.
double newlatitude[20]
New Station latitude.
double newlongitude[20]
New Station longitude.
int PCPower
Power to the Peltier for Cooling.
int Wl
Flag for the units on the X scale plot.
int plotW
Flag for the plot display.
int LoadFTPSetting(void)
Load FTP Setting for daily back-up.
das structure (contain all the previous structures) .
Control Panel and push buttons colors .
void MSetMessageDialogFonts(MTFont text_font, MTFont buttons_font)
double latitude
Station latitude.
flag Flag
Structure for different flags.
int darkremove
Flag to set Dark Removal from measurements; motors0 = No Dark Removal, 1 = Dark Removal.
structure for FTP setting
int AssignParam(int mod)
Assign parameters to the CP labels. .
char HOMEDIRECTORY[_MAX_PATH]
int filtertype
type of installed filter module: 0=Simple-SM3, 1=Double-SM3+SM4, 2=simpleplus-SM3+TM) ...
short DB_BG_Albl[3]
Background ACTIVE Label Colors.
#define DBDEMO
execution in demo mode
void MSetInputPromptFonts(MTFont text, MTFont edit, MTFont btn)
void MSetInputPromptFgRGB(int r, int g, int b)
int MaskedCol[100][6]
Masked column array.
unsigned short DigOut
Digital Output.
int slope[AMSMAX][2]
Stepper Motors Slope.
MOBJECT step[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "step".
MOBJECT lbl_Par[11]
Parametric Labels of the Control Panel.
short DB_Sel[3]
Selected Buttons Colors.
#define COL
Column identifier.
void MSetMessageDialogFgRGB(int r, int g, int b)
geographical coordinate structure .
int avgautor
autoranging for averaged measurement, 0 = NO AutoR before average; 1 = AutoR before average; ...
int MD_CreateBRowShell(int nrows)
Create windows of buttons. During the plotting of the measurements, create a shell of buttons if the ...
int RItem
number of Pixel, Column, Row Item
#define TEMPORIZED
execution driven by MASTER file
void MSetMessageDialogRGB(int r, int g, int b)
#define SZAMASTERM
execution driven by MASTERSZA file ( there is the possibility to distinguish between AM and PM measur...
double wlref[20]
reference wavelength
void MObjectSetText(MOBJECT obj, const char *text)
int SZAMax
Maximum SZA for performing measurements.
short DB_BG_RButt[3]
Background Radio Buttons.
int LoadParam(void)
Load the exe parameters. Procedure that load the parameters for CCD, Stepper Motors and Peltier from ...
d_geo DGeo
struct for Station location
void FlushLine(char *buf, int nc, FILE *f)
Flush line of file f read a maximum of nc character since when the read char is different from ch(10)...
MOBJECT slope[AMSMAX][2]
Active Control Panel Labels for Stepper Motors "Slope".
int pixref[20]
reference pixel
int LoadDasSysCol(void)
Load system colors. Procedure that load the DAS colors in the file {homedir}/config/DASSysColor.INI.
long PrgSiz
Size of the PRG file.
d_geo DGEO
geographical coordinates structure
int hlinebefore
Number of HiddenLines before the central line in Plot.
char * Program
buffer for the PRG file
int timezone
Station timezone.
char s_name[4]
Station name.
#define PITM
Number of Pixel items identifier.
int avgmode
Flag to set Averaging mode: 0 = Repeat measurements for fixed number, 1 = Repeat measurements for fix...
long PrgCnt
Counter for the position in the PRG file.
int LoadDB_Options(void)
Load Options. Procedure that load the Options in the file {homedir}/config/Options.INI.
int VBin
CCD Vertical Binning.
paramini structure . It contains some of the parameters defined in the file PARAM.INI .
int CoolPw
CCD Init Power.
char CONFIGDIREQUIPMENT[_MAX_PATH]
double MaxSZA
Maximum SZA.
int emshutter
Presence of the CCD Shutter, emshutter = 1 –> Shutter IS Installed, = 0 –> Shutter NOT Installed...
#define ROW
Row identifier.
int LoadExec(char *fname)
Load file for automatic execution. Procedure that load the file for automatic execution.
MTColor MAllocColor(int r, int g, int b)
int DeltaSZA
= 1 Delta SZA measurements activated, = 0 Continous measurements
short DB_FG_Albl[3]
Foreground ACTIVE Label Colors.
char ftpuser[32]
FTP server users.
int plotYRange
0 –> full range; 1 –> min/max
int resetFreq
frequency of DAS/Windows Reset
#define PRGFILE
execution driven by *.prg file
short DB_BG_Plbl[3]
Background PASSIVE Label Colors.
double int2hertz(int mod, int k)
double k1[20]
k1 dispersion parameter - intercept (x stretch1)
int IDY
Number of sensible vertical pixels.
double cop_perc[AMSMAX][2]
Stepper Motors Power percent.
int newtimezone[20]
Station timezone.
char news_name[20][4]
New Station name.
int TOTTEXP
Total Exposure time in Averaging mode.
double newalititude[20]
New Station altitude.
int amsprogbar
display/hide prograssion bar, 0 = Hide, 1 = display
char ftpserver[32]
FTP server address.
void ReadLine(char *buf, int nc, FILE *f)
Read Line on a file Read one record of nc character on the file f.
int hlineafter
Number of HiddenLines after the central line in Plot.
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
int nitem
Number of items of the GeoDB.ini.
short DB_BG[3]
Default Background Color.
short DB_FG_RButt[3]
Foreground Radio Buttons.
MOBJECT Albl_Status
Active Control Panel Labels for Status.
double int2perc(int mod, int k)
translate the AMS digit unit in text. The power assigned to the motor trough the AMS, is translated in text
#define SZAMODE
execution driven by SZAPRG file
int LoadDB_DefectPixel(char *buff)
Load Defective pixel mask. Procedure that load the Defective pixel mask in the file {homedir}/config/...
int mirrorimg[2]
Flag to set the mirroring of the CCD image: 0 = NO Mirroring, 1= YES Mirroring (element 0 for X axis;...
char step_fraz[AMSMAX][2][6]
Stepper Motors Step fraction.
void val2fraz(int id, int sn, int val)
Decimal value to ratio value Similar to listval2fraz The decimal value indicating the fractioning of ...
int MaskedPix[100][6]
Masked pixel's array.
int LoadDB_DispCoeff(void)
Load dispersion parameters. Procedure that load the dispersion parameters from file {homedir}/DOAS/Di...
int pixcorr
Flag to set defective pixel correction: 0=NOT Corrected, 1=Corrected.
int wlc[20]
Central wavelength.
controlpanel ContrPanel
Control Panel Structure.
int ftpbackup
Flag to set back up: 0 = NO FTP Back-UP; 1 = Perform FTP Back-UP.
#define DREM
text after this is a comment
int imgtype
Flag to set Image type: 0=MONOINT, 1=RGB.
MTColor MWhiteColor(void)
double longitude
Station longitude.
int measmode
measuring mode: 0 = Single; 1 = Averaged
#define RITM
Number of Rows items identifier.
short DB_UnSelFG[3]
Unselected Buttons Colors.
int speed[AMSMAX][2]
Stepper Motors Speed.
int step[AMSMAX][2]
Stepper Motors Step.
void LoadDefaultDFONT(void)
Load Default Fonts. Procedure that load the DAS fonts if the file {homedir}/config/DASFonts.ini is not present.
short DB_UnSel[3]
Unselected Buttons Colors.
char * CodeEq2Name(int code)
code Equipment to Name
double speed_Hz[AMSMAX][2]
Stepper Motors Speed [Hz].
double maxtexp
Maximum exposure time (used in Autorange())
int aaopmode
operation mode for the Alt Az Platform, 0 = solar Traxker; 1 = Anti-Solar Tracker; 2 = Free Positioni...
char ftppwd[32]
FTP server pwd.
int smposmode
positioning mode for stepper , 0 = sequential mode; 1 = simoultaneous mode
#define CITM
Number of Columns items identifier.
int filename
Flag to set file name mode 0=Free choice, 1 = Automatic.
int EqType
Spectrometer Type.
#define TESTAD
execution for testing PC 104 AD converter
char * ERR_Option(int ercode)
Alerts for OPTION.INI errors Creates a message window reporting the reasons for the error...
char CONFIGDIRCOMMON[_MAX_PATH]
unsigned char DigIn
Digital Input.
int N_AVG
Number of measurements for Averaging mode in fixed number of meas. mode.
int darksource
Flag to set Dark source: 0 = Blind Pixels, 1 = Full Frame.
int resetEnabled
DAS/Windows reset option (1 = Enabled; 0 = disabled)
int refertemp
Flag to set the reference temp for thermo-regulation: 0 = AVGPINT; 1 = OPTIC; 2 = GRATING...
C_DEF int DI_FileExist(char *tit)
int type
type of NOVA monoboard used (7892 or 945GSE)
int resetType
type of period for DAS Reset: 0=Hours, 1=Days
int DispBlindPix
Display Blind Pix: 0 = NO, 1 = Yes.
int shuttertype
type of installed shutter: 0 = VS25, 1 = Rotating Shutter, 2 = TorqueMotor
void Status(char *tit)
Writes information's on the Status label .
double ITemp
CCD Target Temperature.
unsigned int maxlvlar
maximum level of autoranging (max 65000)
MOBJECT power[AMSMAX][2]
active Control Panel Labels for Stepper Motors "power"
int LoadDFONT(void)
Load Fonts. Procedure that load the DAS fonts from {homedir}/config/DASFonts.ini AVAILABLE for Releas...
int exemode
Set the Execution MODE (Execution modes)
double TPelt
OMU Target Temperature.
OMU Thermoregulation structure .
double MinSZA
Minimum SZA.
#define TESTAMS
execution for testing AMS's devices
short DB_FG_lblUP[3]
Foreground Capital Letters Labels Color UP.
int LoadParamLog(void)
Load file for CCD status. Procedure that load the file {homedir}/config/paramlog.ini, for the actual status of the CCD.
#define MANUAL
execution in manual mode (for lab use)
void LoadDefaultDPAL(void)
Load Default system colors. Procedure that load the DAS colors if the file {homedir}/config/DASSysCol...
char DEFPIXFILENAME[_MAX_PATH]
defective pixel filename with path
int power[AMSMAX][2]
Stepper Motors Power.
paramini Paramini
structure for the parameters defined in param.ini configuration file