forked from jdeast/EXOFASTv2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexofastv2.html
6107 lines (5213 loc) · 240 KB
/
exofastv2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!-- This file was generated by mk_html_help.pro -->
<html>
<head>
<TITLE>Extended IDL Help</TITLE>
</head>
<body>
<H1>Extended IDL Help</H1>
<P>
This page was created by the IDL library routine
<CODE>mk_html_help</CODE>. For more information on
this routine, refer to the IDL Online Help Navigator
or type: <P>
<PRE> ? mk_html_help</PRE><P>
at the IDL command line prompt.<P>
<STRONG>Last modified: </STRONG>Wed Jul 13 23:33:26 2022.<P>
<HR>
<A NAME="ROUTINELIST">
<H1>List of Routines</H1></A>
<UL>
<LI><A HREF="#"></A>
<LI><A HREF="#ANGSEP">ANGSEP</A>
<LI><A HREF="#BJD2TARGET">BJD2TARGET</A>
<LI><A HREF="#CALCB[1]">CALCB[1]</A>
<LI><A HREF="#CALCB[2]">CALCB[2]</A>
<LI><A HREF="#COMPARESTARS">COMPARESTARS</A>
<LI><A HREF="#COMPARESTARS_CORNER[1]">COMPARESTARS_CORNER[1]</A>
<LI><A HREF="#COMPARESTARS_CORNER[2]">COMPARESTARS_CORNER[2]</A>
<LI><A HREF="#CONVERT_TRANSIT_TIMES">CONVERT_TRANSIT_TIMES</A>
<LI><A HREF="#CROSSREF">CROSSREF</A>
<LI><A HREF="#ELLKE">ELLKE</A>
<LI><A HREF="#ELLPIC_BULIRSCH">ELLPIC_BULIRSCH</A>
<LI><A HREF="#EXOFAST">EXOFAST</A>
<LI><A HREF="#EXOFASTV2">EXOFASTV2</A>
<LI><A HREF="#EXOFAST_AMOEBA">EXOFAST_AMOEBA</A>
<LI><A HREF="#EXOFAST_ASTROM">EXOFAST_ASTROM</A>
<LI><A HREF="#EXOFAST_BLACKBODY">EXOFAST_BLACKBODY</A>
<LI><A HREF="#EXOFAST_CHI2">EXOFAST_CHI2</A>
<LI><A HREF="#EXOFAST_DEMC">EXOFAST_DEMC</A>
<LI><A HREF="#EXOFAST_ERRELL">EXOFAST_ERRELL</A>
<LI><A HREF="#EXOFAST_GELMANRUBIN">EXOFAST_GELMANRUBIN</A>
<LI><A HREF="#EXOFAST_GETB">EXOFAST_GETB</A>
<LI><A HREF="#EXOFAST_GETB2">EXOFAST_GETB2</A>
<LI><A HREF="#EXOFAST_GETMCMCSCALE">EXOFAST_GETMCMCSCALE</A>
<LI><A HREF="#EXOFAST_GETPHASE">EXOFAST_GETPHASE</A>
<LI><A HREF="#EXOFAST_GETTC">EXOFAST_GETTC</A>
<LI><A HREF="#EXOFAST_GETTT[1]">EXOFAST_GETTT[1]</A>
<LI><A HREF="#EXOFAST_GETTT[2]">EXOFAST_GETTT[2]</A>
<LI><A HREF="#EXOFAST_KEPLEREQ">EXOFAST_KEPLEREQ</A>
<LI><A HREF="#EXOFAST_LATEXTAB[1]">EXOFAST_LATEXTAB[1]</A>
<LI><A HREF="#EXOFAST_LATEXTAB[2]">EXOFAST_LATEXTAB[2]</A>
<LI><A HREF="#EXOFAST_LIKE">EXOFAST_LIKE</A>
<LI><A HREF="#EXOFAST_MULTIPLOT">EXOFAST_MULTIPLOT</A>
<LI><A HREF="#EXOFAST_OCCULTQUAD">EXOFAST_OCCULTQUAD</A>
<LI><A HREF="#EXOFAST_OCCULTQUAD_CEL">EXOFAST_OCCULTQUAD_CEL</A>
<LI><A HREF="#EXOFAST_PLOTDIST_CORNER">EXOFAST_PLOTDIST_CORNER</A>
<LI><A HREF="#EXOFAST_QUERYVIZIER">EXOFAST_QUERYVIZIER</A>
<LI><A HREF="#EXOFAST_RANDOM">EXOFAST_RANDOM</A>
<LI><A HREF="#EXOFAST_RECENTER">EXOFAST_RECENTER</A>
<LI><A HREF="#EXOFAST_ROSSITER">EXOFAST_ROSSITER</A>
<LI><A HREF="#EXOFAST_RV">EXOFAST_RV</A>
<LI><A HREF="#EXOFAST_TEXTOIDL[1]">EXOFAST_TEXTOIDL[1]</A>
<LI><A HREF="#EXOFAST_TEXTOIDL[2]">EXOFAST_TEXTOIDL[2]</A>
<LI><A HREF="#EXOFAST_TRAN">EXOFAST_TRAN</A>
<LI><A HREF="#EXOFAST_TWILIGHT">EXOFAST_TWILIGHT</A>
<LI><A HREF="#GETAVPRIOR">GETAVPRIOR</A>
<LI><A HREF="#GETBURNNDX">GETBURNNDX</A>
<LI><A HREF="#GOLDENRATIO">GOLDENRATIO</A>
<LI><A HREF="#JSON_PARSE">JSON_PARSE</A>
<LI><A HREF="#KTOM2">KTOM2</A>
<LI><A HREF="#LEGEND">LEGEND</A>
<LI><A HREF="#LINLD">LINLD</A>
<LI><A HREF="#MASSRADIUS_MIST[1]">MASSRADIUS_MIST[1]</A>
<LI><A HREF="#MASSRADIUS_MIST[2]">MASSRADIUS_MIST[2]</A>
<LI><A HREF="#MASSRADIUS_PARSEC">MASSRADIUS_PARSEC</A>
<LI><A HREF="#MASSRADIUS_TORRES">MASSRADIUS_TORRES</A>
<LI><A HREF="#MKCONSTANTS">MKCONSTANTS</A>
<LI><A HREF="#MKPRIOR">MKPRIOR</A>
<LI><A HREF="#MKSED">MKSED</A>
<LI><A HREF="#OMC">OMC</A>
<LI><A HREF="#PARS2STR">PARS2STR</A>
<LI><A HREF="#PLOTIMAGE">PLOTIMAGE</A>
<LI><A HREF="#QUADLD">QUADLD</A>
<LI><A HREF="#READIPAC">READIPAC</A>
<LI><A HREF="#REMAKE_CORNER">REMAKE_CORNER</A>
<LI><A HREF="#SETDEFAULTVALUE">SETDEFAULTVALUE</A>
<LI><A HREF="#SPLITPDF">SPLITPDF</A>
<LI><A HREF="#STROM_CONV[1]">STROM_CONV[1]</A>
<LI><A HREF="#STROM_CONV[2]">STROM_CONV[2]</A>
<LI><A HREF="#TEXTOIDL_MATCHDELIM">TEXTOIDL_MATCHDELIM</A>
<LI><A HREF="#TEXTOIDL_NEXTTOK">TEXTOIDL_NEXTTOK</A>
<LI><A HREF="#TEXTOIDL_STRCNT">TEXTOIDL_STRCNT</A>
<LI><A HREF="#TEXTOIDL_STRTOK">TEXTOIDL_STRTOK</A>
<LI><A HREF="#TEXTOIDL_STRTRANS">TEXTOIDL_STRTRANS</A>
<LI><A HREF="#TEXTOIDL_SUB_SUP">TEXTOIDL_SUB_SUP</A>
<LI><A HREF="#TEXTOIDL_TABLE">TEXTOIDL_TABLE</A>
<LI><A HREF="#TEXTOIDL_TRANS_SUB_SUPER">TEXTOIDL_TRANS_SUB_SUPER</A>
<LI><A HREF="#TRANSITGIF">TRANSITGIF</A>
<LI><A HREF="#UPDATETIME">UPDATETIME</A>
<LI><A HREF="#WAVELETLIKE">WAVELETLIKE</A>
<LI><A HREF="#WEBGET()">WEBGET()</A>
</UL><P>
<HR>
<H1>Routine Descriptions</H1>
<A NAME="">
<H2></H2></A>
<A HREF="#ANGSEP">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
pg_ran
PURPOSE:
generates uniform random numbers
CATEGORY:
numeric utils
CALLING SEQUENCE:
data=pg_ran(seed,n)
INPUTS:
n: number of uniform random deviates to produce
OPTIONAL INPUTS:
seed: seed for the random number generator. Input is either a scalar integer
or an array of 3 UL64 integers. The internal seed of the routine is the
array of 3 UL64 integers.
KEYWORD PARAMETERS:
double: if set, output is double precision instead of ulong64
OUTPUTS:
data: a set of ulong64 integers, uniformly randomly distributed
between 0ULL and 2ULL^64-1
(if keyword /double is set - doubles between 0d and 1d will
be returned instead)
OPTIONAL OUTPUTS:
seed: the seed to be used to get the next number in the sequence.
It's an array of 3 L64 integers.
none
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
PROCEDURE:
IDL implementation of the routine "ran" of numerical
recipes 3d edition (page 342). This is a high quality
random generator with a period of ~ 3.138x10^57.
EXAMPLE:
seed=17
print,pg_ran(seed,10)
269952321389814056
7477734313819993120
16294976781531816119
17039904789424739738
4945048831639962635
1565409385732501729
7095006703038622919
13927236388846696772
150171266583137103
8092874815854888167
seed=17
print,pg_ran(seed,10,/double),format='(d17.15)'
0.014634144665917
0.405368789415652
0.883352461356882
0.923735089582023
0.268071634315548
0.084861012842019
0.384621084061685
0.754996997475338
0.008140800673717
0.438715622850155
MODIFICATION HISTORY:
2008 Paolo C. Grigis written
07-AUG-2009 Paolo C. Grigis updated documentation
12-NOV-2009 PG added /double keyword
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/pg_ran.pro)</STRONG><P>
<HR>
<A NAME="ANGSEP">
<H2>ANGSEP</H2></A>
<A HREF="#">[Previous Routine]</A>
<A HREF="#BJD2TARGET">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
angsep
PURPOSE:
Compute the angular distance between two spherical coordinates.
DESCRIPTION:
CATEGORY:
Mathematical
CALLING SEQUENCE:
ans=angsep(ra1,dec1,ra2,dec2)
INPUTS:
ra1 - RA of first position (radians)
dec1 - Dec of first position (radians)
ra2 - RA of second position (radians)
dec2 - Dec of second position (radians)
OPTIONAL INPUT PARAMETERS:
KEYWORD INPUT PARAMETERS:
OUTPUTS:
return value is the angular distance in radians.
KEYWORD OUTPUT PARAMETERS:
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
Written by Marc W. buie, Lowell Observatory, 1997/09/08
2009/02/26, MWB, added protection against round off error generating NaN
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/angsep.pro)</STRONG><P>
<HR>
<A NAME="BJD2TARGET">
<H2>BJD2TARGET</H2></A>
<A HREF="#ANGSEP">[Previous Routine]</A>
<A HREF="#CALCB[1]">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
BJD2TARGET
PURPOSE:
Iteratively calls TARGET2BJD to convert a BJD in Barycentric
Dynamical Time (BJD_TDB) to a BJD in the target barycenter
time (BJD_TARGET) within TOL days.
DESCRIPTION:
The opposite of TARGET2BJD; see description there.
INPUTS:
BJD_TDB - A scalar or array of BJDs in TDB. Must be double
precision.
INCLINATION - The inclination of the orbit
A - The semi-major axis of the orbit (AU)
TP - The time of periastron of the orbit (BJD_TARGET)
PERIOD - The period of the orbit (days)
E - Eccentricity of the orbit
OMEGA - Argument of Periastron of the orbit (radians)
OPTIONAL INPUTS:
Q - The mass ratio of the targets (M1/M2). If not
specified, an infinite mass ratio is assumed (M1 is
stationary at the barycenter) (8 ms effect for Hot
Jupiters).
TOL - The tolerance, in days. The iterative procedure will
stop after the worst-case agreement is better than this.
Default = 1d-8 (1 ms).
OPTIONAL KEYWORDS:
PRIMARY - If set, the information comes from the position of
the primary (as in RV), and therefore the correction
will be the light travel time from the center of the
primary to the Barycenter -- analagous to the
difference between HJD and BJD in our solar system
(only ~8 ms for Hot Jupiters, but increasing with a).
Otherwise, the correction will be the light
travel time from the smaller body to the barycenter
(as in transits) -- analagous to the difference
between JD and BJD in the Solar System.
NOTE: if Q is not specified and PRIMARY is, no
correction is applied.
OUTPUTS:
BJD_TARGET - The time as it would flow in the Barycenter of the target.
LIMITATIONS:
We ignore the distance to the object (plane parallel waves), which
should have a similar effect as the distance plays in the BJD
correction (< 1 ms). We also ignore the systemic velocity, which
will compress/expand the period by a factor gamma/c.
REVISION HISTORY:
2011/06: Written by Jason Eastman (OSU)
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/bjd2target.pro)</STRONG><P>
<HR>
<A NAME="CALCB[1]">
<H2>CALCB[1]</H2></A>
<A HREF="#BJD2TARGET">[Previous Routine]</A>
<A HREF="#CALCB[2]">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
CALCB
PURPOSE:
Calculates the impact parameter of a given time. The function to minimize
Implementation translated from here:
https://en.wikipedia.org/wiki/Golden-section_search
CALLING SEQUENCE:
min = goldenratio('func', min, max)
INPUTS:
FUNC - A string specifying the name of the function to be
minimized
A - The minimum bound on the function to be minimized
B - The maximum bound on the function to be minimized
RESULT:
The minimum value
MODIFICATION HISTORY
2018/11/13 -- Written by Jason Eastman, CfA
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/exofast.gettt.bak.pro)</STRONG><P>
<HR>
<A NAME="CALCB[2]">
<H2>CALCB[2]</H2></A>
<A HREF="#CALCB[1]">[Previous Routine]</A>
<A HREF="#COMPARESTARS">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
CALCB
PURPOSE:
Calculates the impact parameter of a given time. The function to minimize
Implementation translated from here:
https://en.wikipedia.org/wiki/Golden-section_search
CALLING SEQUENCE:
min = goldenratio('func', min, max)
INPUTS:
FUNC - A string specifying the name of the function to be
minimized
A - The minimum bound on the function to be minimized
B - The maximum bound on the function to be minimized
RESULT:
The minimum value
MODIFICATION HISTORY
2018/11/13 -- Written by Jason Eastman, CfA
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/exofast_gettt.pro)</STRONG><P>
<HR>
<A NAME="COMPARESTARS">
<H2>COMPARESTARS</H2></A>
<A HREF="#CALCB[2]">[Previous Routine]</A>
<A HREF="#COMPARESTARS_CORNER[1]">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
COMPARESTARS
PURPOSE:
Compares the stellar parameters of several different fits using
the IDL save files as output by exofastv2.pro.
CALLING SEQUENCE:
comparestars, 'savpath' [,TAGS=,PSNAME=]
INPUTS:
SAVPATH - A string resolved by file_search to specify the names of
all the idl save files to compare.
TAGS - A string array specifying the tagnames (parameters) to
compare. Default is
['mstar','rstar','rhostar','logg','teff','feh','initfeh','age','lstar','eep']
PSNAME - A string specifying the name of the postscript file to
output. If not specified, the plots are made to the screen.
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/comparestars.pro)</STRONG><P>
<HR>
<A NAME="COMPARESTARS_CORNER[1]">
<H2>COMPARESTARS_CORNER[1]</H2></A>
<A HREF="#COMPARESTARS">[Previous Routine]</A>
<A HREF="#COMPARESTARS_CORNER[2]">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
COMPARESTARS_CORNER
PURPOSE:
Creates a corner plot of several different fits overlaid on top
of each other using the IDL save files as output by exofastv2.pro.
CALLING SEQUENCE:
comparestars, 'savpath' [,TAGS=,LATEXNAMES=,LEGENDTXT=,PSNAME=]
INPUTS:
SAVPATH - A string resolved by file_search or an array of
filenames specifying the names of all the idl save
files to compare.
See NSAMPLE if files are large
TAGS - A string array specifying the tagnames (parameters) to
compare. Default is
['mstar','rstar','rhostar','logg','teff','feh','initfeh','age','lstar','eep']
LATEXNAMES - A string array specifying the textoidl axis labels
that corresponds to each of the tags above. If not the
same length as TAGS, it will use the structure's latex
property, but that doesn't always look pretty in
textoidl. Empty strings will use the the structure's
latex property.
PSNAME - A string specifying the name of the postscript file to
output. If not specified, the plots are made to the
screen.
LEGENDTXT - A string array corresponding to each save file that
specifies the legend txt. Default is the filenames.
NSAMPLE - A scalar that specifies how many (random) samples to
take from each parameter. Default uses all. Useful for
memory management if plotting data from many large files
POSITION - A 2-element array specifying the normalized X and Y
coordinates of the top left corner of the legend
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/comparestars_corner.pro)</STRONG><P>
<HR>
<A NAME="COMPARESTARS_CORNER[2]">
<H2>COMPARESTARS_CORNER[2]</H2></A>
<A HREF="#COMPARESTARS_CORNER[1]">[Previous Routine]</A>
<A HREF="#CONVERT_TRANSIT_TIMES">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
COMPARESTARS_CORNER
PURPOSE:
Creates a corner plot of several different fits overlaid on top
of each other using the IDL save files as output by exofastv2.pro.
CALLING SEQUENCE:
comparestars, 'savpath' [,TAGS=,LATEXNAMES=,LEGENDTXT=,PSNAME=]
INPUTS:
SAVPATH - A string resolved by file_search or an array of
filenames specifying the names of all the idl save
files to compare.
NOTE: All of these will be loaded into memory at once,
and multiple large save files may crash
TAGS - A string array specifying the tagnames (parameters) to
compare. Default is
['mstar','rstar','rhostar','logg','teff','feh','initfeh','age','lstar','eep']
LATEXNAMES - A string array specifying the textoidl axis labels
that corresponds to each of the tags above. If not the
same length as TAGS, it will use the structure's latex
property, but that doesn't always look pretty in
textoidl. Empty strings will use the the structure's
latex property.
PSNAME - A string specifying the name of the postscript file to
output. If not specified, the plots are made to the
screen.
LEGENDTXT - A string array corresponding to each save file that
specifies the legend txt. Default is the filenames.
NSAMPLE - A scalar that specifies how many (random) samples to
take from each parameter. Default is all. Useful for
memory management if the input has many large files
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/comparestars_corner2.pro)</STRONG><P>
<HR>
<A NAME="CONVERT_TRANSIT_TIMES">
<H2>CONVERT_TRANSIT_TIMES</H2></A>
<A HREF="#COMPARESTARS_CORNER[2]">[Previous Routine]</A>
<A HREF="#CROSSREF">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
KEYWORDS:
By default, the code will convert from time of inferior
conjunction to time of minimum projected separation. The
following keywords can change the inputs and outputs.
TS_IN - Time of superior conjunction is the input time, time of
minimum projected separation at secondary eclipse is the
output
TE_IN - Time of minimum projected separation at secondary eclipse
is the input, time of superior conjunction is the output.
TT_IN - Time of minimum rojected separation at primary eclipse
is the input, time of inferior conjunction is the output.
Given one time, eccentricity, inclination, omega, and period, we
will return all other times:
TC - Time of inferior conjunction, commonly reported as the
transit time
TT - Time of minimum projected separation. This is the
intuitive definition of the transit time.
TS - Time of superior conjunction, commonly reported as the
secondary ecclipse time
TE - The time of minimum projected separation during secondary
eclipse.
TP - Time of periastron
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/convert_transit_times.pro)</STRONG><P>
<HR>
<A NAME="CROSSREF">
<H2>CROSSREF</H2></A>
<A HREF="#CONVERT_TRANSIT_TIMES">[Previous Routine]</A>
<A HREF="#ELLKE">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
CROSSREF
PURPOSE:
Finds the closest match to refra and refdec from an array of RAs
and Decs.
Modification
2018-04-12: Jason Eastman, CfA
Renamed, documented, and cleaned up for distribution with EXOFASTv2
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/mksed.pro)</STRONG><P>
<HR>
<A NAME="ELLKE">
<H2>ELLKE</H2></A>
<A HREF="#CROSSREF">[Previous Routine]</A>
<A HREF="#ELLPIC_BULIRSCH">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
ELLKE
PURPOSE:
Computes Hasting's polynomial approximation for the complete
elliptic integral of the first (ek) and second (kk) kind. Combines
the calculation of both so as not to duplicate the expensive
calculation of alog10(1-k^2).
CALLING SEQUENCE:
ellke, k, ek, kk
INPUTS:
k - The elliptic modulus.
OUTPUTS:
ek - The elliptic integral of the first kind
kk - The elliptic integral of the second kind
MODIFICATION HISTORY
2009/04/06 -- Written by Jason Eastman (Ohio State University)
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/ellke.pro)</STRONG><P>
<HR>
<A NAME="ELLPIC_BULIRSCH">
<H2>ELLPIC_BULIRSCH</H2></A>
<A HREF="#ELLKE">[Previous Routine]</A>
<A HREF="#EXOFAST">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
ELLPIC_BULIRSCH
PURPOSE:
Computes the complete elliptical integral of the third kind using
the algorithm of Bulirsch (1965):
Bulirsch 1965, Numerische Mathematik, 7, 78
Bulirsch 1965, Numerische Mathematik, 7, 353
CALLING SEQUENCE:
result = ellpic_bulirsch(n, k)
INPUTS:
n,k - int(dtheta/((1-n*sin(theta)^2)*sqrt(1-k^2*sin(theta)^2)),0, pi/2)
RESULT:
The complete elliptical integral of the third kind
MODIFICATION HISTORY
2009/03 -- Written by Eric Agol
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/ellpic_bulirsch.pro)</STRONG><P>
<HR>
<A NAME="EXOFAST">
<H2>EXOFAST</H2></A>
<A HREF="#ELLPIC_BULIRSCH">[Previous Routine]</A>
<A HREF="#EXOFASTV2">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
EXOFAST
PURPOSE:
Creates a stellar system structure that describes an arbitrary
number of planets, observed bands, rv telescopes (a new zero point
for each), and observed transits. This structure is the input to
basically everything in EXOFASTv2 and is designed to be easily
extensible. To add a new derived parameter to the output table, add it here,
then calculate it in DERIVEPARS. To add a new fitted parameter, add
it here, then use it in EXOFAST_CHI2V2 to influence the model or
the likelihood/chi^2 directly.
Priors may be applied to any parameter (fitted or derived).
CALLING SEQUENCE:
ss = mkss(nplanets=nplanets, circular=circular, $
fitslope=fitslope, fitquad=fitquad, ttvs=ttvs, tdvs=tdvs, $
rossiter=rossiter, fitdt=fitdt, eprior4=eprior4, fittran=fittran, fitrv=fitrv, $
nvalues=nvalues, debug=debug, priorfile=priorfile, $
rvpath=rvpath, tranpath=tranpath, longcadence=longcadence, earth=earth)
INPUTS:
NPLANETS - The number of planets to fit
CIRCULAR - An NPLANETS boolean array describing which
planets should be fixed to have circular orbits. If not
specified, all planets will be fit with eccentric models.
FITTRAN - An NPLANETS boolean array specifying which planets
should be fit with a transit model. By default, all
planets are fit with transit photometry.
FITRV - An NPLANETS boolean array specifying which planets
should be fit with a radial velocity model. By default, all
planets are fit with radial velocities.
CHEN - An NPLANETS boolean array specifying which planets
should have the Chen & Kipping, 2017 mass-radius
relation applied. By default CHEN = FITRV xor
FITTRAN. That is, only apply the mass-radius prior when
RV is not fit (to derive the planet mass) or when a
transit is not fit (to derive the radius). If the
defaults have been overridden and FITRV and CHEN are
both false for a given planet, the RV semi-amplitude
(planet mass) and all derived parameters will not be
quoted. Multi-planet systems will be constrained not to
cross orbits, but the Hill Sphere will be set to zero.
If FITTRAN and CHEN are both false for a given planet,
the planetary radius and all derived parameters will not
be quoted.
I180 - An NPLANETS boolean array specifying which planets'
inclination should be allowed to be between 0 and 180
instead of the default of 0 to 90. Note that a normal
transiting planet has a perfect degeneracy between i and
180-i which is likely to cause convergence
problems. Additional information (e.g., from astrometry
or mutual eclipses) must be used for this keyword to be
used properly. Even in the case of mutual eclipses
(which is currently not supported), at least one planet must be
arbitrarily constrained from 0 to 90.
ROSSITER - An NPLANETS boolean array specify which planets to fit a
rossiter model to the RV data. Fit lambda and
V_rot*sin(I_*) from RV data during transit using the
Ohta approximations (has known issues)
FITDT - An NPLANETS boolean array specifying which planets to
fit a Doppler tomography model to the RV data
(*** Currently unsupported***)
THERMAL - A string array specifying which bands to fit thermal
emission for. This is what you want to set to fit an
isolated secondary eclipse. All observations in this
band will be modeled with a baseline of 1 between t2 and
t3 of the secondary eclipse and 1 + thermal emission (in
PPM) out of eclipse.
REFLECT - A string array specifying which bands to fit reflected
light for. Set this along with thermal if you're
fitting a full phase curve. It will be modeled as a
sinusoid with the orbital period, a minimum at the
primary transit, and a fitted amplitude (in PPM).
DILUTE - A string array specifying which bands to fit a dilution
term for. Set this if the star is blended with a
neighbor and you expect color-dependent depth
variations.
Note: May be degenerate with F0 (transit normalization)
Note: this only affects the transit model. It is not
accounted for in the SED fitting.
TODO: automatically model dilution based on multiple
SEDs
NVALUES - By default, parameter.value is a scalar. Set this
to make it an array of length NVALUES.
PRIORFILE - The name of the file that specifies all the priors. The
prior file is an ASCII file with each line containing
three white space delimited columns: NAME, VALUE,
WIDTH. NAME must match a parameter.label. If in an
array (e.g., of planets), add "_i", where "i" is the
zero-indexed index into the array. If WIDTH is set to
0, the parameter is fixed at VALUE (this is generally
not recommended; it's far better to apply a realistic
prior). If WIDTH is set to -1, the fit starts at VALUE,
but there is no penalty if the model deviates from
VALUE. If WIDTH is positive, a gaussian prior is
applied. That is, a chi^2 penalty equal to ((parameter
- VALUE)/WIDTH)^2 is applied to the likelihood
function. Here is the contents of a sample priorfile
for the EPXXXXXXXXX system published in Eastman et al,
2017:
teff 6167 78 # Gaussian prior on T_eff of 6167 +/- 78 K
feh -0.04 0.1 # Gaussian prior on [Fe/H] of -0.04 +/- 0.1 dex
logg 4.22 0.06 # Gaussian prior on logg of 4.22 +/- 0.06
vsini 9400 300 # Gaussian prior on vsini of 9400 +/- 300 (ignored since vsini is not fitted)
av 0.15 0.30 # Gaussian prior on A_V (extinction) of 0.15 +/- 0.30
ma 11.529 0.142 # Gaussian prior on ma (apparent V mag) of 11.529 +/- 0.142
distance 247.87 57.223 # Gaussian prior on distance of 247.87 +/- 57.223 pc
tc_0 2457166.0543 -1 # start the fit with a TC for planet 0 (EPXXXXXXXXb) at BJD_TDB=2457166.0543
p_0 0.020 -1 # start the fit with Rp/Rstar for planet 0 at 0.020
period_0 26.847 -1 # start the fit with period for planet 0 at 26.847 days
tc_1 2457213.5328 -1 # start the fit with a TC for planet 1 (EPXXXXXXXXc) at BJD_TDB=2457213.5328
p_1 0.02 -1 # start the fit with Rp/Rstar for planet 1 at 0.020
period_1 39.5419 -1 # start the fit with period for planet 0 at 39.5419 days
tc_2 2457191.8894 -1 # start the fit with a TC for planet 2 (EPXXXXXXXXd) at BJD_TDB=2457191.8894
p_2 0.020 -1 # start the fit with Rp/Rstar for planet 2 at 0.020
period_2 125 -1 # start the fit with period for planet 2 at 125 days
tc_3 2457170.4990 -1 # start the fit with a TC for planet 3 (EPXXXXXXXXe) at BJD_TDB=2457170.4990
p_3 0.029 -1 # start the fit with Rp/Rstar for planet 3 at 0.020
period_3 160 -1 # start the fit with period for planet 3 at 160 days
RVPATH - The path of the RV files. Each RV files is fit with a
separate zero point.
TRANPATH - The path of the transit data. Each file is fit with a
separate normalization. If TTVS is set, each file is fit
with a diff
KEYWORDS:
FITSLOPE - Fit a linear trend to the RV data
FITQUAD - Fit a quadratic trend to the RV data
TTVS - Fit an independent (non-periodic) transit time for each transit
TDVS - Fit an indepdedent depth to each transit
EPRIOR4 - Parameterize the eccentricity and argument of
periastron as e^(1/4)*sin(omega) and
e^(1/4)*cos(omega) to more closely match the observed
eccentricity distribution
DEBUG - Output various debugging information and plots at each
step.
PARAMETER STRUCTURE
parameter.value -- the parameter's numerical value in
parameter.unit units. For the MCMC, this is an
array for all links.
parameter.prior -- the parameter's prior
</PRE><P>
<STRONG>(See /h/onion0/scratch/EXOFASTv2/mkss.pro)</STRONG><P>
<HR>
<A NAME="EXOFASTV2">
<H2>EXOFASTV2</H2></A>
<A HREF="#EXOFAST">[Previous Routine]</A>
<A HREF="#EXOFAST_AMOEBA">[Next Routine]</A>
<A HREF="#ROUTINELIST">[List of Routines]</A>
<PRE>
NAME:
EXOFASTv2
PURPOSE:
Simultaneously fits RV and/or transit data for multiple
planets, transits, RV sources. Please cite Eastman et al., 2019
(https://arxiv.org/abs/1907.09480) if you make
use of this routine in your research. Please report errors or bugs
to jason.eastman@cfa.harvard.edu
CALLING SEQUENCE:
exofastv2, [RVPATH=, TRANPATH=, PRIORFILE=, FLUXFILE=, PREFIX=, /CIRCULAR,
/NOSLOPE, /SECONDARY, /UPDATE, PNAME=, SIGCLIP=, NTHIN=,
MAXSTEPS=, MINPERIOD=, MAXPERIOD=, NMIN=, /DISPLAY,
/DEBUG, RANDOMFUNC=, SEED=, /SPECPRIORS, /BESTONLY,
NINTERP=, EXPTIME=, /LONGCADENCE]
INPUTS:
PRIORFILE - An ASCII file with each line containing three white
space delimited columns. See
$EXOFAST_PATH/parnames.README for a detailed
explanation of this file and $EXOFAST_PATH/examples/
for templates to use.
OPTIONAL INPUTS:
NPLANETS - The number of planets you wish to fit to the
data. Default is 1. If 0 is set, it will just fit
the star.
RVPATH - A string specifying the path to the RV data
file(s). Wildcards are allowed for multiple files
(e.g., '*.rv'). Each file must have at least 3
columns:
1) Time (BJD_TDB -- See Eastman et al., 2010)
2) RV (m/s)
3) err (m/s)
The names of the files describing the RVs
*should* adhere to a certain format:
planet_name.telescope.whateveryouwant.
The telescope is used for labeling the figures and
tables.
NOTE 1: The units must be as specified, or the fit
will be wrong or fail.
NOTE 2: Other input time stamps will likely not
break the code, but can introduce errors in the
reported times of more than a minute. The output
table will display BJD_TDB but makes no attempt to
convert input times. See
http://adsabs.harvard.edu/abs/2010PASP..122..935E
for an explanation of times
NOTE 3: If RVPATH is omitted, no RV model will be
generated.
TRANPATH - A string specifying the path to the transit data
file(s). Wildcards are allowed for multiple files
(e.g., '*.dat'). Each file must have at least 3
columns:
1) Time (BJD_TDB -- See Eastman et al., 2010)
2) Normalized flux
3) err
4) Detrend parameter 1
....
N+3) Detrend parameter N
An optional header specifies which parameters
should be multiplicatively detrended and which
should be additively detrended. Without a header,
all detrending parameters are additively detrended.
The first character in the header line must be
"#". It must have whitespace delimited columns
corresponding to the data. Each multiplicative
detrending variable is preceeded with "M" (case
sensitive). For example, the header line
#BJD_TDB FLUX ERR MAIRMASS SKY myval
Will fit a multiplicative detrending to the 4th
column (MAIRMASS) and an additive detrending to the
5th and 6th columns (SKY and myval).
The corresponding model will be:
model = (transit + C0*SKY + C1*myval)*(F0 + M0*MAIRMASS)
Where C0, C1, and M0 are fitted detrending
parameters, F0 is the normalization, and SKY,
motion, and MAIRMASS are vectors for each data point
to detrend against.
The names of the files describing the transits
*must* adhere to a certain format:
nYYYYMMDD.filtername.telescope.whateveryouwant.
nYYYYMMDD -- The UTC date of mid transit, where YYYY is
the year, MM is the month, and DD is the day. This
is only necessary if the data has a single
transit. This is used to label the transits in the
output plot.
filtername -- The name of the observed
filter. Only certain values are allowed (use the
closest approximation if yours is not in this list;
see quadld.pro):
Johnson/Cousins: 'U','B','V','R','I','J','H','K'
Sloan: 'Sloanu','Sloang','Sloanr','Sloani','Sloanz'
Kepler: 'Kepler'
CoRoT: 'CoRoT'
TESS: 'TESS'
Spitzer: 'Spit36','Spit45','Spit58','Spit80'
Stromgren: 'u','b','v','y'
This is used to define the limb darkening for the
transit, dilution, and secondary depth parameters.
telescope -- a description of the telescope used for
the observations. Anything is allowed, but all
observations observed with the same telescope should
have the same name. This is used in the output plot
and color codes the TTV plot.
whateveryouwant -- any string you want to
include for it to make sense to you. This is not
used by the code.
So a transit taken on UTC 2017-01-27 with MINERVA in
the V band would be "n20170127.V.MINERVA.dat"
NOTE 2: The units must be as specified, or the fit
will be wrong or fail.
NOTE 3: Other input time stamps will likely not
break the code, but can introduce errors in the
reported times of more than a minute. The output
table will display BJD_TDB but makes no attempt to
convert input times. See
http://adsabs.harvard.edu/abs/2010PASP..122..935E
for an explanation of times
NOTE 4: If omitted, just the RV data will bit fit
*** Astrometry is not currently suppported or thoroughly tested. Future updates are likely to change the expected formats ***
ASTROMPATH - A string specifying the path to the astrometry data
file(s). Wildcards are allowed for multiple files
(e.g., '*.dat'). Each file must have 5 or 8
columns:
1) Time (BJD_TDB -- See Eastman et al., 2010)
2) RA (ICRS deg)
3) DEC (ICRS deg)
4) ra uncertainty (mas)
5) dec uncertainty (mas)
6) X position of observatory (AU from Solar System Barycenter)
7) Y position of observatory (AU from Solar System Barycenter)
8) Z position of observatory (AU from Solar System Barycenter)
The filename must adhere to a certain format:
epoch.location.whateveryouwant
epoch -- the reference epoch of the
observations in BJD_TDB (e.g., J2000 is
2451545).
location -- the location of the observatory. Only
"Earth" (geocenter), "Gaia" and "Hipparcos" are
understood, in which case the observatory position
(columns 6-8) will be calculated if not supplied.
whateveryouwant -- any string you want to include
for it to make sense to you. This is not used by the
code.
If supplied, EXOFASTv2 will fit the following
additional parameters: RA, Dec, PMRA, PMDEC, and
parallax, plus Omega for each planet. The
inclination will span the range from 0 to 180 (-1 <
cosi < 1).
DTPATH - The (optional) path to the Doppler Tomography fits
file(s). If supplied, the code will fit a vsini and
macro turbulence of the star, as well as a
spin-orbit alignment for each planet. This must be
used in conjunction with the FITDT, an NPLANETS
array specifying which planets should have their DT
signal modeled.
Each fits file is a 2D array describing all DT
observations during a single transit with extensions
describing the axes of the array. The pixel values
of the 2D array contain the fractional flux
decrement at a given BJD_TDB (spectrum) and velocity
(pixel value of the CCF). The first extension should
specify the BJD_TDB corresponding to each Y pixel
and the second extension should specify the velocity
corresponding to each X pixel.
Such a file can be generated given the 2D array of
fractional flux decrements (DT), a time array