|
ERIS Pipeline Reference Manual 1.9.2
|
Files | |
| file | sc_basic.c |
| file | sc_basic.h |
| file | sc_contsub.c |
| file | sc_contsub.h |
| file | sc_conv.c |
| file | sc_conv.h |
| file | sc_fwhmest.c |
| file | sc_fwhmest.h |
| file | sc_lines.c |
| file | sc_lines.h |
| file | sc_modsky.c |
| file | sc_modsky.h |
| file | sc_mpfit.c |
| file | sc_mpfit.h |
| file | sc_par.c |
| file | sc_par.h |
| Header for routines for handling parameter files. | |
| file | sc_plot.c |
| file | sc_plot.h |
| Header for plotting library. | |
| file | sc_readspec.c |
| file | sc_readspec.h |
| file | sc_skycorr.c |
| file | sc_skycorr.h |
| file | sc_specdiss.c |
| programme to find emission lines in spectra | |
| file | sc_specdiss.h |
| Header for spectral analysis library. | |
| file | sc_weights.c |
| file | sc_weights.h |
Data Structures | |
| struct | _scpar_ |
Macros | |
| #define | SC_MIN(a, b) ((a) > (b) ? (b) : (a)) |
| #define | SC_MAX(a, b) ((a) < (b) ? (b) : (a)) |
| #define | SC_LENLINE 160 |
| #define | SC_MAXLEN 1024 |
| #define | SC_TOL 1e-7 |
| #define | SC_MAXPAR 21 |
| #define | SC_THERMIRLIM 2.31 |
| #define | SC_DEFLAMCOL "LAMBDA" |
| #define | SC_DEFFLUXCOL "FLUX" |
| #define | SC_DEFDFLUXCOL "DFLUX" |
| #define | SC_DEFMASKCOL "MASK" |
| #define | SC_SINCRAD_PRECOMP 6.0 |
| #define | SC_SINCNBIN 10000 |
| #define | SC_SINCDAMP 3.25 |
Typedefs | |
| typedef enum _sc_error_code_ | sc_error_code |
| typedef struct _scpar_ | scpar |
Enumerations | |
| enum | _sc_error_code_ |
Functions | |
| cpl_error_code | sc_basic_readline (FILE *stream, scpar par[], int *npar) |
| double | sc_basic_mjd2fracyear (double mjd) |
| double | sc_basic_fracyear2date (int *year, int *month, int *day, int *hh, int *mm, double *ss, const double *fracyear) |
| cpl_error_code | sc_basic_rebin (cpl_table *outspec, const char *outlam, const char *outflux, const cpl_table *inspec, const char *inlam, const char *influx) |
| cpl_error_code | sc_basic_convolve (cpl_table *spec, const char *colname, const cpl_array *kernel) |
| cpl_error_code | sc_basic_convolvewindow (cpl_array *convflux, const cpl_array *flux, const int range[2], const cpl_array *kernel) |
| cpl_error_code | sc_basic_filtermedian (cpl_table *spec, const char *colname, const int npix) |
| cpl_error_code | sc_basic_linecount (long *n_lines, FILE *fp) |
| cpl_error_code | sc_basic_rhum2ppmv_old (const cpl_array *temp, const cpl_array *pres, const cpl_array *rhum, cpl_array *ppmv) |
| void | sc_basic_rhum2ppmv (double *ppmv, const double *tem, const double *p, const double *hum) |
| cpl_error_code | sc_basic_planck (cpl_array *bb, const cpl_array *wavelength, const double temp) |
| void | sc_basic_dirslash (char *dir) |
| void | sc_basic_abspath (char *out, const char *dir, const char *cwd) |
| cpl_error_code | sc_basic_access (const char *pathname, const int mode) |
| cpl_error_code | sc_basic_greg2jd (long *jd, const int year, const int month, const int day) |
| cpl_error_code | sc_basic_jd2greg (int *year, int *month, int *day, const long jd) |
| cpl_error_code | sc_basic_clipmean (double *mean, double *rms, cpl_array *arr, const cpl_boolean clip) |
| cpl_error_code | sc_basic_col2arr (cpl_array *arr, const cpl_table *tab, const char *colname) |
| cpl_error_code | sc_basic_arr2col (cpl_table *tab, const char *colname, const cpl_array *arr) |
| cpl_error_code | sc_basic_sortarr (cpl_array *arr, cpl_type type) |
| cpl_error_code | sc_basic_copytable_content (cpl_table *outtab, const cpl_table *intab) |
| cpl_error_code | sc_basic_copytable_full (cpl_table *outtab, const cpl_table *intab) |
| void | sc_basic_initstring (char *str, const long n) |
| void | sc_basic_terminatestring (char *str) |
| char * | sc_basic_strtrim (char *str) |
| void | sc_basic_strtrim_inplace (char *str) |
| cpl_boolean | sc_basic_isnumber (char *str) |
| cpl_boolean | sc_basic_isinteger (char *str) |
| cpl_error_code | sc_basic_interpollin (const double *x_out, double *y_out, const long n_out, const double *x_ref, const double *y_ref, const long n_ref, const int extrapolate) |
| int | sc_basic_gaussfunc (double *fgauss, const double *xgauss, const int n_data, const double *par) |
| cpl_error_code | sc_basic_getfilename (char *dir, char *filename, char *suffix, const char *path) |
| cpl_error_code | sc_basic_getmaskval_vector (double maskval[2], const cpl_vector *vector) |
| cpl_error_code | sc_basic_getmaskval_image (double maskval[2], const cpl_image *image) |
| cpl_error_code | sc_basic_calcsinc (cpl_vector *sinc) |
This module provides functions for the correction of sky emission.
| #define SC_DEFDFLUXCOL "DFLUX" |
Default flux error column name
Definition at line 111 of file sc_basic.h.
| #define SC_DEFFLUXCOL "FLUX" |
Default flux column name
Definition at line 109 of file sc_basic.h.
| #define SC_DEFLAMCOL "LAMBDA" |
Default wavelength column name
Definition at line 107 of file sc_basic.h.
| #define SC_DEFMASKCOL "MASK" |
Default mask column name
Definition at line 113 of file sc_basic.h.
| #define SC_LENLINE 160 |
Maximum number of characters per line
Definition at line 92 of file sc_basic.h.
| #define SC_MAX | ( | a, | |
| b | |||
| ) | ((a) < (b) ? (b) : (a)) |
Macro for finding the maximum of two values
Definition at line 87 of file sc_basic.h.
| #define SC_MAXLEN 1024 |
Maximum number of string characters
Definition at line 94 of file sc_basic.h.
| #define SC_MAXPAR 21 |
Maximum number of space- or tab-separated strings per line (see sc_basic_readline)
Definition at line 99 of file sc_basic.h.
| #define SC_MIN | ( | a, | |
| b | |||
| ) | ((a) > (b) ? (b) : (a)) |
Macro for finding the minimum of two values
Definition at line 85 of file sc_basic.h.
| #define SC_SINCDAMP 3.25 |
Damping constant for damped sinc kernel in pixels
Definition at line 122 of file sc_basic.h.
| #define SC_SINCNBIN 10000 |
Number of points per unit for pre-calculated damped sinc kernel
Definition at line 120 of file sc_basic.h.
| #define SC_SINCRAD_PRECOMP 6.0 |
Radius of precomputed damped sinc kernel in pixels.
Definition at line 118 of file sc_basic.h.
| #define SC_THERMIRLIM 2.31 |
Lower limit for wavelength range dominated by emission lines originating in the lower atmosphere in 
Definition at line 102 of file sc_basic.h.
| #define SC_TOL 1e-7 |
Required relative accuracy for data comparisons
Definition at line 96 of file sc_basic.h.
| typedef enum _sc_error_code_ sc_error_code |
Enumeration structure for sky model related error codes
Structure for a parameter value in different data types
| c | string (maximum length SC_LENLINE) |
| i | integer number |
| d | float number of double precision |
| enum _sc_error_code_ |
Enumeration structure for sky model related error codes
Definition at line 128 of file sc_basic.h.
| void sc_basic_abspath | ( | char * | out, |
| const char * | dir, | ||
| const char * | cwd | ||
| ) |
Expand relative path.
INPUT:
| dir | relative directory. |
| cwd | current working directory. |
OUTPUT:
| out | output directory |
ERRORS:
Definition at line 1133 of file sc_basic.c.
References sc_basic_dirslash(), sc_basic_initstring(), and SC_MAXLEN.
Referenced by sc_conv_readprepfits(), sc_lines_readlist(), sc_lines_readsolflux(), and sc_lines_readvarpar().
| cpl_error_code sc_basic_access | ( | const char * | pathname, |
| const int | mode | ||
| ) |
Check for file or directory existence
This function provides a wrapper for the intrinsic function access(). It reports back all access() errors.
INPUT:
| pathname | name of a file or directory |
| mode | mode for accessibility checks F_OK = file existence X_OK = file exec permission W_OK = file write permission |
OUTPUT:
ERRORS:
Definition at line 1199 of file sc_basic.c.
| cpl_error_code sc_basic_arr2col | ( | cpl_table * | tab, |
| const char * | colname, | ||
| const cpl_array * | arr | ||
| ) |
Routine to copy a CPL array to a column of a CPL table.
If the target column does not exist it is created and subsequently filled with array data. Also the sizes of the source array and target CPL table must match, except an empty target table is used. In this case, the size is set to the inout CPL array size.
Data types of target column and source array must coincide
Supported data types: CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE, CPL_TYPE_STRING
INPUT:
| arr | CPL array to be copied to target column |
| tab | CPL table containing selected column |
| colname | Name of CPL table target column |
OUTPUT
| tab | Target CPL table |
| colname | Target column of CPL table to be filled with array data |
Definition at line 1757 of file sc_basic.c.
References SC_MAXLEN.
Referenced by sc_skycorr_subcont().
| cpl_error_code sc_basic_calcsinc | ( | cpl_vector * | sinc | ) |
Calculates asymmetric, exponentially-damped sinc function for rebinning without smoothing. The radius of the kernel, the sampling, and the sinc damping constant are defined by SC_SINCRAD_PRECOMP, SC_SINCNBIN, and SC_SINCDAMP, respectively. All constants are given in pixels. The resulting kernel should be normalised to 1.
INPUT:
| sinc | empty CPL vector |
OUTPUT:
| sinc | CPL vector with damped sinc function |
ERRORS:
Definition at line 2714 of file sc_basic.c.
References SC_SINCDAMP, SC_SINCNBIN, and SC_SINCRAD_PRECOMP.
Referenced by sc_mpfit().
| cpl_error_code sc_basic_clipmean | ( | double * | mean, |
| double * | rms, | ||
| cpl_array * | arr, | ||
| const cpl_boolean | clip | ||
| ) |
Calculate mean and rms using sigma-clipping routine
This function calculates the mean and rms of a cpl_array first by computing the median absolute difference and afterwards applying Huber's method. Values identified as outliers are flagged "invalid" in the input array. If a more stringent value on the mean/rms is desired, /em clip can be set to 1, resulting in the outliers being removed from the calculation of the mean/rms (in contrast to "compressing" them to the outer boundaries of the clipping, i.e. Huber's method). See: AMC Technical Briefs - ISSN 1757-5958, No.6, Royal Society of Chemistry, 2001 http://www.rsc.org/images/brief6_tcm18-25948.pdf
INPUT:
| arr | cpl_array |
| clip | flag for clipping mode |
OUTPUT:
| mean | mean |
| rms | root-mean-square |
ERRORS:
Definition at line 1539 of file sc_basic.c.
Referenced by sc_fwhmest(), and sc_mpfit_modinitpar().
| cpl_error_code sc_basic_col2arr | ( | cpl_array * | arr, |
| const cpl_table * | tab, | ||
| const char * | colname | ||
| ) |
Routine to copy a CPL table column to a CPL array.
The target array must have size = 0, otherwise existing array data will be overwritten. Data types of source array and target table column must match.
Supported data types: CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE, CPL_TYPE_STRING
INPUT:
| arr | (empty) CPL array to be filled |
| tab | CPL table containing selected column 'colname' |
| colname | Column name of table to be copied to array |
OUTPUT
| arr | Filled CPL array |
Definition at line 1652 of file sc_basic.c.
References SC_MAXLEN.
Referenced by sc_skycorr_subcont().
| cpl_error_code sc_basic_convolve | ( | cpl_table * | spec, |
| const char * | colname, | ||
| const cpl_array * | kernel | ||
| ) |
Convolution of column colname in CPL table spec with given kernel.
INPUT:
| spec | input spectrum as CPL table |
| colname | name of column with input data |
| kernel | kernel as CPL array (required: sum of all values = 1) |
OUTPUT:
| spec | convolved input spectrum |
ERRORS:
Definition at line 441 of file sc_basic.c.
| cpl_error_code sc_basic_convolvewindow | ( | cpl_array * | convflux, |
| const cpl_array * | flux, | ||
| const int | range[2], | ||
| const cpl_array * | kernel | ||
| ) |
Convolution of a flux array with given kernel for a fixed range of pixels. The output array has to exist and have the same number of pixels as the input array. Technically, the convolution is carried out by adding the convolved fluxes for each pixel in the selected window.
INPUT:
| convflux | CPL array of convolved flux values |
| flux | CPL array of unconvolved input flux |
| range | range of pixels to be considered (minimum and maximum) |
| kernel | kernel as CPL array (required: sum of all values = 1) |
OUTPUT:
| convflux | output array with added convolved flux from given range |
ERRORS:
Definition at line 564 of file sc_basic.c.
References SC_MAX, SC_MAXLEN, SC_MIN, and SC_TOL.
Referenced by sc_weights_convolve().
| cpl_error_code sc_basic_copytable_content | ( | cpl_table * | outtab, |
| const cpl_table * | intab | ||
| ) |
Copies the content of a table. The output table must exist and have the same structure as the input table. Only columns with CPL_TYPE_STRING, CPL_TYPE_INT, CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE can be handled.
INPUT:
| intab | input table |
OUTPUT:
| outtab | output table with copied content of input table |
ERRORS:
Definition at line 1923 of file sc_basic.c.
References SC_MAXLEN.
Referenced by sc_mpfit().
| cpl_error_code sc_basic_copytable_full | ( | cpl_table * | outtab, |
| const cpl_table * | intab | ||
| ) |
Copies the structure and content of a table. The output table must exist. Missing columns are created. Only columns with CPL_TYPE_STRING, CPL_TYPE_INT, CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE can be handled.
INPUT:
| outtab | empty output table |
| intab | input table |
OUTPUT:
| outtab | output table with copied content of input table |
ERRORS:
Definition at line 1991 of file sc_basic.c.
| void sc_basic_dirslash | ( | char * | dir | ) |
Append '/' to path.
INPUT:
| dir | directory. |
OUTPUT:
| dir | directory. |
ERRORS:
Definition at line 1109 of file sc_basic.c.
Referenced by sc_basic_abspath().
| cpl_error_code sc_basic_filtermedian | ( | cpl_table * | spec, |
| const char * | colname, | ||
| const int | npix | ||
| ) |
Median filtering of column colname in CPL table spec. The median for each pixel is calculated by considering npix-1 neighbouring pixels.
INPUT:
| spec | input spectrum as CPL table |
| colname | name of column with input data |
| npix | number of pixels for median |
OUTPUT:
| spec | filtered input spectrum |
ERRORS:
Definition at line 745 of file sc_basic.c.
Referenced by sc_contsub().
| double sc_basic_fracyear2date | ( | int * | year, |
| int * | month, | ||
| int * | day, | ||
| int * | hh, | ||
| int * | mm, | ||
| double * | ss, | ||
| const double * | fracyear | ||
| ) |
Brake up a fractional year into year, month, day.
This routine brakes up a fractional year into year, month, day, e.g. 2002.380821917808219 corresponds to 20/05/2002, optionally including the time of day. The return value is the rest after braking up the date, i.e. the time of day.
INPUT:
| fracyear | fractional year (e.g. 2002.345) |
OUTPUT:
| year | year |
| month | month |
| day | day |
| hh | hour |
| mm | minute |
| ss | second |
RETURN: fractional day (optionally broken up into hh/mm/ss)
ERRORS:
Definition at line 206 of file sc_basic.c.
Referenced by sc_lines_getmodelbins().
| int sc_basic_gaussfunc | ( | double * | fgauss, |
| const double * | xgauss, | ||
| const int | n_data, | ||
| const double * | par | ||
| ) |
Computes Gaussian.
INPUT:
| xgauss | vector of x positions |
| n_data | number of data points |
| par | parameters for Gaussian |
OUTPUT:
| fgauss | resulting Gaussian |
ERRORS:
Definition at line 2473 of file sc_basic.c.
Referenced by sc_fwhmest_gaussfunc().
| cpl_error_code sc_basic_getfilename | ( | char * | dir, |
| char * | filename, | ||
| char * | suffix, | ||
| const char * | path | ||
| ) |
Splits full path into directory, file name, and file name suffix. Returns NULL if a component cannot be found in the input string.
INPUT:
| path | path including file name |
OUTPUT:
| dir | directory path (without slash at the end) |
| filename | file name |
| suffix | file identifier like "asc" or "fits" |
ERRORS:
Definition at line 2507 of file sc_basic.c.
References SC_MAXLEN.
| cpl_error_code sc_basic_getmaskval_image | ( | double | maskval[2], |
| const cpl_image * | image | ||
| ) |
Gets meaning of mask values provided by a CPL image. It is assumed that a good value equals 1 if only 1 and possiby 0 are present. If only 0 exists, the definition is reversed. This is also true for a minimum mask value of 0 and any larger number. The latter will be classified as bad mask values.
INPUT:
| image | input CPL image |
OUTPUT:
| maskval | mask values (1st: bad value, 2nd: good value) |
ERRORS:
Definition at line 2657 of file sc_basic.c.
References SC_MAXLEN.
Referenced by sc_conv_iarr2varr_sci(), and sc_conv_iarr2varr_sky().
| cpl_error_code sc_basic_getmaskval_vector | ( | double | maskval[2], |
| const cpl_vector * | vector | ||
| ) |
Gets meaning of mask values provided by a CPL vector. It is assumed that a good value equals 1 if only 1 and possiby 0 are present. If only 0 exists, the definition is reversed. This is also true for a minimum mask value of 0 and any larger number. The latter will be classified as bad mask values.
INPUT:
| vector | input CPL vector |
OUTPUT:
| maskval | mask values (1st: bad value, 2nd: good value) |
ERRORS:
Definition at line 2601 of file sc_basic.c.
References SC_MAXLEN.
| cpl_error_code sc_basic_greg2jd | ( | long * | jd, |
| const int | year, | ||
| const int | month, | ||
| const int | day | ||
| ) |
Convert Gregorian to Julian date
This function converts a sequence of year/month/day into a Julian date.
INPUT:
| year | Gregorian year |
| month | Gregorian month |
| day | Gregorian day |
OUTPUT:
| jd | Julian date |
ERRORS:
Definition at line 1297 of file sc_basic.c.
| void sc_basic_initstring | ( | char * | str, |
| const long | n | ||
| ) |
Initialise a string variable.
This function initialises a given string str of length n with "\0".
INPUT:
| n | length of string |
OUTPUT:
| str | string |
Definition at line 2060 of file sc_basic.c.
Referenced by sc_basic_abspath(), sc_overplot_spec(), sc_plot_double_spec(), sc_plot_hist(), sc_plot_single_spec(), and sc_plot_single_spec_with_lines().
| cpl_error_code sc_basic_interpollin | ( | const double * | x_out, |
| double * | y_out, | ||
| const long | n_out, | ||
| const double * | x_ref, | ||
| const double * | y_ref, | ||
| const long | n_ref, | ||
| const int | extrapolate | ||
| ) |
Linear interpolation.
This function calculates the interpolated y-values y_out at the positions x_out with respect to the reference x/y pairs (x_ref / y_ref).
INPUT:
| x_out | Desired output x-spacing. |
| n_out | Length of x_out / y_out. |
| x_ref | Reference x-spacing. |
| y_ref | Reference y-values at x_ref. |
| n_ref | Length of x_ref / y_ref. |
| extrapolate | Extrapolation flag |
OUTPUT:
| y_out | Requested y-values at x_out. |
Definition at line 2369 of file sc_basic.c.
Referenced by sc_contsub().
| cpl_boolean sc_basic_isinteger | ( | char * | str | ) |
Check if string contains an integer only.
This function checks whether str contains a valid integer. A leading "+" or "-" is treated as a sign.
INPUT:
| str | String. |
OUTPUT:
Definition at line 2322 of file sc_basic.c.
| cpl_boolean sc_basic_isnumber | ( | char * | str | ) |
Check if string contains number.
This function checks whether str contains a valid number. A leading "+" or "-" is treated as a sign. A single "." is identified as a decimal point. Finally, an "e" is accepted if an exponent follows this letter.
INPUT:
| str | string |
OUTPUT:
Definition at line 2237 of file sc_basic.c.
Referenced by sc_basic_readline().
| cpl_error_code sc_basic_jd2greg | ( | int * | year, |
| int * | month, | ||
| int * | day, | ||
| const long | jd | ||
| ) |
Convert Julian to Gregorian date
This function converts a Julian date into a sequence of year/month/day.
INPUT:
| jd | Julian date |
OUTPUT:
| year | Gregorian year |
| month | Gregorian month |
| day | Gregorian day |
ERRORS:
Definition at line 1334 of file sc_basic.c.
| cpl_error_code sc_basic_linecount | ( | long * | n_lines, |
| FILE * | fp | ||
| ) |
Count the lines in a file.
Count the number of lines in a file. File pointer is reset to beginning of file.
INPUT:
| fp | file pointer |
OUTPUT:
| n_lines | number of lines in file |
ERRORS:
Definition at line 831 of file sc_basic.c.
| double sc_basic_mjd2fracyear | ( | double | mjd | ) |
Converts MJD into fractional year (return value, double precision).
Definition at line 179 of file sc_basic.c.
| cpl_error_code sc_basic_planck | ( | cpl_array * | bb, |
| const cpl_array * | wavelength, | ||
| const double | temp | ||
| ) |
Calculate blackbody radiation.
INPUT:
| wavelength | wavelength array in micron (1e-6 metres). |
| temp | temperature in [K] |
OUTPUT:
| bb | blackbody flux (i.e. PI*Intensity) in [ergs/cm2/s/a] |
ERRORS:
Definition at line 1058 of file sc_basic.c.
| cpl_error_code sc_basic_readline | ( | FILE * | stream, |
| scpar | par[], | ||
| int * | npar | ||
| ) |
Reads a line from a file and returns the space- or tab-separated individual strings in an scpar structure. This structure also contains each string converted into integer and double precision floating point numbers. Comment lines marked by # and empty lines are not considered. In this case, the next line with data is read.
INPUT:
| stream | name of stream (to be defined by fopen command) |
| par | array of scpar structures (to transfer parameter values) |
OUTPUT:
| par | scpar array that contains the read value(s) as character string ("c"), integer ("i"), or double precision floating point number ("d"). The different data types can be accessed by adding the corresponding suffixes c, i, or d to the name of the scpar structure. |
| npar | found number of parameter values (at one line) |
ERRORS:
In the case of problems, the default values "", 0, and 0.0 are used for the corresponding data types.
Definition at line 52 of file sc_basic.c.
References sc_basic_isnumber(), SC_MAXLEN, and SC_MAXPAR.
Referenced by sc_conv_ascii_read(), and sc_lines_readvarpar().
| cpl_error_code sc_basic_rebin | ( | cpl_table * | outspec, |
| const char * | outlam, | ||
| const char * | outflux, | ||
| const cpl_table * | inspec, | ||
| const char * | inlam, | ||
| const char * | influx | ||
| ) |
Rebins CPL table inspec with columns inlam and influx to wavelength given by outlam in CPL table outspec. The resulting rebinned flux is written to outflux in outspec. If outflux does not exist, it is created. The routine conserves integral of flux.
INPUT:
| outspec | output spectrum with desired wavelength grid |
| outlam | output wavelength column name |
| outflux | output flux column name |
| inspec | input spectrum |
| inlam | input wavelength column name |
| influx | input flux column name |
OUTPUT:
| outspec | rebinned input spectrum |
ERRORS:
Definition at line 296 of file sc_basic.c.
Referenced by sc_contsub_identcont(), and sc_modsky_rebin().
| void sc_basic_rhum2ppmv | ( | double * | ppmv, |
| const double * | tem, | ||
| const double * | p, | ||
| const double * | hum | ||
| ) |
Convert relative humidity to ppmv.
A single relative humidity value is converted to a volume mixing ratio using the prescription by Murphy and Koop, Review of the vapour pressure of ice and supercooled water for atmospheric applications, Q. J. R. Meteorol. Soc (2005), 131, pp. 1539-1565, for a given temperature and pressure.
INPUT
| tem | Temperature in [Kelvin]. |
| p | Pressure in [mbar]. |
| hum | Relative humidity in [%]. |
OUTPUT
| ppmv | Volume mixing ratio in ppmv. |
Definition at line 870 of file sc_basic.c.
| cpl_error_code sc_basic_rhum2ppmv_old | ( | const cpl_array * | temp, |
| const cpl_array * | pres, | ||
| const cpl_array * | rhum, | ||
| cpl_array * | ppmv | ||
| ) |
Convert relative humidity to ppmv.
INPUT:
| temp | array of temperatures in [K] |
| pres | array of pressure values in [mB] or [hPa] |
| rhum | array of relative humidity values in [%] |
OUTPUT:
| ppmv | array of ppmv values (absolute humidity) |
Reference: Flatau,P.J., R.L.Walko, and W.R.Cotton, 1992: "Polynomial fits to saturation vapor pressure", J.Appl.Met., v31, pp1507-1513
Valid Temperature range is 183K - 273K (-90C - 0C).
ERRORS:
Definition at line 935 of file sc_basic.c.
References SC_MIN.
| cpl_error_code sc_basic_sortarr | ( | cpl_array * | arr, |
| cpl_type | type | ||
| ) |
Routine to sort a CPL array from lowest to largest value.
Array data gets sorted using qsrt algorithm.
Supported data types: CPL_TYPE_DOUBLE
INPUT:
| arr | CPL array to sort |
| type | CPL data type |
OUTPUT:
| arr | sorted CPL array |
ERRORS:
Definition at line 1871 of file sc_basic.c.
| char * sc_basic_strtrim | ( | char * | str | ) |
Remove leading and trailing blanks from string.
This function removes all leading and trailing " " characters from str using isspace().
INPUT:
| str | string |
OUTPUT:
Definition at line 2115 of file sc_basic.c.
| void sc_basic_strtrim_inplace | ( | char * | str | ) |
Remove leading and trailing blanks from string.
This function removes all leading and trailing " " characters from str using isspace(). In contrast to sc_basic_strtrim(), the action is performed in place, i.e. the input gets overwritten.
INPUT & OUTPUT:
| str | string |
OUTPUT:
Definition at line 2175 of file sc_basic.c.
| void sc_basic_terminatestring | ( | char * | str | ) |
Put "\0" at end of string.
This function places a "\0" at end of the input string.
INPUT & OUTPUT:
| str | string |
OUTPUT:
Definition at line 2086 of file sc_basic.c.