@@ -509,16 +509,24 @@ for the difference in :math:`v_Y` as a function of unperturbed :math:`X`:
509
509
510
510
.. _streamspray-tutorial :
511
511
512
- Particle-spray modeling of streams with ``streamspraydf ``
513
- ---------------------------------------------------------
514
-
515
- ``galpy `` also contains an implementation of the particle-spray method
516
- for generating tidal streams, roughly following the parametrization of
517
- `Fardal et al. (2015)
512
+ Particle-spray modeling of streams
513
+ ----------------------------------
514
+
515
+ ``galpy `` also contains implementations of two particle-spray methods
516
+ for generating tidal streams. ``chen24spraydf `` follows the method by
517
+ `Chen et al. (2024)
518
+ <https://ui.adsabs.harvard.edu/abs/2024arXiv240801496C/abstract> `__.
519
+ ``fardal15spraydf `` roughly follows the
520
+ parametrization of `Fardal et al. (2015)
518
521
<https://ui.adsabs.harvard.edu/abs/2015MNRAS.452..301F/abstract> `__. Full
519
522
details on the ``galpy `` implementation are given in `Qian et al. (2022)
520
523
<https://ui.adsabs.harvard.edu/abs/2022MNRAS.511.2339Q/abstract> `__. Here,
521
- we give a simple example of the method.
524
+ we give a simple example of the the two methods.
525
+
526
+ .. note ::
527
+ ``fardal15spraydf `` was previously known as ``streamspraydf `` before
528
+ version ``v1.10.1 ``. While the old name is still supported until ``v.1.11.0 ``
529
+ for backward compatibility, we recommend using the new name ``fardal15spraydf ``.
522
530
523
531
Like in the ``streamdf `` example above, we use the same orbit, potential, and
524
532
cluster mass as in
@@ -531,24 +539,31 @@ as a simple ``LogarithmicHaloPotential``):
531
539
>>> o= Orbit([1.56148083 ,0.35081535 ,- 1.15481504 ,0.88719443 ,- 0.47713334 ,0.12019596 ])
532
540
>>> lp= LogarithmicHaloPotential(normalize = 1 .,q = 0.9 )
533
541
534
- Then, we setup ``streamspraydf `` models for the leading and trailing arm of
535
- the stream:
542
+ Then, we setup ``chen24spraydf `` and ``fardal15spraydf `` models for the leading
543
+ and trailing arm of the stream. The ``chen24spraydf `` model requires integrating
544
+ the orbits of stream stars with the progenitor's potential. Here, we use a
545
+ Plummer potential for the prognenitor:
536
546
537
547
>>> from astropy import units
538
- >>> from galpy.df import streamspraydf
539
- >>> spdf= streamspraydf(2 * 10 .** 4 .* units.Msun,progenitor = o,pot = lp,tdisrupt = 4.5 * units.Gyr)
540
- >>> spdft= streamspraydf(2 * 10 .** 4 .* units.Msun,progenitor = o,pot = lp,leading = False ,tdisrupt = 4.5 * units.Gyr)
548
+ >>> from galpy.df import chen24spraydf, fardal15spraydf
549
+ >>> progpot = PlummerPotential(2 * 10 .** 4 .* units.Msun, 4 .* units.pc)
550
+ >>> spdf_c24= chen24spraydf(2 * 10 .** 4 .* units.Msun,progenitor = o,pot = lp,tdisrupt = 4.5 * units.Gyr, progpot = progpot)
551
+ >>> spdft_c24= chen24spraydf(2 * 10 .** 4 .* units.Msun,progenitor = o,pot = lp,leading = False ,tdisrupt = 4.5 * units.Gyr, progpot = progpot)
552
+ >>> spdf_f15= fardal15spraydf(2 * 10 .** 4 .* units.Msun,progenitor = o,pot = lp,tdisrupt = 4.5 * units.Gyr)
553
+ >>> spdft_f15= fardal15spraydf(2 * 10 .** 4 .* units.Msun,progenitor = o,pot = lp,leading = False ,tdisrupt = 4.5 * units.Gyr)
541
554
542
- To sample a set of 300 stars in both arms, we do
555
+ First, we sample a set of 300 stars in both arms:
543
556
544
- >>> orbs,dt= spdf.sample(n = 300 ,returndt = True ,integrate = True )
545
- >>> orbts,dt= spdft.sample(n = 300 ,returndt = True ,integrate = True )
557
+ >>> orbs_c24,dt_c24= spdf_c24.sample(n = 300 ,returndt = True ,integrate = True )
558
+ >>> orbts_c24,dt_c24= spdft_c24.sample(n = 300 ,returndt = True ,integrate = True )
559
+ >>> orbs_f15,dt= spdf_f15.sample(n = 300 ,returndt = True ,integrate = True )
560
+ >>> orbts_f15,dt= spdft_f15.sample(n = 300 ,returndt = True ,integrate = True )
546
561
547
562
which returns a ``galpy.orbit.Orbit `` instance with all 300 stars. We can plot
548
- these in :math: `Z` versus :math: `X` and compare to Fig. 1 in
549
- Bovy (2014). First, we also integrate the orbit of the progenitor forward
550
- and backward in time for a brief period to show its location in the area
551
- of the stream:
563
+ the `` galpy.orbit.Orbit `` instance in :math: `Z` versus :math: `X`
564
+ and compare to Fig. 1 in Bovy (2014). First, we also integrate the orbit of the
565
+ progenitor forward and backward in time for a brief period to show its location
566
+ in the area of the stream:
552
567
553
568
>>> ts= numpy.linspace(0 .,3 .,301 )
554
569
>>> o.integrate(ts,lp)
@@ -559,19 +574,21 @@ Then we plot
559
574
560
575
>>> o.plot(d1 = ' x' ,d2 = ' z' ,color = ' k' ,xrange = [0 .,2 .],yrange = [- 0.1 ,1.45 ])
561
576
>>> of.plot(d1 = ' x' ,d2 = ' z' ,overplot = True ,color = ' k' )
562
- >>> plot(orbs.x(),orbs.z(),' r.' )
563
- >>> plot(orbts.x(),orbts.z(),' b.' )
577
+ >>> plot(orbs_c24.x(),orbs_c24.z(),' r.' , alpha = 0.5 )
578
+ >>> plot(orbts_c24.x(),orbts_c24.z(),' r.' , alpha = 0.5 )
579
+ >>> plot(orbs_f15.x(),orbs_f15.z(),' b.' , alpha = 0.5 )
580
+ >>> plot(orbts_f15.x(),orbts_f15.z(),' b.' , alpha = 0.5 )
564
581
565
582
which gives
566
583
567
- .. image :: images/streamspraydf -b14-xz.png
584
+ .. image :: images/chen24spraydf-fardal15spraydf -b14-xz.png
568
585
:width: 600
569
586
570
587
We can also compare to the track for this stream as predicted by ``streamdf ``.
571
588
For this, we first setup a similar ``streamdf `` model (they are not exactly
572
589
the same, as ``streamdf `` uses a velocity dispersion to set the progenitor's
573
- mass, while ``streamspraydf `` uses the mass directly); see the `` streamdf ``
574
- documentation for a full explanation of this code:
590
+ mass, while ``fardal15spraydf `` and `` chen15spraydf `` uses the mass directly);
591
+ see the `` streamdf `` documentation for a full explanation of this code:
575
592
576
593
>>> from galpy.actionAngle import actionAngleIsochroneApprox
577
594
>>> from galpy.df import streamdf
@@ -586,23 +603,23 @@ Then, we can overplot the track predicted by ``streamdf``:
586
603
587
604
>>> o.plot(d1 = ' x' ,d2 = ' z' ,color = ' k' ,xrange = [0 .,2 .],yrange = [- 0.1 ,1.45 ])
588
605
>>> of.plot(d1 = ' x' ,d2 = ' z' ,overplot = True ,color = ' k' )
589
- >>> plot(orbs .x(),orbs .z(),' r.' ,alpha = 0.1 )
590
- >>> plot(orbts .x(),orbts .z(),' b .' ,alpha = 0.1 )
606
+ >>> plot(orbs_c24 .x(),orbs_c24 .z(),' r.' ,alpha = 0.1 )
607
+ >>> plot(orbts_c24 .x(),orbts_c24 .z(),' r .' ,alpha = 0.1 )
591
608
>>> sdf.plotTrack(d1 = ' x' ,d2 = ' z' ,interp = True ,color = ' r' ,overplot = True ,lw = 1 .)
592
609
>>> sdft.plotTrack(d1 = ' x' ,d2 = ' z' ,interp = True ,color = ' b' ,overplot = True ,lw = 1 .)
593
610
594
611
This gives then
595
612
596
- .. image :: images/streamspraydf -b14-xz-wstreamdf.png
613
+ .. image :: images/chen24spraydf -b14-xz-wstreamdf.png
597
614
:width: 600
598
615
599
616
We see that the track from ``streamdf `` agrees very well with the location
600
- of the points sampled from ``streamspraydf ``.
617
+ of the points sampled from ``chen24spraydf ``.
601
618
602
- The ``streamspraydf `` `` sample `` function can also return the points at
619
+ The ``sample `` function can also return the points at
603
620
the time of stripping, that is, not integrated to the present time
604
621
(when using ``integrate=False ``); this can be useful for visualizing where
605
- stars get stripped from the progenitor. When initializing `` streamspraydf `` ,
622
+ stars get stripped from the progenitor. When initializing a particle-spray DF ,
606
623
you can also specify a different potential for computing the tidal radius
607
624
and velocity distribution of the tidal debris, which can be useful when the
608
625
overall potential contains pieces that are irrelevant for computing the tidal
0 commit comments