DAS
3.1.6 - 18/09/2017
|
#include <io.h>
#include <fcntl.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "mgui.h"
#include "DAS_Spatram.h"
#include "dcl.h"
#include "dil.h"
#include "bil.h"
#include "DOAS.h"
Go to the source code of this file.
Functions | |
void | AssignNewH () |
void | D_Print_BIL_H_BIN (int mod, int fd) |
void | D_PrintH_ASCII (int mod, FILE *fff) |
void | D_PrintH_BIN (int mod, int fd) |
void | D_PrintHMod (FILE *fff) |
Print the header in Column format. More... | |
int | D_save_asc (char *fname, int s) |
int | D_save_bif (char *f, int s) |
int | D_save_bin (char *f, int s) |
int | D_WriteInitLog (char *str) |
writes devices errors(AMS, CCD...) on the Devices.log file. More... | |
int | DB_Column (char *sourcefilename) |
Column format. More... | |
void | DB_Save (char *tit, int mod) |
Save the acquired spectrum. Procedure that Save the acquired spectrum. More... | |
void | DB_save_img (char *tit, int mod) |
Saving image. Procedure for saving the CCD Image Used until version 2.0.9, Since 2.1.0 D_Saving(void) is used. More... | |
void | getdate (struct date *tp) |
get current date More... | |
void | GetDateTime (struct date *dp, struct time *tp, struct tm *when) |
void | gettime (struct time *tp) |
get current time More... | |
int | ReadHeaderOldF (FILE *fd) |
read the ASCII header of the stored spectrum (OLD FORMAT - replaced by ReadHeaderOnly(FILE *fd) More... | |
int | ReadHeaderOnly (FILE *fd) |
read the ASCII header of the stored spectrum More... | |
int | SaveDataOffLine (char *fname, int mod) |
int | SmoothData (unsigned short *source, float *destination, int horpix, int verpix, int filw, int bp) |
Calc. the smoothed matrix of an unsigned short one. . More... | |
int | SmoothFloatData (float *source, float *destination, int horpix, int verpix, int filw, int bp) |
Calc. the smoothed matrix of a float one. . More... | |
void | UPS_Status (void) |
void | WriteColumn (int mod, FILE *fd) |
void | WriteSelColandSmoothed (int mod, FILE *fd, int selcol) |
write selected Column More... | |
Variables | |
bil | BIL |
config | Cfg |
ccd | DC_CCD |
ptf | DC_HP |
doas | DOAS |
flag | FLAG |
flags structure More... | |
GratingSt | GRS |
Grating. More... | |
hdrsp | HDRSP |
void D_Print_BIL_H_BIN | ( | int | mod, |
int | fd | ||
) |
Definition at line 284 of file Save.c.
References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, spectrumheader::comment, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, spectrumheader::TIME, and spectrumheader::wavelen.
Referenced by SaveDataOffLine().
void D_PrintH_ASCII | ( | int | mod, |
FILE * | fff | ||
) |
Definition at line 362 of file Save.c.
References hdrsp::ccdnr, hdrsp::ccdtemp, hdrsp::ccdtexp, hdrsp::ccdvbin, hdrsp::ccdwx, hdrsp::ccdwy, hdrsp::ccdxe, hdrsp::ccdxs, hdrsp::ccdye, hdrsp::ccdys, hdrsp::comment, date::da_day, date::da_mon, date::da_year, hdrsp::DATE, hdrsp::dummy1, hdrsp::dummy2, hdrsp::dummy3, hdrsp::dummy4, hdrsp::filpos, hdrsp::imgfmt, hdrsp::imgmax, hdrsp::imgmin, hdrsp::lambda, hdrsp::mirpos, hdrsp::s_alt, hdrsp::s_latitude, hdrsp::s_longitude, hdrsp::s_name, hdrsp::s_sza, time::ti_hour, time::ti_min, time::ti_sec, and hdrsp::TIME.
Referenced by D_save_asc().
void D_PrintH_BIN | ( | int | mod, |
int | fd | ||
) |
Definition at line 323 of file Save.c.
References hdrsp::bincomment, hdrsp::binfilpos, hdrsp::binmirpos, hdrsp::ccdnr, hdrsp::ccdtemp, hdrsp::ccdtexp, hdrsp::ccdvbin, hdrsp::ccdwx, hdrsp::ccdwy, hdrsp::ccdxe, hdrsp::ccdxs, hdrsp::ccdye, hdrsp::ccdys, hdrsp::DATE, hdrsp::dummy1, hdrsp::dummy2, hdrsp::dummy3, hdrsp::dummy4, hdrsp::imgfmt, hdrsp::imgmax, hdrsp::lambda, hdrsp::s_alt, hdrsp::s_latitude, hdrsp::s_longitude, hdrsp::s_name, hdrsp::s_sza, and hdrsp::TIME.
Referenced by D_save_bif().
void D_PrintHMod | ( | FILE * | fff | ) |
Print the header in Column format.
*fff | destination file number |
Definition at line 790 of file Save.c.
References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::comment, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.
Referenced by WriteColumn(), and WriteSelColandSmoothed().
int D_save_asc | ( | char * | fname, |
int | s | ||
) |
Definition at line 451 of file Save.c.
References D_PrintH_ASCII(), DIL, FLTIMG, FRdMat, image::Idx, image::Idy, dil::Img, INTIMG, image::Mat, img::type, URdMat, and VRange().
Referenced by DB_Save().
int D_save_bif | ( | char * | f, |
int | s | ||
) |
Definition at line 398 of file Save.c.
References D_PrintH_BIN(), DIL, image::Idx, image::Idy, dil::Img, INTIMG, image::Mat, O_BINARY, raddeg, img::type, and URdMat.
Referenced by DB_Save().
int D_save_bin | ( | char * | f, |
int | s | ||
) |
Definition at line 177 of file Save.c.
References img::Bmat, img::CamName, img::CCDName, img::col, img::Ctrst, img::DATE, DIF_CAMERA, DIF_STAT, DIF_TIME, DIL, FLTIMG, img::Fmat, img::gain, img::Gmat, img::HBin, img::High, image::Idx, image::Idy, img::IHigh, img::ILow, img::Imat, dil::Img, img::InfoPar, INTIMG, img::Low, image::Mat, img::MaxNumbers, img::Media, O_BINARY, img::off, img::range, img::Rmat, img::SExp, img::Sigma, img::Sx, img::Sy, img::TAMB, img::TCCD, img::TIME, img::type, img::VBin, img::Wx, and img::Wy.
int D_WriteInitLog | ( | char * | str | ) |
writes devices errors(AMS, CCD...) on the Devices.log file.
Definition at line 144 of file Save.c.
Referenced by AMS_Error(), AMSINI_Err(), CCD_Error(), DAS_Error(), InitCCD_AMS(), InitTempAD(), Master_Error(), MGUIMain(), and WinRes().
int DB_Column | ( | char * | sourcefilename | ) |
Column format.
*sourcefilename | source file name |
Definition at line 1109 of file Save.c.
References AllocUSMat(), D_VRange(), DI_FindExtName(), bil::DPLOT, doas::FFTFilter, FilterData(), tools::FlagFilter, IDX, IDY, d_view::ImatGraf, O_BINARY, ReadHeader_ASCII(), ReadHeader_BIN(), ReadIMG(), ReadIMG_BIN(), SAVECNT, TOOLS, flag::Wl, and WriteColumn().
Referenced by D_PButt_CB(), and DT_ColFormat().
void DB_Save | ( | char * | tit, |
int | mod | ||
) |
Save the acquired spectrum. Procedure that Save the acquired spectrum.
*tit | pointer to the char variable with the file name |
mod |
|
Definition at line 552 of file Save.c.
References D_BuildH(), D_save_asc(), D_save_bif(), DAS, img::DATE, DIL, DOASMODE, flag::exemode, das::Flag, GetDateTime(), dil::Img, image::Mat, OFFLINEPLOT, SaveDataOffLine(), Server, and img::TIME.
Referenced by D_PButt_CB(), D_Saving(), DB_HorComm_CB(), DB_KeyB_CB(), PopUp_CB(), and SaveCalib().
void DB_save_img | ( | char * | tit, |
int | mod | ||
) |
Saving image. Procedure for saving the CCD Image Used until version 2.0.9, Since 2.1.0 D_Saving(void) is used.
*tit | –> file name where the image will be saved |
mod |
|
Definition at line 580 of file Save.c.
References FWS, IDX, IDY, MIS, O_BINARY, FilterWheelSt::Pos, MirrorSt::Pos, Status(), TExp, wl, and GratingSt::Wl.
void getdate | ( | struct date * | tp | ) |
get current date
Definition at line 131 of file Save.c.
References date::da_day, date::da_mon, and date::da_year.
Definition at line 43 of file Save.c.
References date::da_day, date::da_mon, date::da_year, time::ti_hour, time::ti_hund, time::ti_min, and time::ti_sec.
Referenced by AutoR_No_Shutt(), AutoR_With_Shutt(), ChkMaster(), D_AutoExecution(), DB_GetCCD(), DB_Save(), E_Dark(), GetDefPix(), MGUIMain(), SetWindowsReset(), SZA_FirstCalc(), Task_LOG(), Task_Timer(), WinRes(), WriteAMSCB(), WriteOptioniniCB(), WriteParaminiCB(), and WritewlstepiniCB().
void gettime | ( | struct time * | tp | ) |
get current time
Definition at line 92 of file Save.c.
References time::ti_hour, time::ti_hund, time::ti_min, and time::ti_sec.
int ReadHeaderOldF | ( | FILE * | fd | ) |
read the ASCII header of the stored spectrum (OLD FORMAT - replaced by ReadHeaderOnly(FILE *fd)
fd | number of source file |
Definition at line 751 of file Save.c.
References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::comment, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.
Referenced by DT_CorrHeader().
int ReadHeaderOnly | ( | FILE * | fd | ) |
read the ASCII header of the stored spectrum
fd | number of source file |
Definition at line 704 of file Save.c.
References spectrumheader::altitude, spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdmax, spectrumheader::ccdmin, spectrumheader::ccdnr, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdtemp, spectrumheader::ccdtexp, spectrumheader::ccdvb, spectrumheader::ccdwx, spectrumheader::ccdwy, spectrumheader::comment, ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, spectrumheader::dummy1, spectrumheader::dummy2, spectrumheader::dummy3, spectrumheader::dummy4, spectrumheader::filpos, spectrumheader::imgtype, spectrumheader::latitude, spectrumheader::location, spectrumheader::longitude, spectrumheader::mirpos, bil::SPH, spectrumheader::sza, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, and spectrumheader::wavelen.
Referenced by DT_CorrFileEvora().
int SaveDataOffLine | ( | char * | fname, |
int | mod | ||
) |
Definition at line 493 of file Save.c.
References D_Print_BIL_H_ASCII(), D_Print_BIL_H_BIN(), bil::DPLOT, IDX, IDY, d_view::ImatOrig, O_BINARY, raddeg, WriteIMG(), and WriteIMG_BIN().
Referenced by DB_Save().
int SmoothData | ( | unsigned short * | source, |
float * | destination, | ||
int | horpix, | ||
int | verpix, | ||
int | filw, | ||
int | bp | ||
) |
Calc. the smoothed matrix of an unsigned short one.
.
*source | source data buffer |
*destination | destination data buffer |
horpix | horizontal pixels |
verpix | vertical pixels |
filw | filter windows for smoothing |
bp | blind pixels |
Definition at line 973 of file Save.c.
References IDX, and SmoothingF().
Referenced by BuildLogRatio(), and WriteSelColandSmoothed().
int SmoothFloatData | ( | float * | source, |
float * | destination, | ||
int | horpix, | ||
int | verpix, | ||
int | filw, | ||
int | bp | ||
) |
Calc. the smoothed matrix of a float one.
.
*source | source data buffer |
*destination | destination data buffer |
horpix | horizontal pixels |
verpix | vertical pixels |
filw | filter windows for smoothing |
bp | blind pixels |
Definition at line 890 of file Save.c.
References IDX, and SmoothingF().
Referenced by BuildLogRatio().
void UPS_Status | ( | void | ) |
Definition at line 32 of file Save.c.
Referenced by DB_ToolsKeyB_CB().
void WriteColumn | ( | int | mod, |
FILE * | fd | ||
) |
Definition at line 850 of file Save.c.
References paramini::ccdWx, paramini::ccdXoff, D_PrintHMod(), DAS, bil::DPLOT, IDX, IDY, d_view::ImatGraf, doas::lambda, das::Paramini, Pix2Wl(), bil::SPH, and spectrumheader::wavelen.
Referenced by DB_Column().
void WriteSelColandSmoothed | ( | int | mod, |
FILE * | fd, | ||
int | selcol | ||
) |
write selected Column
Definition at line 1060 of file Save.c.
References AllocFloatMat(), bil::ANALYSIS, spectrumheader::ccdex, spectrumheader::ccdwx, D_PrintHMod(), DeallocFloatMat(), bil::DPLOT, doas::FFTFilter, IDX, IDY, d_view::ImatOrig, analize::ImatSmooth, doas::lambda, SmoothData(), and bil::SPH.
Referenced by SaveSpectrum().