DAS
3.1.6 - 18/09/2017
|
Functions for spectra correction + Others. More...
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <io.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "mgui.h"
#include "DAS_Spatram.h"
#include "dcl.h"
#include "dil.h"
#include "bil.h"
#include "DOAS.h"
#include "nrutil.h"
#include "Marq.h"
Go to the source code of this file.
Macros | |
#define | FREERETURN {free_vector(d,1,n);free_vector(c,1,n);return;} |
#define | PI 3.1415926 |
#define | TINY 1.0e-25 |
Functions | |
double | CalcFluxIndex (unsigned short mis[], int dx, int dy, float te) |
calculates the Flux Index of a measurement More... | |
void | D_CloseVR (MOBJECT p, void *od, void *ad) |
Callback closing the status bar. More... | |
void | D_Print_BIL_H_ASCII (int mod, FILE *fff) |
void | D_PrintBILSPH (FILE *fff) |
Print Header. More... | |
void | D_PrintBILSPH_BIN (int fd) |
Print on file the binary header of the measured spectrum. More... | |
void | D_PrintSpectrum (FILE *fff) |
Print Spectrum. More... | |
void | D_VRange (char *str, int val, int r, int g, int b) |
Create and display the status bar. More... | |
void | D_VRangeSim (int id, char *str, int val, int r, int g, int b, int x, int y) |
init progress bar during simultaneous positioning More... | |
int | DB_CalcFluxI (char *nomefile) |
void __stdcall | DD_VRange (const char *str, int val, int Port) |
int | DT_ColFormat (void) |
Callback for Column format. More... | |
int | DT_CorrFileEvora (void) |
Used to correct some data files. More... | |
int | DT_CorrHeader () |
Used to correct the header in some data files. More... | |
int | DT_FluxIndex (void) |
Callback for Flux Index Calculation. More... | |
int | DT_LinkSpectra (void) |
For the linked spectra (..on going!!!) More... | |
int | Model_read (char *buff) |
void | polint (float xa[], float ya[], int n, float x, float *y, float *dy) |
int | polintlambda (void) |
void | ShiftImg (int hp, int vp) |
Used to correct some data files. More... | |
Variables | |
bil | BIL |
int | D_VOpen = 0 |
int | D_VRip = -1 |
int | DD_VOpen [16] |
int | DD_VRip [16] |
palette | DPAL |
Functions for spectra correction + Others.
Definition in file Utils.c.
#define FREERETURN {free_vector(d,1,n);free_vector(c,1,n);return;} |
double CalcFluxIndex | ( | unsigned short | mis[], |
int | dx, | ||
int | dy, | ||
float | te | ||
) |
calculates the Flux Index of a measurement
mis[] | data array |
dx | horizontal pixels |
dy | vertical pixels |
te | exposure time |
*nomefile | source file name |
Definition at line 306 of file Utils.c.
Referenced by DB_CalcFluxI().
void D_CloseVR | ( | MOBJECT | p, |
void * | od, | ||
void * | ad | ||
) |
Callback closing the status bar.
Definition at line 140 of file Utils.c.
References MShellDestroy(), and MShellUnrealize().
Referenced by D_VRange(), D_VRangeSim(), and DD_VRange().
void D_Print_BIL_H_ASCII | ( | int | mod, |
FILE * | fff | ||
) |
Definition at line 621 of file Utils.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 SaveDataOffLine(), and SaveIo().
void D_PrintBILSPH | ( | FILE * | fff | ) |
Print Header.
*fff | ASCII file number |
Definition at line 581 of file Utils.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(), DT_CorrHeader(), and WriteDataFile().
void D_PrintBILSPH_BIN | ( | int | fd | ) |
Print on file the binary header of the measured spectrum.
fd | number of destination file |
Definition at line 540 of file Utils.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 WriteDataFile().
void D_PrintSpectrum | ( | FILE * | fff | ) |
Print Spectrum.
*fff | ASCII file number |
Definition at line 517 of file Utils.c.
References bil::DPLOT, IDX, IDY, and d_view::ImatGraf.
Referenced by DT_CorrFileEvora(), and DT_CorrHeader().
void D_VRange | ( | char * | str, |
int | val, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Create and display the status bar.
*str | string as title of the status bar |
val | value of the progressive index |
r | red color id (0-255) |
g | green color id (0-255) |
b | blu color id (0-255) |
Definition at line 206 of file Utils.c.
References D_CloseVR(), D_VOpen, D_VRip, palette::DB_BG, HELV_SMALL, MCreateShell(), MCreateStatusBar(), MLoopWhileEvents(), MObjectResize(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetText(), MShellDestroy(), MShellRealize(), MShellSetWMCloseCallback(), MShellUnrealize(), MStatusBarSetPos(), MStatusBarSetSliderRGB(), SF_NO_MAXIMIZE, SF_NO_MINIMIZE, and SF_SAVEUNDER.
Referenced by AMS_DoPos(), D_Homing(), D_Positioning(), DB_CalcFluxI(), DB_Column(), DB_MirrorX(), DB_ScanMaxMin(), DemoInitMotor(), DT_CorrFileEvora(), DT_CorrHeader(), EleDatOrBinFormat(), HomeAzimFast(), HomeFiltersFast(), HomeNDFiltersFast(), and HomeTrack().
void D_VRangeSim | ( | int | id, |
char * | str, | ||
int | val, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | x, | ||
int | y | ||
) |
init progress bar during simultaneous positioning
Definition at line 258 of file Utils.c.
References D_CloseVR(), palette::DB_BG, DD_VOpen, DD_VRip, HELV_SMALL, MCreateShell(), MCreateStatusBar(), MLoopWhileEvents(), MObjectResize(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetText(), MShellDestroy(), MShellRealizeXY(), MShellSetWMCloseCallback(), MShellUnrealize(), MStatusBarSetPos(), MStatusBarSetSliderRGB(), SF_NO_MAXIMIZE, SF_NO_MINIMIZE, and SF_SAVEUNDER.
Referenced by SD_PosAADev(), SD_Position(), and SD_PosOMUDev().
int DB_CalcFluxI | ( | char * | nomefile | ) |
Definition at line 328 of file Utils.c.
References AllocUSMat(), CalcFluxIndex(), spectrumheader::ccdtexp, D_VRange(), ddate::da_day, ddate::da_mon, ddate::da_year, spectrumheader::DATE, bil::DFILEM, bil::DPLOT, IDX, IDY, d_view::ImatGraf, spectrumheader::mirpos, MLoopWhileEvents(), O_BINARY, ReadHeader_BIN(), ReadIMG_BIN(), SAVECNT, bil::SPH, dtime::ti_hour, dtime::ti_min, dtime::ti_sec, spectrumheader::TIME, spectrumheader::wavelen, and d_fileman::WORKDIRECTORY.
Referenced by DT_FluxIndex(), and FluxIndexCB().
void __stdcall DD_VRange | ( | const char * | str, |
int | val, | ||
int | Port | ||
) |
Definition at line 153 of file Utils.c.
References D_CloseVR(), D_VOpen, D_VRip, palette::DB_BG, HELV_SMALL, MCreateShell(), MCreateStatusBar(), MLoopWhileEvents(), MObjectResize(), MObjectSetBackgroundRGB(), MObjectSetCompositeHeight(), MObjectSetText(), MShellDestroy(), MShellRealize(), MShellSetWMCloseCallback(), MShellUnrealize(), MStatusBarSetPos(), MStatusBarSetSliderRGB(), SF_NO_MAXIMIZE, SF_NO_MINIMIZE, and SF_SAVEUNDER.
Referenced by DB_InitCamera().
int DT_ColFormat | ( | void | ) |
Callback for Column format.
Definition at line 431 of file Utils.c.
References _MAX_PATH, FB_PREFS::allow_dir_create, FB_PREFS::allow_dir_delete, FB_PREFS::allow_dir_rename, FB_PREFS::bg_image_file, FB_PREFS::button_font, FB_PREFS::change_cwd, DAS, d_fileman::DATADIRECTORY, DB_Column(), d_fileman::DBFILENAME, bil::DFILEM, das::DOption, False, FB_PREFS::font, HELV_SMALL, d_fileman::HOMEDIRECTORY, MFileBrowseExt(), optionini::savingmode, FB_PREFS::transparent_tree, and True.
Referenced by ColumnFormatCB().
int DT_CorrFileEvora | ( | void | ) |
Used to correct some data files.
Definition at line 786 of file Utils.c.
References AllocUSMat(), spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdwx, spectrumheader::ccdwy, D_PrintBILSPH(), D_PrintSpectrum(), D_VRange(), d_fileman::DBFILENAME, DeallocUSMat(), bil::DFILEM, bil::DPLOT, FELE, FOPEN, IDX, IDY, d_view::ImatGraf, d_view::ImatOrig, MDCreateFM_Shell(), MLoopWhileEvents(), ReadHeaderOnly(), ReadIMG(), SAVECNT, ShiftImg(), bil::SPH, and d_fileman::WORKDIRECTORY.
int DT_CorrHeader | ( | ) |
Used to correct the header in some data files.
Definition at line 662 of file Utils.c.
References AllocUSMat(), spectrumheader::ccdex, spectrumheader::ccdey, spectrumheader::ccdsx, spectrumheader::ccdsy, spectrumheader::ccdwx, spectrumheader::ccdwy, D_PrintBILSPH(), D_PrintSpectrum(), D_VRange(), d_fileman::DBFILENAME, DeallocUSMat(), bil::DFILEM, bil::DPLOT, FELE, FOPEN, IDX, IDY, d_view::ImatGraf, d_view::ImatOrig, MDCreateFM_Shell(), MLoopWhileEvents(), ReadHeaderOldF(), ReadIMG(), SAVECNT, bil::SPH, and d_fileman::WORKDIRECTORY.
int DT_FluxIndex | ( | void | ) |
Callback for Flux Index Calculation.
Definition at line 499 of file Utils.c.
References DB_CalcFluxI(), d_fileman::DBFILENAME, bil::DFILEM, FELE, FOPEN, and MDCreateFM_Shell().
Referenced by DB_ToolsKeyB_CB().
int DT_LinkSpectra | ( | void | ) |
For the linked spectra (..on going!!!)
Definition at line 915 of file Utils.c.
References d_fileman::DBFILENAME, bil::DFILEM, FMOD, FOPEN, MDCreateFM_Shell(), and Model_read().
Referenced by DB_ToolsKeyB_CB().
int Model_read | ( | char * | buff | ) |
Definition at line 893 of file Utils.c.
References d_fileman::DBFILENAME, and bil::DFILEM.
Referenced by DT_LinkSpectra().
void polint | ( | float | xa[], |
float | ya[], | ||
int | n, | ||
float | x, | ||
float * | y, | ||
float * | dy | ||
) |
Definition at line 42 of file Utils.c.
References free_vector(), nrerror(), and vector().
Referenced by polintlambda().
int polintlambda | ( | void | ) |
void ShiftImg | ( | int | hp, |
int | vp | ||
) |
Used to correct some data files.
hp | horizontal pixels |
vp | vertical pixels |
Definition at line 765 of file Utils.c.
References bil::DPLOT, IDX, and d_view::ImatGraf.
Referenced by DT_CorrFileEvora().
int D_VOpen = 0 |
Definition at line 148 of file Utils.c.
Referenced by D_VRange(), and DD_VRange().
int D_VRip = -1 |
Definition at line 148 of file Utils.c.
Referenced by D_VRange(), and DD_VRange().
int DD_VOpen[16] |
Definition at line 151 of file Utils.c.
Referenced by D_VRangeSim(), SD_PosAADev(), SD_Position(), and SD_PosOMUDev().
int DD_VRip[16] |
Definition at line 150 of file Utils.c.
Referenced by D_VRangeSim().