Copyright © 2012, Centro de Astrofísica da Universidade do Porto
Contributed by
G. Boué, M. Montalto, I. Boisse, M. Oshagh, N. C. Santos
EXOEarths, Centro de Astrofísica, Universidade do Porto
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
This library is designed to generate analytical Rossiter-McLaughlin (RM) effects as described in the paper : G. Boué, M. Montalto, I. Boisse, M. Ohasgh, N. C. Santos : 2012, New analytical expressions of the Rossiter-McLaughlin effect adapted to different observation techniques, http://www.astro.up.pt/resources/arome/files/boue_et_al_2012.pdf. It models the Doppler-shift of a star during a transit measured by the following techniques :
This library provides a C interface and, optionally, a Fortran 77 or 2003 interface to be called by the application.
Two groups of functions enable the calculation of RM effects :
These functions compute and return the RM effects at a single position of the planet with respect to the star.
These functions return the RM effects computed at different positions of the planet at the same time.
This library is based on a work supported by the European Research Council/European Community under the FP7 through Starting Grant agreement number 239953, as well as from Fundação para a Ciência e a Tecnologia (FCT) through program Ciência 2007 funded by FCT/MCTES (Portugal) and POPH/FSE (EC), and in the form of grants reference PTDC/CTE-AST/098528/2008, SFRH/BPD/71230/2010, and SFRH/BPD/81084/2011.
You need a C compiler, such as gcc. A fortran compiler, compliant with the ANSI Fortran 77 specifications, is required to compile the fortran-77/90/95 interface of the library. A fortran compiler, compliant with the Fortran 2003 specifications, is required to compile the fortran-2003 interface of the library. And you need a standard Unix ‘make’ program, plus some other standard Unix utility programs.
Here are the steps needed to install the library on Unix systems:
Running configure might take a while. While running, it prints some messages telling which features it is checking for.
configure recognizes the following options to control how it operates.
The default compilers could be changed using the variable CC for C compiler and FC for the Fortran compiler. The default compilerflags could be changed using the variable CFLAGS for C compiler and FCFLAGS for the Fortran compiler.
This compiles the ARoME Library in the working directory.
This will make sure that the ARoME Library was built correctly.
If you get error messages, please report them to arome@astro.up.pt (See Reporting bugs, for information on what to include in useful bug reports).
This will copy the file arome.h, module_arome.mod and f90arome.h to the directory /usr/local/include, the file libarome.a, libarome.so to the directory /usr/local/lib, and the file arome.info to the directory /usr/local/share/info (or if you passed the ‘--prefix’ option to configure, using the prefix directory given as argument to ‘--prefix’ instead of /usr/local). Note: you need write permissions on these directories.
There are some other useful make targets:
Create an info version of the manual, in arome.info.
Create a PDF version of the manual, in arome.pdf.
Create a DVI version of the manual, in arome.dvi.
Create a Postscript version of the manual, in arome.ps.
Create an HTML version of the manual, in arome.html.
Delete all object files and archive files, but not the configuration files.
Delete all files not included in the distribution.
Delete all files copied by ‘make install’.
If you think you have found a bug in the ARoME Library, first have a look on the ARoME Library web page http://www.astro.up.pt/resources/arome, in which case you may find there a workaround for it. Otherwise, please investigate and report it. We have made this library available to you, and it seems very important for us, to ask you to report the bugs that you find.
There are a few things you should think about when you put your bug report together. You have to send us a test case that makes it possible for us to reproduce the bug. Include instructions on the way to run the test case.
You also have to explain what is wrong; if you get a crash, or if the results printed are incorrect and in that case, in what way.
Please include compiler version information in your bug report. This can be extracted using ‘cc -V’ on some machines, or, if you're using gcc, ‘gcc -v’. Also, include the output from ‘uname -a’ and the ARoME version.
Send your bug report to: arome@astro.up.pt. If you think something in this manual is unclear, or downright incorrect, or if the language needs to be improved, please send a note to the same address.
All declarations needed to use ARoME Library are collected in the include file arome.h. It is designed to work with both C and C++ compilers.
You should include that file in any program using the ARoME library:
#include <arome.h>
All programs using ARoME must link against the libarome library. On Unix-like system this can be done with -larome, for example
gcc myprogram.c -o myprogram -larome
If ARoME Library has been installed to a non-standard location then it may be necessary to use -I and -L compiler options to point to the right directories, and some sort of run-time path for a shared library.
AROME_VERSION_MAJOR
This integer constant defines the major revision of this library. It can be used to distinguish different releases of this library.
AROME_VERSION_MINOR
This integer constant defines the minor revision of this library. It can be used to distinguish different releases of this library.
AROME_VERSION_PATCH
This integer constant defines the patch level revision of this library. It can be used to distinguish different releases of this library.
#if (AROME_VERSION_MAJOR>=2) || (AROME_VERSION_MAJOR>=1 && AROME_VERSION_MINOR>=1) ... #endif |
This type contains all information to compute RM effects. There should be one variable of this type per star.
This type contains elliptical elements used to compute cartesian coordinates. The orbit structure is not mandatory to compute RM signals, but it may help.
All declarations needed to use ARoME Library are collected in the module files module_arome.mod. The library is designed to work with Fortran compilers compliant with the Fortran 2003 standard. All declarations use the standard ‘ISO_C_BINDING’ module.
You should include that module in any program using the ARoME library:
use module_arome
When a fortran string is given as a parameter to a function of this library, you should append this string with ‘//C_NULL_CHAR’ because the C library works only with C string.
All programs using ARoME must link against the libarome library. On Unix-like system this can be done with -larome, for example
gfortran -I/usr/local/include myprogram.f -o myprogram -larome
If ARoME Library has been installed to a non-standard location then it may be necessary to use -I and -L compiler options to point to the right directories, and some sort of run-time path for a shared library.
It is designed to work with Fortran compilers compliant with the Fortran 77, 90 or 95 standard with wrappers. All declarations are implicit, so you should take care about the types of the arguments. All functions are prefixed by ‘f90’. This interface is only provided as compatibility layer and have a small overhead due to the wrappers. So if you have a fortran compiler compliant with 2003 standard, you should use the fortran 2003 interface of this library.
All declarations needed to use ARoME Library are collected in the header file f90arome.h. It is designed to work with Fortran compilers compliant with the Fortran 77, 90 or 95 standard.
You should include that file in every subroutine or function in any program using the ARoME library:
include 'f90arome.h'
All programs using ARoME must link against the libarome library. On Unix-like system this can be done with -larome, for example
gfortran -I/usr/local/include myprogram.f -o myprogram -larome
If ARoME Library has been installed to a non-standard location then it may be necessary to use -I and -L compiler options to point to the right directories, and some sort of run-time path for a shared library.
This section explains how to compute Rossiter McLaughlin (RM) effects at individual positions of the planet with respect to the star. To compute at once an array of RM effects for different positions of the planet, see Multiple position functions.
When an error occurs, these functions execute error handlers according to the behavior defined by one of the following functions (see Error functions)
arome_set_exit_on_error
,
arome_set_continue_on_error
,
arome_set_func_on_error
.
The following examples, that can be founded in the directory ‘examples’ of the library sources, show the typical usage of this group of functions. The example in C language is ‘csingle.c’. The example in Fortran 2003 language is ‘f2003single.f’. The example in Fortran 77/90/95 language is ‘f77single.f’.
#include <stdio.h> #include "arome.h" /*-----------------------*/ /* main programme */ /*-----------------------*/ int main(int argc, char **argv) { double v_CCF, v_iodine, v_mean; double own_f, own_betapR; t_arome *parome; int status = 0; /* planet coordinates in stellar radius */ double x0 = 0.2; double y0 = 0.0; double z0 = 5.0; /* z0 should be positive to have transit */ /* limb-darkening */ double u1 = 0.69; double u2 = 0.00; /* line profile */ double beta0 = 2.0; /* width of the non-rotating star */ double Vsini = 15.0; /* Vsini */ double sigma0 = 8.0; /* width of the best Gaussian fit */ double zeta = 2.0; /* macro-turbulence parameter */ double Rp = 0.1; /* radius of the planet */ int Kmax = 4; /* order of expansion for the Iodine */ /* cell technique */ /* allocation of the ARoME structure */ parome = arome_alloc_quad(u1, u2); /* set the lineprofile */ status += arome_set_lineprofile(beta0, Vsini, sigma0, zeta, Kmax, parome); /* set the planet parameters */ status += arome_set_planet(Rp, parome); /* initialize the techniques used in the following */ status += arome_init_CCF(parome); status += arome_init_iodine(parome); |
if (!status) { /* for all planet positions, do the following ---------------------*/ /* compute the flux, vp and betap at a given position (x0, y0, z0) */ status += arome_calc_fvpbetap(x0,y0,z0, parome); /* you can have access to the computed f, vp, betapR and betapT */ printf("f = %.15E\n", arome_get_flux(parome) ); printf("vp = %.15E\n", arome_get_vp(parome) ); printf("betapR = %.15E\n", arome_get_betapR(parome)); printf("betapT = %.15E\n", arome_get_betapT(parome)); /* you can change any of the flux, vp, betapR, or betapT, e.g., */ own_f = 0.01; own_betapR = 15.0; /* km/s */ arome_set_flux(own_f, parome); arome_set_betapR(own_betapR, parome); /* then you can compute the RM signal for the technique(s) already */ /* initialized using error-handling functions with suffix "_e" */ status += arome_get_RM_CCF_e(parome, &v_CCF); /* or simply (without the suffix "_e") */ v_iodine = arome_get_RM_iodine(parome); v_mean = arome_get_RM_mean(parome); printf("v_CCF = %.15E\n", v_CCF ); printf("v_iodine = %.15E\n", v_iodine); printf("v_mean = %.15E\n", v_mean ); /* end of the loop over the positions of the planet ---------------*/ } /* release memory */ arome_free(parome); return 0; } |
REAL(C_DOUBLE), VALUE, intent(in) :: u1, u2 TYPE(C_PTR) :: arome_alloc_quad
INTEGER*8, intent(out) :: arome DOUBLE PRECISION, intent(in) :: u1, u2 INTEGER :: f90arome_alloc_quad
This function allocates and initializes an ARoME structure for a star with a quadratic limb-darkening whose coefficients are u1 and u2. The quadratic limb-darkening law is defined by I(x,y) = I_0[1 - u_1(1-\mu) - u_2(1-\mu)^2], where I_0=1/[\pi(1-u_1/3-u_2/6)] and \mu=\cos\theta is the cosine of the angle between the line of sight and the normal of the stellar surface.
The function arome_free
must be called to free the allocated memory by this function once the ARoME structure is not used anymore.
On exit, it returns NULL
(0
for the fortran 77/90/95 interface) if an error occurs, otherwise the return value is a non-NULL value.
The arguments are :
The following example allocates an ARoME structure with a quadratic limb-darkening
(u1=0.5, u2=0.0)
t_arome *arome; arome = arome_alloc_quad(0.5,0.0); if (arome) { /* ... computation ... */ /* free memory */ arome_free(arome); } |
REAL(C_DOUBLE), VALUE, intent(in) :: c1, c2, c3, c4 TYPE(C_PTR) :: arome_alloc_nl
INTEGER*8, intent(out) :: arome DOUBLE PRECISION, intent(in) :: c1, c2, c3, c4 INTEGER :: f90arome_alloc_nl
This function allocates and initializes an ARoME structure for a star with a nonlinear limb-darkening whose coefficients are c1, c2, c3, and c4. The nonlinear limb-darkening law is defined by I(x,y) =I_0 [1 - \sum_n c_n(1-\mu^n/2)], where I_0=1/[\pi(1-c_1/5-c_2/3-3c_3/7-c_4/2)] and \mu=\cos\theta is the cosine of the angle between the line of sight and the normal of the stellar surface.
The function arome_free
must be called to free the allocated memory by this function once the ARoME structure is not used anymore.
On exit, it returns NULL
(0
for the fortran 77/90/95 interface) if an error occurs, otherwise the return value is a non-NULL value.
The arguments are :
The following example allocates an ARoME structure with a nonlinear limb-darkening
(c1=0.5, c2=0.0, c3=0.1, c4=0.0)
t_arome *arome; arome = arome_alloc_nl(0.5,0.0,0.1,0.0); if (arome) { /* ... computation ... */ /* free memory */ arome_free(arome); } |
REAL(C_DOUBLE), VALUE, intent(in) :: u1, u2 TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_reset_quad
DOUBLE PRECISION, intent(in) :: u1, u2 INTEGER*8, intent(in) :: arome INTEGER :: f90arome_reset_quad
This function resets the quadratic coefficients of an ARoME structure already allocated with
arome_alloc_quad
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), VALUE, intent(in) :: c1, c2, c3, c4 TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_reset_nl
DOUBLE PRECISION, intent(in) :: c1, c2, c3, c4 INTEGER*8, intent(in) :: arome INTEGER :: f90arome_reset_nl
This function resets the nonlinear coefficients of an ARoME structure already allocated with
arome_alloc_nl
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), VALUE, intent(in) :: beta0, Vsini, sigma0, zeta INTEGER(C_INT), VALUE, intent(in) :: Kmax TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_set_lineprofile
DOUBLE PRECISION, intent(in) :: beta0, Vsini, sigma0, zeta INTEGER, intent(in) :: Kmax INTEGER*8, intent(in) :: arome INTEGER :: arome_set_lineprofile
This function sets the parameters of the observed line profiles. It should be called at least once after the allocation of an ARoME structure and before computing Rossiter-McLaughlin quantities with
arome_calc_fvpbetap
. If this function is called several times, only the last call is taken into account.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
arome_get_RM_CCF
or arome_get_RM_CCF_e
.
arome_get_RM_iodine
or arome_get_RM_iodine_e
.
REAL(C_DOUBLE), VALUE, intent(in) :: Rp TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_set_planet
DOUBLE PRECISION, intent(in) :: Rp INTEGER*8, intent(in) :: arome INTEGER :: f90arome_set_planet
This function sets the parameters of the planet. It should be called at least once after the allocation of an ARoME structure and before computing Rossiter-McLaughlin quantities with
arome_calc_fvpbetap
. If this function is called several times, only the last call is taken into account.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_init_CCF
INTEGER*8, intent(in) :: arome INTEGER :: f90arome_init_CCF
This function initializes some parameters used to compute the RM effect as measured by the Gaussian fit of a cross-correlation. It needs to be called only if
arome_get_RM_CCF
or arome_get_RM_CCF_e
is used. In that case, it must be called once after setting the line profiles with arome_set_lineprofile
and the planet with arome_set_planet
, and before computing the RM effect.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_init_iodine
INTEGER*8, intent(in) :: arome INTEGER :: f90arome_init_iodine
This function initializes some parameters used to compute the RM effect as measured by the iodine cell technique. It needs to be called only if
arome_get_RM_iodine
or arome_get_RM_iodine_e
is used. In that case, it must be called once, after setting the line profiles with arome_set_lineprofile
and the planet with arome_set_planet
, and before computing the RM effect.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), VALUE, intent(in) :: x, y, z TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER :: arome_calc_fvpbetap
DOUBLE PRECISION, intent(in) :: x, y, z INTEGER*8, intent(in) :: arome INTEGER :: f90arome_calc_fvpbetap
This function computes the flux fraction f occulted by the planet, the subplanet velocity v_p, and the widths of the subplanet line profile \beta_R and \beta_T associated to the radial and the tangential macro-turbulence, respectively. (x, y, z) are the coordinates of the planet with respect to the star. This function can be called any number of times once the line profile and the planet are set with
arome_set_lineprofile
and arome_set_planet
. The values of f, v_p, \beta_R, and \beta_T computed with arome_calc_fvpbetap
can be recovered using arome_get_flux
, arome_get_vp
, arome_get_betapR
, and arome_get_betapT
, respectively. These quantities can also be set or modified by the user with arome_set_flux
, arome_set_vp
, arome_set_betapR
, and arome_set_betapT
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), VALUE, intent(in) :: f TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_set_flux
DOUBLE PRECISION, intent(in) :: f INTEGER*8, intent(in) :: arome INTEGER :: f90arome_set_flux
This function sets the flux fraction f occulted by the planet, or modifies the value previously computed with
arome_calc_fvpbetap
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), VALUE, intent(in) :: vp TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_set_vp
DOUBLE PRECISION, intent(in) :: vp INTEGER*8, intent(in) :: arome INTEGER :: f90arome_set_vp
This function sets the subplanet velocity v_p, or modifies the value previously computed with
arome_calc_fvpbetap
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), VALUE, intent(in) :: betaR TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_set_betapR
DOUBLE PRECISION, intent(in) :: betaR INTEGER*8, intent(in) :: arome INTEGER :: f90arome_set_betapR
This function sets the width \beta_R of the subplanet line profile associated to the radial macro-turbulence, or modifies the value previously computed with
arome_calc_fvpbetap
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), VALUE, intent(in) :: betaT TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_set_betapT
DOUBLE PRECISION, intent(in) :: betaT INTEGER*8, intent(in) :: arome INTEGER :: f90arome_set_betapT
This function sets the width \beta_T of the subplanet line profile associated to the tangential macro-turbulence, or modifies the value previously computed with
arome_calc_fvpbetap
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE) :: arome_get_flux
INTEGER*8, intent(in) :: arome DOUBLE PRECISION :: f90arome_get_flux
This function returns the flux fraction f occulted by the planet previously computed with
arome_calc_fvpbetap
or arome_set_flux
.
If an error occurs, the return value is NaN
.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE) :: arome_get_vp
INTEGER*8, intent(in) :: arome DOUBLE PRECISION :: f90arome_get_vp
This function returns the subplanet velocity v_p in km/s previously computed with
arome_calc_fvpbetap
or arome_set_vp
.
If an error occurs, the return value is NaN
.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE) :: arome_get_betapR
INTEGER*8, intent(in) :: arome DOUBLE PRECISION :: f90arome_get_betapR
This function returns the width \beta_R in km/s of the subplanet line profile associated to the radial macro-turbulence previously computed with
arome_calc_fvpbetap
or arome_set_betapR
.
If an error occurs, the return value is NaN
.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE) :: arome_get_betapT
INTEGER*8, intent(in) :: arome DOUBLE PRECISION :: f90arome_get_betapT
This function returns the width \beta_T in km/s of the subplanet line profile associated to the radial macro-turbulence previously computed with
arome_calc_fvpbetap
or arome_set_betapT
.
If an error occurs, the return value is NaN
.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE) :: arome_get_RM_CCF
INTEGER*8, intent(in) :: arome DOUBLE PRECISION :: f90arome_get_RM_CCF
This function returns the value of the RM effect in km/s as measured by the cross-correlation technique. If an error occurs, the return value is
NaN
.
This function must be called only once the flux fraction f, the subplanet velocity v_p, and the widths \beta_R and \beta_T of the subplanet line profile have been computed or set by the user, and after arome_init_CCF
.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE), intent(out) :: v_CCF INTEGER(C_INT) :: arome_get_RM_CCF_e
INTEGER*8, intent(in) :: arome DOUBLE PRECISION, intent(out) :: v_CCF INTEGER :: f90arome_get_RM_CCF_e
This function is similar to
arome_get_RM_CCF
, except that it enables error handling.
It provides the value of the RM effect v_CCF
in km/s as measured by the cross-correlation technique.
This function must be called only once the flux fraction f, the subplanet velocity v_p, and the widths \beta_R and \beta_T of the subplanet line profile have been computed or set by the user, and after arome_init_CCF
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE) :: arome_get_RM_iodine
INTEGER*8, intent(in) :: arome DOUBLE PRECISION :: f90arome_get_RM_iodine
This function returns the value of the RM effect in km/s as measured by the iodine cell technique. If an error occurs, the return value is
NaN
.
This function must be called only once the flux fraction f, the subplanet velocity v_p, and the widths \beta_R and \beta_T of the subplanet line profile have been computed or set by the user, and after arome_init_iodine
.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE), intent(out) :: v_iodine INTEGER(C_INT) :: arome_get_RM_iodine_e
INTEGER*8, intent(in) :: arome DOUBLE PRECISION, intent(out) :: v_iodine INTEGER :: f90arome_get_RM_iodine_e
This function is similar to
arome_get_RM_iodine
, except that it enables error handling.
It provides the value of the RM effect v_iodine
in km/s as measured by the cross-correlation technique.
This function must be called only once the flux fraction f, the subplanet velocity v_p, and the widths \beta_R and \beta_T of the subplanet line profile have been computed or set by the user, and after arome_init_iodine
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE) :: arome_get_RM_mean
INTEGER*8, intent(in) :: arome DOUBLE PRECISION :: f90arome_get_RM_mean
This function returns the value of the RM effect in km/s as measured by the weighted mean. If an error occurs, the return value is
NaN
.
This function must be called only once the flux fraction f and the subplanet velocity v_p have been computed or set by the user.
Unlike arome_get_RM_CCF
and arome_get_RM_iodine
, this function does not need to be initialized.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome REAL(C_DOUBLE), intent(out) :: v_mean INTEGER(C_INT) :: arome_get_RM_mean_e
INTEGER*8, intent(in) :: arome DOUBLE PRECISION, intent(out) :: v_mean INTEGER :: f90arome_get_RM_mean_e
This function is similar to
arome_get_RM_mean
, except that it enables error handling.
It provides the value of the RM effect v_mean
in km/s as measured by the weighted mean.
This function must be called only once the flux fraction f and the subplanet velocity v_p have been computed or set by the user.
Unlike arome_get_RM_CCF_e
and arome_get_RM_iodine_e
, this function does not need to be initialized.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
This function frees allocated memory by any of the functions
arome_alloc_quad
or arome_alloc_nl
.
The following group of functions should be the preferred method to compute arrays of Rossiter-McLaughlin effects.
The allocation, initialization, and free functions are the same as in the single position group (see Single position functions). The others have a prefix "arome_m
" and are detailed in the following subsubsections.
When an error occurs, these functions execute error handlers according to the behavior defined by one of the following functions (see Error functions).
arome_set_exit_on_error
arome_set_continue_on_error
arome_set_func_on_error
The following examples, that can be founded in the directory ‘examples’ of the library sources, show the typical usage of this group of functions. The example in C language is ‘cmultiple.c’. The example in Fortran 2003 language is ‘f2003multiple.f’. The example in Fortran 77/90/95 language is ‘f77multiple.f’.
program f2003multiple use module_arome implicit none real(8), parameter :: pi = acos(-1.0d0) integer, parameter :: ncoord = 20 real(8) :: c1, c2, c3, c4, beta0, Vsini, sigma0, zeta, Rp real(8) :: sma, inc, lambda, anom integer :: Kmax real(8) :: M_init, M_end real(8) :: tab_anom(ncoord) real(8) :: tab_x(ncoord), tab_y(ncoord), tab_z(ncoord) real(8) :: tab_f(ncoord), tab_vp(ncoord) real(8) :: tab_betapR(ncoord), tab_betapT(ncoord) real(8) :: tab_v_CCF(ncoord) real(8) :: tab_v_iodine(ncoord) real(8) :: tab_v_mean(ncoord) type(C_PTR) :: arome integer :: nerror, k nerror = 0 !/* planet orbital parameters */ sma = 4.0d0 !/* stellar radii */ inc = 86.0d0*pi/180.0d0 !/* radian */ !/* spin-orbit angle */ lambda = 30.0d0*pi/180.0d0 !/* radian */ !/* Mean anomaly */ M_init = 70.0d0*pi/180.0d0 M_end = 110.0d0*pi/180.0d0 !/* planet's coordinates */ do k=1,ncoord anom = (M_end-M_init)*(k-1.0)/(ncoord-1.0d0)+M_init tab_anom(k) = anom tab_x(k) = sma*(-cos(lambda)*cos(anom)+sin(lambda) & & *sin(anom)*cos(inc)) tab_y(k) = sma*(-sin(lambda)*cos(anom)-cos(lambda) & & *sin(anom)*cos(inc)) tab_z(k) = sma*sin(anom)*sin(inc) end do !/* limb-darkening */ c1 = 0.701d0 c2 = 0.149d0 c3 = 0.277d0 c4 =-0.297d0 |
!/* line profile */ beta0 = 2.0d0 !/* width of the non-rotating star */ Vsini = 15.0d0 !/* Vsini */ sigma0 = 8.0d0 !/* width of the best Gaussian fit */ zeta = 2.0d0 !/* macro-turbulence parameter */ Rp = 0.1d0 !/* radius of the planet */ Kmax = 4 !/* order of expansion for the Iodine technique */ !/* allocation of the ARoME structure */ arome = arome_alloc_nl(c1, c2, c3, c4) !/* set the lineprofile */ nerror = arome_set_lineprofile(beta0, Vsini, sigma0, & & zeta, Kmax, arome) !/* set the planet parameters */ nerror = arome_set_planet(Rp, arome) !/* initialize the techniques used in the following */ nerror = arome_init_CCF(arome) nerror = arome_init_iodine(arome) !/* allocate memory for vectorial routines */ nerror = arome_malloc(ncoord, arome) !/* compute the flux, vp and betap */ nerror = arome_mcalc_fvpbetap(tab_x, tab_y, tab_z, & & ncoord, arome) !/* recover the computed flux, subplanet vp, betapR, and betapT */ nerror = arome_mget_flux(arome, ncoord, tab_f) nerror = arome_mget_vp(arome, ncoord, tab_vp) nerror = arome_mget_betapR(arome, ncoord, tab_betapR) nerror = arome_mget_betapT(arome, ncoord, tab_betapT) !/* get the RM signals */ nerror = arome_mget_RM_CCF(arome, ncoord, tab_v_CCF) nerror = arome_mget_RM_iodine(arome, ncoord, tab_v_iodine) nerror = arome_mget_RM_mean(arome, ncoord, tab_v_mean) !/* print the results */ do k=1,ncoord print '(SS,F9.6,SP,F9.4,F9.4,F9.4,SS,F9.6,SP, & & F9.4,SS,F9.4,F9.4,SP,F9.5,F9.5,F9.5)', & & tab_anom(k)/(2.0d0*pi), tab_x(k), tab_y(k), tab_z(k), & & tab_f(k), tab_vp(k), tab_betapR(k), tab_betapT(k), & & tab_v_CCF(k), tab_v_iodine(k), tab_v_mean(k) end do |
!/* release memory */ call arome_mfree(arome) call arome_free(arome) stop end |
INTEGER(C_INT), VALUE, intent(in) :: n TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_malloc
INTEGER, intent(in) :: n INTEGER*8, intent(in) :: arome INTEGER :: f90arome_malloc
This function allocates memory for computing multiple values of RM effects. It should be called after, and in addition to,
arome_alloc_quad
or arome_alloc_nl
. The allocated memory by this function should be released with arome_mfree
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), dimension(n) :: x, y, z INTEGER(C_INT), VALUE, intent(in) :: n TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER :: arome_mcalc_fvpbetap
DOUBLE PRECISION :: x(n), y(n), z(n) INTEGER, intent(in) :: n INTEGER*8, intent(in) :: arome INTEGER :: f90arome_mcalc_fvpbetap
This function computes the flux fraction f occulted by the planet, the subplanet velocity v_p, and the widths of the subplanet line profile \beta_R and \beta_T associated to the radial and the tangential macro-turbulence at each of the n positions of the planet, respectively. (x, y, z) are the coordinates of the planet with respect to the star. This function can be called once the line profile and the planet are set with
arome_set_lineprofile
and arome_set_planet
, and after allocating memory with arome_malloc
. The values of f, v_p, \beta_R, and \beta_T computed with arome_mcalc_fvpbetap
can be recovered using arome_mget_flux
, arome_mget_vp
, arome_mget_betapR
, and arome_mget_betapT
, respectively. These quantities can also be set or modified by the user with arome_mset_flux
, arome_mset_vp
, arome_mset_betapR
, and arome_mset_betapT
.
The number of positions n
in arome_mcalc_fvpbetap
should be the same as in the call of arome_malloc
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), dimension(n) :: f INTEGER(C_INT), VALUE, intent(in) :: n TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_mset_flux
DOUBLE PRECISION :: f(n) INTEGER, intent(in) :: n INTEGER*8, intent(in) :: arome INTEGER :: f90arome_mset_flux
This function sets the flux fraction f occulted by the planet, or modifies the value previously computed with
arome_mcalc_fvpbetap
.
The number of positions n
in arome_mset_flux
should be the same as in the call of arome_malloc
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), dimension(n) :: vp INTEGER(C_INT), VALUE, intent(in) :: n TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_mset_vp
DOUBLE PRECISION :: vp(n) INTEGER, intent(in) :: n INTEGER*8, intent(in) :: arome INTEGER :: f90arome_mset_vp
This function sets the subplanet velocity v_p, or modifies the value previously computed with
arome_mcalc_fvpbetap
.
The number of positions n
in arome_mset_vp
should be the same as in the call of arome_malloc
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), dimension(n) :: betaR INTEGER(C_INT), VALUE, intent(in) :: n TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_mset_betapR
DOUBLE PRECISION :: betaR(n) INTEGER, intent(in) :: n INTEGER*8, intent(in) :: arome INTEGER :: f90arome_mset_betapR
This function sets the width \beta_R of the subplanet line profile associated to the radial macro-turbulence, or modifies the value previously computed with
arome_mcalc_fvpbetap
.
The number of positions n
in arome_mset_betapR
should be the same as in the call of arome_malloc
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), dimension(n) :: betaT INTEGER(C_INT), VALUE, intent(in) :: n TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT) :: arome_mset_betapT
DOUBLE PRECISION :: betaT(n) INTEGER, intent(in) :: n INTEGER*8, intent(in) :: arome INTEGER :: f90arome_mset_betapT
This function sets the width \beta_T of the subplanet line profile associated to the tangential macro-turbulence, or modifies the value previously computed with
arome_mcalc_fvpbetap
.
The number of positions n
in arome_mset_betapT
should be the same as in the call of arome_malloc
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT), VALUE, intent(in) :: n REAL(C_DOUBLE), dimension(n) :: f INTEGER(C_INT) :: arome_mget_flux
INTEGER*8, intent(in) :: arome INTEGER, intent(in) :: n DOUBLE PRECISION :: f(n) INTEGER :: f90arome_mget_flux
This function returns the flux fraction f occulted by the planet previously computed with
arome_mcalc_fvpbetap
or arome_mset_flux
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT), VALUE, intent(in) :: n REAL(C_DOUBLE), dimension(n) :: vp INTEGER(C_INT) :: arome_mget_vp
INTEGER*8, intent(in) :: arome INTEGER, intent(in) :: n DOUBLE PRECISION :: vp(n) INTEGER :: f90arome_mget_vp
This function returns the subplanet velocity v_p in km/s previously computed with
arome_mcalc_fvpbetap
or arome_mset_vp
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT), VALUE, intent(in) :: n REAL(C_DOUBLE), dimension(n) :: betaR INTEGER(C_INT) :: arome_mget_betapR
INTEGER*8, intent(in) :: arome INTEGER, intent(in) :: n DOUBLE PRECISION :: betaR(n) INTEGER :: f90arome_mget_betapR
This function returns the width \beta_R in km/s of the subplanet line profile associated to the radial macro-turbulence previously computed with
arome_mcalc_fvpbetap
or arome_mset_betapR
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT), VALUE, intent(in) :: n REAL(C_DOUBLE), dimension(n) :: betaT INTEGER(C_INT) :: arome_mget_betapT
INTEGER*8, intent(in) :: arome INTEGER, intent(in) :: n DOUBLE PRECISION :: betaT(n) INTEGER :: f90arome_mget_betapT
This function returns the width \beta_T in km/s of the subplanet line profile associated to the tangential macro-turbulence previously computed with
arome_mcalc_fvpbetap
or arome_mset_betapT
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT), VALUE, intent(in) :: n REAL(C_DOUBLE), dimension(n) :: v_CCF INTEGER :: arome_mget_RM_CCF
INTEGER*8, intent(in) :: arome INTEGER, intent(in) :: n DOUBLE PRECISION :: v_CCF(n) INTEGER :: f90arome_mget_RM_CCF
This function returns the value of the RM effect in km/s as measured by the cross-correlation technique. This function must be called only once the flux fraction f, the subplanet velocity v_p, and the widths \beta_R and \beta_T of the subplanet line profile have been computed or set by the user, and after
arome_init_CCF
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT), VALUE, intent(in) :: n REAL(C_DOUBLE), dimension(n) :: v_iodine INTEGER(C_INT) :: arome_mget_RM_iodine
INTEGER*8, intent(in) :: arome INTEGER, intent(in) :: n DOUBLE PRECISION :: v_iodine(n) INTEGER :: f90arome_mget_RM_iodine
This function returns the value of the RM effect in km/s as measured by the iodine cell technique. This function must be called only once the flux fraction f, the subplanet velocity v_p, and the widths \beta_R and \beta_T of the subplanet line profile have been computed or set by the user, and after
arome_init_iodine
.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: arome INTEGER(C_INT), VALUE, intent(in) :: n REAL(C_DOUBLE), dimension(n) :: v_mean INTEGER(C_INT) :: arome_mget_RM_mean
INTEGER*8, intent(in) :: arome INTEGER, intent(in) :: n DOUBLE PRECISION :: v_mean(n) INTEGER :: f90arome_mget_RM_mean
This function returns the value of the RM effect in km/s as measured by the weighted mean. This function must be called only once the flux fraction f and the subplanet velocity v_p have been computed or set by the user.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
This function releases the memory allocated by
arome_malloc
. It should be called before, and in addition to, arome_free
.
The argument is :
The following group of functions defines the behavior of the library when errors occur during the execution.
The following examples, that can be founded in the directory ‘examples’ of the library sources, show the typical usage of this group of functions. The example in C language is ‘cerror.c’. The example in Fortran 2003 language is ‘f2003error.f’. The example in Fortran 77/90/95 language is ‘f77error.f’.
The following example shows how to stop the execution on the error with the Fortran 2003 interface.
program f2003error USE, INTRINSIC :: ISO_C_BINDING use module_arome implicit none type(C_PTR) arome ! set the error handler to stop on error call arome_set_exit_on_error() ! allocate a new ARoME structure with quadratic limb-darkening arome = arome_alloc_quad(0.1,0.0) ... stop end !/*-----------------------------------------------------------------*/ !/* custom error handler */ !/*-----------------------------------------------------------------*/ subroutine myhandler(msg, msglen) BIND(C) USE, INTRINSIC :: ISO_C_BINDING implicit none character(kind=C_CHAR), dimension(msglen), intent(in) & & :: msg integer(C_INT), VALUE, intent(in) :: msglen write (*,*) "The ARoME calls the function myhandler" write (*,*) "The message contains ",msglen," characters" write(*,*) "The error message is :" write(*,*) "----------------------" write(*,*) msg write(*,*) "----------------------" write(*,*) "The error handler returns" end |
The following example shows how to define a custom error handler function with the Fortran 2003 interface.
!/*-----------------------------------------------------------------*/ !/* main program */ !/*-----------------------------------------------------------------*/ program f2003error USE, INTRINSIC :: ISO_C_BINDING use module_arome implicit none type(C_PTR) arome interface subroutine myhandler(msg, msglen) BIND(C) USE, INTRINSIC :: ISO_C_BINDING implicit none character(kind=C_CHAR), dimension(msglen), intent(in) & & :: msg integer(C_INT), VALUE, intent(in) :: msglen end subroutine end interface ! set the error handler to use my own callback call arome_set_func_on_error(c_funloc(myhandler)) ! allocate a new ARoME structure with quadratic limb-darkening arome = arome_alloc_quad(0.1,0.0) .... stop end |
This function sets the behavior of the library to continue when an error occurs during the execution of the library's functions. This is the default behavior, thus this function needs not to be called.
This function sets the behavior of the library to exit when an error occurs during the execution of the library's functions. This function should be called (not mandatory) before any other functions of the library.
TYPE(C_FUNPTR), VALUE, intent(in) :: userfunc
EXTERNAL, intent(in) :: userfunc
This function sets the behavior of the library to call the user function
userfunc
when an error occurs during the execution of the library's functions. This function should be (not mandatory) called before any other functions of the library.
The function userfunc must be defined as
USE, INTRINSIC :: ISO_C_BINDING implicit none CHARACTER(kind=C_CHAR), dimension(msglen), intent(in) :: msg INTEGER(C_INT), VALUE, intent(in) :: msglen
With Fortran 2003 interface, this function must have an explicit interface. With fortran 77/90/95 interface, this function must be declared as EXTERNAL
.
The following group of functions is not dedicated to the Rossiter-McLaughlin effect alone. It is designed to compute planet cartesian coordinates for given sets of orbital elliptical elements. These routines are thus not mandatory to compute the Rossiter-McLaughlin effect, but they may help since they provide the coordinates x, y, and z required by the functions arome_calc_fvpbetap
and arome_mcalc_fvpbetap
.
The following examples, that can be founded in the directory ‘examples’ of the library sources, show the typical usage of this group of functions. The example in C language is ‘corbit.c’. The example in Fortran 2003 language is ‘f2003orbit.f’. The example in Fortran 77/90/95 language is ‘f77orbit.f’.
The following example shows how to stop the execution on the error with the Fortran 2003 interface.
program f2003orbit USE, INTRINSIC :: ISO_C_BINDING use module_arome implicit none type(C_PTR) orbit1 integer nerror real(8) x, y, z nerror = 0 ! create a new orbit orbit1 = arome_new_orbit() ! set the orbital parameters (per, sma, ecc, inc, om, lambda) nerror = arome_set_orbit_eo(2.d0,4.d0,0.02d0,32.d0, & & 82.d0,20.d0,orbit1) ! compute planet's coordinate at time t=0.2 nerror = arome_get_orbit_xyz(orbit1,0.2d0,x,y,z) ! release allocated memory arome_free_orbit(orbit1) stop end |
INTEGER*8, intent(out) :: orbit INTEGER :: f90arome_new_orbit
This function creates a new orbit structure.
The function arome_free_orbit
must be called to free the allocated memory by this function once the orbit structure is not used anymore.
On exit, it returns NULL
(0
for the fortran 77/90/95 interface) if an error occurs, otherwise the return value is a non-NULL value.
REAL(C_DOUBLE), VALUE, intent(in) :: per, sma, ecc, om, inc, lambda TYPE(C_PTR), VALUE, intent(in) :: orbit INTEGER(C_INT) :: arome_set_orbit_eo
DOUBLE PRECISION, intent(in) :: per, sma, ecc, om, inc, lambda INTEGER*8, intent(in) :: orbit INTEGER :: f90arome_set_orbit_eo
This function sets the elliptical elements of the orbit. It can be called an arbitrary number of times. Only the last call is taken into account. With this set of elliptical parameters (e,\omega), the origin of time is assumed to be at the passage of the pericenter t_\rm peri. Since the parameters e, \omega, and t_\rm peri are strongly correlated, we encourage people to use the variable k, h, and passage at the ascending node t_\rm node as required by the function
arome_set_orbit_kh
, instead.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
REAL(C_DOUBLE), VALUE, intent(in) :: per, sma, k, h, inc, lambda TYPE(C_PTR), VALUE, intent(in) :: orbit INTEGER(C_INT) :: arome_set_orbit_kh
DOUBLE PRECISION, intent(in) :: per, sma, k, h, inc, lambda INTEGER*8, intent(in) :: orbit INTEGER :: f90arome_set_orbit_kh
This function sets the elliptical elements of the orbit. It can be called an arbitrary number of times. Only the last call is taken into account. With this set of elliptical parameters (k,h), the origin of time is assumed to be the passage at the ascending node t_\rm node. This function should be preferred with respect to
arome_set_orbit_eo
since k,
h, and t_\rm node are independent while e,
\omega, and the passage at the pericenter are not.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: orbit REAL(C_DOUBLE) :: arome_get_orbit_transit_time
INTEGER*8, intent(in) :: orbit DOUBLE PRECISION :: f90arome_get_orbit_transit_time
This function computes and returns the instant of midtransit modulo the orbital period. The origin of time depends on the function used to set the orbital elliptical elements. If the orbit has been set using
arome_set_orbit_eo
, the origin of time
is the passage at the pericenter, otherwise, if the orbit has been set using
arome_set_orbit_kh
, the origin of time is the passage at the ascending
node.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: orbit REAL(C_DOUBLE), VALUE, intent(in) :: t REAL(C_DOUBLE), intent(out) :: x, y, z INTEGER(C_INT) :: arome_get_orbit_xyz
INTEGER*8, intent(in) :: orbit DOUBLE PRECISION, intent(in) :: t DOUBLE PRECISION, intent(out) :: x, y, z INTEGER :: f90arome_get_orbit_xyz
This function computes the coordinates (x, y, z) of a planet on the orbit orbit at the time t. The origin of time t_0 depends on the function used to set the orbital elliptical elements. If the orbit has been set using
arome_set_orbit_eo
, the origin of time is the
passage at the pericenter, otherwise, if the orbit has been set using
arome_set_orbit_kh
, the origin of time is the passage at the ascending
node.
In the case where the dates are more easily defined with respect to the midtransit time, the function arome_get_orbit_transit_time
can be used to compute the midtransit time t_\rm trans. Then, t+t_\rm trans is such that t_0=0.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: orbit REAL(C_DOUBLE), dimension(n) :: t INTEGER(C_INT), VALUE, intent(in) :: n REAL(C_DOUBLE), dimension(n) :: x, y, z INTEGER(C_INT) :: arome_mget_orbit_xyz
INTEGER*8, intent(in) :: orbit DOUBLE PRECISION :: t(n) INTEGER, intent(in) :: n DOUBLE PRECISION :: x(n), y(n), z(n) INTEGER :: f90arome_mget_orbit_xyz
This function computes the coordinates (x, y, z) of a planet on the orbit orbit for all time t. The origin of time t_0 depends on the function used to set the orbital elliptical elements. If the orbit has been set using
arome_set_orbit_eo
, the origin of time is the
passage at the pericenter, otherwise, if the orbit has been set using
arome_set_orbit_kh
, the origin of time is the passage at the ascending
node.
In the case where the dates are more easily defined with respect to the midtransit time, the function arome_get_orbit_transit_time
can be used to compute the midtransit time t_\rm trans. Then, t+t_\rm trans is such that t_0=0.
On exit, it returns a non-zero value if an error occurs, otherwise the return value is 0.
The arguments are :
TYPE(C_PTR), VALUE, intent(in) :: orbit
This function frees allocated memory by the function
arome_new_orbit
.