{
  "id": 361562,
  "title": "PyFstat Signal Parameters",
  "url": "/competitions/g2net-detecting-continuous-gravitational-waves/discussion/361562",
  "author_name": "Mark Wijkhuizen",
  "post_date": "2022-10-22T10:28:24.026000",
  "votes": 31,
  "comment_count": 10,
  "views": 0,
  "content": "<p>When generating training data using PyFstat there are many parameters to be tuned and the data section of this competition also states there are 8 randomised parameters.<br>\nThe PyFstat documentation is however not very helpful at explaining the parameters, giving explanations like:</p>\n<ul>\n<li><code>Parameters at which to compute the statistic.</code></li>\n<li><code>Additional frequency evolution and amplitude parameters for a signal.</code></li>\n</ul>\n<p>The <a href=\"https://github.com/PyFstat/PyFstat/blob/master/examples/tutorials/1_generating_signals.ipynb\" target=\"_blank\">signal generating tutorial</a> does elaborate on some of these parameters, however it is still not fully clear what reasonable value ranges would be.</p>\n<p>Could someone explain (in simple terms) how the following parameters affect the signal and what the valid/reasonable range of values would be?</p>\n<p>1) phi<br>\n2) psi<br>\n3) cosi<br>\n4) F0<br>\n5) F1<br>\n6) F2<br>\n7) Band<br>\n8) Alpha<br>\n9) Delta<br>\n10) tp<br>\n11) h0<br>\n12) asini<br>\n13) period </p>",
  "messages": [
    {
      "id": 1999419,
      "postDate": "2022-10-22T10:28:24.027Z",
      "content": "<p>When generating training data using PyFstat there are many parameters to be tuned and the data section of this competition also states there are 8 randomised parameters.<br>\nThe PyFstat documentation is however not very helpful at explaining the parameters, giving explanations like:</p>\n<ul>\n<li><code>Parameters at which to compute the statistic.</code></li>\n<li><code>Additional frequency evolution and amplitude parameters for a signal.</code></li>\n</ul>\n<p>The <a href=\"https://github.com/PyFstat/PyFstat/blob/master/examples/tutorials/1_generating_signals.ipynb\" target=\"_blank\">signal generating tutorial</a> does elaborate on some of these parameters, however it is still not fully clear what reasonable value ranges would be.</p>\n<p>Could someone explain (in simple terms) how the following parameters affect the signal and what the valid/reasonable range of values would be?</p>\n<p>1) phi<br>\n2) psi<br>\n3) cosi<br>\n4) F0<br>\n5) F1<br>\n6) F2<br>\n7) Band<br>\n8) Alpha<br>\n9) Delta<br>\n10) tp<br>\n11) h0<br>\n12) asini<br>\n13) period </p>",
      "rawMarkdown": "When generating training data using PyFstat there are many parameters to be tuned and the data section of this competition also states there are 8 randomised parameters.\nThe PyFstat documentation is however not very helpful at explaining the parameters, giving explanations like:\n\n* `Parameters at which to compute the statistic.`\n* `Additional frequency evolution and amplitude parameters for a signal.`\n\nThe [signal generating tutorial](https://github.com/PyFstat/PyFstat/blob/master/examples/tutorials/1_generating_signals.ipynb) does elaborate on some of these parameters, however it is still not fully clear what reasonable value ranges would be.\n\nCould someone explain (in simple terms) how the following parameters affect the signal and what the valid/reasonable range of values would be?\n\n1) phi\n2) psi\n3) cosi\n4) F0\n5) F1\n6) F2\n7) Band\n8) Alpha\n9) Delta\n10) tp\n11) h0\n12) asini\n13) period ",
      "votes": 30
    },
    {
      "id": 2000275,
      "postDate": "2022-10-23T07:20:34.477Z",
      "content": "<p>As explained in the tutorials, you can use a helper function to inject some parameters based on priors:<br>\n<code>{**pyfstat.injection_parameters.isotropic_amplitude_priors}</code><br>\n<code>{'cosi': {'uniform': {'low': -1.0, 'high': 1.0}},\n 'psi': {'uniform': {'low': -0.7853981633974483, 'high': 0.7853981633974483}},\n 'phi': {'uniform': {'low': 0, 'high': 6.283185307179586}}}</code></p>\n<p>This already answer part of your question. Those are the valid ranges for <code>cosi</code>, <code>psi</code> and <code>phi</code>, which are expected to be isotropically distributed (uniform distribution, no preference for any particular value). </p>\n<ul>\n<li><strong>cosi</strong>: Cosine of the angle between the source and us. Range: [-1, 1]</li>\n<li><strong>psi</strong> and <strong>phi</strong>: polarization angle and phase. Ranges: [-pi/2, pi/2] and [0, 2*pi]</li>\n<li><strong>Alpha</strong>: Right ascension of the source's position on the sky. Range: [0, 2*pi]</li>\n<li><strong>Delta</strong>: Declination of the source's position on the sky. Range: [-pi/2, pi/2]</li>\n<li><strong>Band</strong>: This is just the width of the frequency \"slice\" to be taken. It's <code>0.2 hz</code> for all files in the train and test datasets, which translates to 360 \"frequency lines\".</li>\n<li><strong>F0</strong>: This may be tricky. The generated noise will be centered around this frequency. If a signal is created, it will be also a signal with this frequency (at the source; when it arrives to the detector, doppler and other effects will shift the frequency), so it will appear more or less on the center of the data. Range used on the datasets: [50, 400] Hz.</li>\n<li><strong>F1</strong>: This is technically the first derivative of the frequency (how it changs over time). Physically, the sources (neutron stars) lose energy over time because they emit the GWs, so this should be a negative number. A reasonable range could be [-1e-9, 0] Hz but that's up to us.</li>\n<li><strong>F2</strong>: This is guess it's the second derivative, which maybe is <code>0</code> for the purposes of this competition.</li>\n<li><strong>h0</strong>: The amplitude of the signal. In the tutorials, the approach is to define it as a ratio of the <code>sqrtSX</code>. What makes the competition (and the real-world problem of finding continuous GWs) is that expected <code>h0</code> will be between 1 and 2 orders of magnitude smaller than the amplitude of the noise. In my opinion, part of the challenge is to create your own signals with a distribution of <code>h0</code> similar to the one used for the test set.</li>\n</ul>\n<p>Regarding other parameters you mentioned like <code>yp, asini, period</code>I think they are used as an alternative way of specifying the pyhsical parameters of the souce and you can ignore them:</p>\n<blockquote>\n  <p>Depending on the emission mechanism, h0 can be further described using further physical quantities such as the source's frequency, ellipticity, or distance to the detector.</p>\n</blockquote>",
      "rawMarkdown": "As explained in the tutorials, you can use a helper function to inject some parameters based on priors:\n`{**pyfstat.injection_parameters.isotropic_amplitude_priors}`\n`{'cosi': {'uniform': {'low': -1.0, 'high': 1.0}},\n 'psi': {'uniform': {'low': -0.7853981633974483, 'high': 0.7853981633974483}},\n 'phi': {'uniform': {'low': 0, 'high': 6.283185307179586}}}`\n\nThis already answer part of your question. Those are the valid ranges for `cosi`, `psi` and `phi`, which are expected to be isotropically distributed (uniform distribution, no preference for any particular value). \n\n- **cosi**: Cosine of the angle between the source and us. Range: [-1, 1]\n- **psi** and **phi**: polarization angle and phase. Ranges: [-pi/2, pi/2] and [0, 2*pi]\n- **Alpha**: Right ascension of the source's position on the sky. Range: [0, 2*pi]\n- **Delta**: Declination of the source's position on the sky. Range: [-pi/2, pi/2]\n- **Band**: This is just the width of the frequency \"slice\" to be taken. It's `0.2 hz` for all files in the train and test datasets, which translates to 360 \"frequency lines\".\n- **F0**: This may be tricky. The generated noise will be centered around this frequency. If a signal is created, it will be also a signal with this frequency (at the source; when it arrives to the detector, doppler and other effects will shift the frequency), so it will appear more or less on the center of the data. Range used on the datasets: [50, 400] Hz.\n- **F1**: This is technically the first derivative of the frequency (how it changs over time). Physically, the sources (neutron stars) lose energy over time because they emit the GWs, so this should be a negative number. A reasonable range could be [-1e-9, 0] Hz but that's up to us.\n- **F2**: This is guess it's the second derivative, which maybe is `0` for the purposes of this competition.\n- **h0**: The amplitude of the signal. In the tutorials, the approach is to define it as a ratio of the `sqrtSX`. What makes the competition (and the real-world problem of finding continuous GWs) is that expected `h0` will be between 1 and 2 orders of magnitude smaller than the amplitude of the noise. In my opinion, part of the challenge is to create your own signals with a distribution of `h0` similar to the one used for the test set.\n\nRegarding other parameters you mentioned like `yp, asini, period `I think they are used as an alternative way of specifying the pyhsical parameters of the souce and you can ignore them:\n> Depending on the emission mechanism, h0 can be further described using further physical quantities such as the source's frequency, ellipticity, or distance to the detector.\n\n",
      "votes": 27,
      "replies": [
        {
          "id": 2002131,
          "postDate": "2022-10-24T14:30:05.977Z",
          "content": "<p>Hi, Victor<br>\n\"Range used on the datasets: [50, 400] Hz.\" <br>\nThe range goes up to 500 Hz</p>",
          "rawMarkdown": "Hi, Victor\n\"Range used on the datasets: [50, 400] Hz.\" \nThe range goes up to 500 Hz",
          "votes": 1
        },
        {
          "id": 2002261,
          "postDate": "2022-10-24T16:40:48.667Z",
          "content": "<p>You are right! I was writing that from memory.</p>",
          "rawMarkdown": "You are right! I was writing that from memory."
        }
      ]
    },
    {
      "id": 2001689,
      "postDate": "2022-10-24T08:40:32.673Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/markwijkhuizen\" target=\"_blank\">@markwijkhuizen</a> ,</p>\n<p>Looks like <a href=\"https://www.kaggle.com/darkbitur\" target=\"_blank\">@darkbitur</a> did a good job giving an explanation, 👍.</p>\n<p>If I just may add the following:</p>\n<ul>\n<li><code>psi</code> is actually defined within [-pi /4 , pi / 4] (and it's periodic, so anything beyond that folds back onto this range).</li>\n<li><code>F2</code> is another term describing the intrinsic evolution of a gravitational wave. As <a href=\"https://www.kaggle.com/darkbitur\" target=\"_blank\">@darkbitur</a> correctly guesses, it's set to 0 in this competition as we only focus on frequency and spindown.</li>\n<li><code>tp, asini, period</code> are parameters used to describe neutron stars in binary systems, and they affect the <em>frequency</em> evolution of the signal. You can safely ignore those in this competition (but do feel free to play around with them if you wish to!).</li>\n</ul>\n<blockquote>\n  <p>Depending on the emission mechanism, h0 can be further described using further physical quantities such as the source's frequency, ellipticity, or distance to the detector.</p>\n</blockquote>\n<p>As for this, we normally don't worry about the physics at search time: We can safely encapsulate all that information on <code>h0</code>, as that would be what our detectors would basically measure (gory details: the signal is actually amplitude modulated depending on <code>psi</code> and <code>Alpha, Delta</code>, and then <code>cosi</code> acts as an overall scaling on top). Once the search is done and we get an upper bound of <code>h0</code> we work out the physical consequences of that (e.g. how far away could we have seen a star with a given ellipticity, how much ellipticity can nearby NS sustain…). </p>",
      "rawMarkdown": "Hi @markwijkhuizen ,\n\nLooks like @darkbitur did a good job giving an explanation, :+1:.\n\nIf I just may add the following:\n\n- `psi` is actually defined within [-pi /4 , pi / 4] (and it's periodic, so anything beyond that folds back onto this range).\n- `F2` is another term describing the intrinsic evolution of a gravitational wave. As @darkbitur correctly guesses, it's set to 0 in this competition as we only focus on frequency and spindown.\n- `tp, asini, period` are parameters used to describe neutron stars in binary systems, and they affect the *frequency* evolution of the signal. You can safely ignore those in this competition (but do feel free to play around with them if you wish to!).\n\n> Depending on the emission mechanism, h0 can be further described using further physical quantities such as the source's frequency, ellipticity, or distance to the detector.\n\nAs for this, we normally don't worry about the physics at search time: We can safely encapsulate all that information on `h0`, as that would be what our detectors would basically measure (gory details: the signal is actually amplitude modulated depending on `psi` and `Alpha, Delta`, and then `cosi` acts as an overall scaling on top). Once the search is done and we get an upper bound of `h0` we work out the physical consequences of that (e.g. how far away could we have seen a star with a given ellipticity, how much ellipticity can nearby NS sustain...). \n",
      "votes": 8,
      "replies": [
        {
          "id": 2016633,
          "postDate": "2022-11-04T06:48:41.437Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/rodrigotenorio\" target=\"_blank\">@rodrigotenorio</a> , Thank you for the great competition. I have questions about the <code>F1</code> parameters. <br>\n<code>F1: This is technically the first derivative of the frequency (how it changes over time). Physically, the sources (neutron stars) lose energy over time because they emit the GWs, so this should be a negative number. A reasonable range could be [-1e-9, 0] Hz but that's up to us.</code><br>\nAnd you also mentioned that it should be negative in your topics.</p>\n<p>However, it will raise an error when the <code>F1</code> is set to any negative value. So should we set it as positive value in this competition? Or it's something that can't tell competitors.(If so, please also tell me)</p>\n<hr>\n<p>The error is<br>\n<code>CalledProcessError: Command 'lalapps_Makefakedata_v5 --outSingleSFT=TRUE --outSFTdir=\".\" --outLabel=\"custom_band_signal\" --noiseSFTs=\"./H-5760_H1_1800SFT_custom_band_noise-1238166018-10368000.sft;./L-5760_L1_1800SFT_custom_band_noise-1238166018-10368000.sft\" --SFTWindowType=\"tukey\" --SFTWindowBeta=0.001 --startTime=1238166018 --duration=10368000 --Tsft=1800 --injectionSources=\"./custom_band_signal.cff\" --ephemEarth=\"earth00-40-DE405.dat.gz\" --ephemSun=\"sun00-40-DE405.dat.gz\"' returned non-zero exit status 255.</code></p>\n<p>----------------------------------------Edited--------------------------------------<br>\nMy bad🤕. It isn't about positive/negetive. It's about the <code>abs</code> of <code>F1</code>. No matter F1 positive or negative, it's <code>abs</code> should be no larger than <code>1e-8</code>. <br>\nStill, I would be very grateful if you can tell me whether the <code>F1</code> used in this competition is positive, or negative, or both. 🙏</p>",
          "rawMarkdown": "Hi @rodrigotenorio , Thank you for the great competition. I have questions about the `F1` parameters. \n`F1: This is technically the first derivative of the frequency (how it changes over time). Physically, the sources (neutron stars) lose energy over time because they emit the GWs, so this should be a negative number. A reasonable range could be [-1e-9, 0] Hz but that's up to us.`\nAnd you also mentioned that it should be negative in your topics.\n\nHowever, it will raise an error when the `F1` is set to any negative value. So should we set it as positive value in this competition? Or it's something that can't tell competitors.(If so, please also tell me)\n\n-----------------------------------------------------------------------------------\nThe error is\n`CalledProcessError: Command 'lalapps_Makefakedata_v5 --outSingleSFT=TRUE --outSFTdir=\".\" --outLabel=\"custom_band_signal\" --noiseSFTs=\"./H-5760_H1_1800SFT_custom_band_noise-1238166018-10368000.sft;./L-5760_L1_1800SFT_custom_band_noise-1238166018-10368000.sft\" --SFTWindowType=\"tukey\" --SFTWindowBeta=0.001 --startTime=1238166018 --duration=10368000 --Tsft=1800 --injectionSources=\"./custom_band_signal.cff\" --ephemEarth=\"earth00-40-DE405.dat.gz\" --ephemSun=\"sun00-40-DE405.dat.gz\"' returned non-zero exit status 255.`\n\n----------------------------------------Edited--------------------------------------\nMy bad🤕. It isn't about positive/negetive. It's about the `abs` of `F1`. No matter F1 positive or negative, it's `abs` should be no larger than `1e-8`. \nStill, I would be very grateful if you can tell me whether the `F1` used in this competition is positive, or negative, or both. 🙏\n",
          "votes": 1
        },
        {
          "id": 2016766,
          "postDate": "2022-11-04T08:42:29.450Z",
          "content": "<p>I got exactly the same error. Somewhere in examples <code>F1</code> was set to <code>10**stats.uniform(-12, 4)</code>, so it could be significantly larger, than <code>1e-8</code>, which produces the error code 255.</p>\n<p>On the other hand, we have the records with the duration of approximately <code>1e7</code> seconds. The half band is <code>0.1Hz</code>. So, to make an estimation, let's consider a linear frequency modulated signal starting with some <code>F0</code> in the center of the band and having frequency derivative of <code>F1</code>. It can be easily seen, that the condition of <code>|F1|&lt;1e-8</code> is equivalent to that the signal is fully located inside the selected frequency band.</p>",
          "rawMarkdown": "I got exactly the same error. Somewhere in examples `F1` was set to `10**stats.uniform(-12, 4)`, so it could be significantly larger, than `1e-8`, which produces the error code 255.\n\nOn the other hand, we have the records with the duration of approximately `1e7` seconds. The half band is `0.1Hz`. So, to make an estimation, let's consider a linear frequency modulated signal starting with some `F0` in the center of the band and having frequency derivative of `F1`. It can be easily seen, that the condition of `|F1|<1e-8` is equivalent to that the signal is fully located inside the selected frequency band.",
          "votes": 1
        },
        {
          "id": 2016893,
          "postDate": "2022-11-04T10:36:55.193Z",
          "content": "<p>10**stats.uniform(-12, 4) - the API for stats is different from np.uniform. In this case it samples from -12 to -8</p>",
          "rawMarkdown": "10**stats.uniform(-12, 4) - the API for stats is different from np.uniform. In this case it samples from -12 to -8",
          "votes": 2
        },
        {
          "id": 2016903,
          "postDate": "2022-11-04T10:44:19.600Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/forcewithme\" target=\"_blank\">@forcewithme</a> , <a href=\"https://www.kaggle.com/kdmitrie\" target=\"_blank\">@kdmitrie</a> ,</p>\n<p>First, note that the error you pasted is incomplete: Your error is likely happening at LALSuite level (i.e. while <code>Writer</code> calls a command-line process) and hence will be printed to STDOUT. You should have gotten a few printed lines saying <code>XLAL_ERROR</code> or similar.</p>\n<blockquote>\n  <p>Somewhere in examples F1 was set to 10**stats.uniform(-12, 4), so it could be significantly larger, than 1e-8</p>\n</blockquote>\n<p>Note that <code>stats.uniform(-12, 4)</code> generates random numbers in [-12, -8] (i.e. scipy's uniform notation is <em>different</em> than numpy's). EDIT: Looks like I overlapped with <a href=\"https://www.kaggle.com/sakvaua\" target=\"_blank\">@sakvaua</a> </p>\n<p>As <a href=\"https://www.kaggle.com/kdmitrie\" target=\"_blank\">@kdmitrie</a> points out, if you get spindown values with too much of an absolute value your signal is probably going to drift out of the 0.2Hz frequency band.</p>\n<blockquote>\n  <p>Still, I would be very grateful if you can tell me whether the F1 used in this competition is positive, or negative, or both. 🙏</p>\n</blockquote>\n<p>Both signs of <code>F1</code> are relevant from the point of view of continuous wave searches :).</p>",
          "rawMarkdown": "Hi @forcewithme , @kdmitrie ,\n\nFirst, note that the error you pasted is incomplete: Your error is likely happening at LALSuite level (i.e. while `Writer` calls a command-line process) and hence will be printed to STDOUT. You should have gotten a few printed lines saying `XLAL_ERROR` or similar.\n\n>  Somewhere in examples F1 was set to 10**stats.uniform(-12, 4), so it could be significantly larger, than 1e-8\n\nNote that `stats.uniform(-12, 4)` generates random numbers in [-12, -8] (i.e. scipy's uniform notation is *different* than numpy's). EDIT: Looks like I overlapped with @sakvaua \n\nAs @kdmitrie points out, if you get spindown values with too much of an absolute value your signal is probably going to drift out of the 0.2Hz frequency band.\n\n>  Still, I would be very grateful if you can tell me whether the F1 used in this competition is positive, or negative, or both. 🙏\n\nBoth signs of `F1` are relevant from the point of view of continuous wave searches :).",
          "votes": 3
        },
        {
          "id": 2016935,
          "postDate": "2022-11-04T11:20:21.927Z",
          "content": "<p>Thank you so much! 👍</p>",
          "rawMarkdown": "Thank you so much! 👍"
        },
        {
          "id": 2016938,
          "postDate": "2022-11-04T11:24:35.313Z",
          "content": "<p>Yeah <a href=\"https://www.kaggle.com/sakvaua\" target=\"_blank\">@sakvaua</a> , <br>\nI agree<code>10**stats.uniform(-12, 4) - the API for stats is different from np.uniform. In this case is samples from -12 to -8</code> .</p>\n<p>But I guess <code>10**stats.uniform(-12, 4)</code> may be the right choice. Since I think we do need to sample <code>F1</code> continuously, rather than chossing from 1e-12 to 1e-8 discretely.</p>",
          "rawMarkdown": "Yeah @sakvaua , \nI agree`10**stats.uniform(-12, 4) - the API for stats is different from np.uniform. In this case is samples from -12 to -8` .\n\nBut I guess `10**stats.uniform(-12, 4)` may be the right choice. Since I think we do need to sample `F1` continuously, rather than chossing from 1e-12 to 1e-8 discretely."
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2000275,
      "author_name": "Victor Gonzalez",
      "author_url": "",
      "post_date": "2022-10-23T07:20:34.477000",
      "content": "<p>As explained in the tutorials, you can use a helper function to inject some parameters based on priors:<br>\n<code>{**pyfstat.injection_parameters.isotropic_amplitude_priors}</code><br>\n<code>{'cosi': {'uniform': {'low': -1.0, 'high': 1.0}},\n 'psi': {'uniform': {'low': -0.7853981633974483, 'high': 0.7853981633974483}},\n 'phi': {'uniform': {'low': 0, 'high': 6.283185307179586}}}</code></p>\n<p>This already answer part of your question. Those are the valid ranges for <code>cosi</code>, <code>psi</code> and <code>phi</code>, which are expected to be isotropically distributed (uniform distribution, no preference for any particular value). </p>\n<ul>\n<li><strong>cosi</strong>: Cosine of the angle between the source and us. Range: [-1, 1]</li>\n<li><strong>psi</strong> and <strong>phi</strong>: polarization angle and phase. Ranges: [-pi/2, pi/2] and [0, 2*pi]</li>\n<li><strong>Alpha</strong>: Right ascension of the source's position on the sky. Range: [0, 2*pi]</li>\n<li><strong>Delta</strong>: Declination of the source's position on the sky. Range: [-pi/2, pi/2]</li>\n<li><strong>Band</strong>: This is just the width of the frequency \"slice\" to be taken. It's <code>0.2 hz</code> for all files in the train and test datasets, which translates to 360 \"frequency lines\".</li>\n<li><strong>F0</strong>: This may be tricky. The generated noise will be centered around this frequency. If a signal is created, it will be also a signal with this frequency (at the source; when it arrives to the detector, doppler and other effects will shift the frequency), so it will appear more or less on the center of the data. Range used on the datasets: [50, 400] Hz.</li>\n<li><strong>F1</strong>: This is technically the first derivative of the frequency (how it changs over time). Physically, the sources (neutron stars) lose energy over time because they emit the GWs, so this should be a negative number. A reasonable range could be [-1e-9, 0] Hz but that's up to us.</li>\n<li><strong>F2</strong>: This is guess it's the second derivative, which maybe is <code>0</code> for the purposes of this competition.</li>\n<li><strong>h0</strong>: The amplitude of the signal. In the tutorials, the approach is to define it as a ratio of the <code>sqrtSX</code>. What makes the competition (and the real-world problem of finding continuous GWs) is that expected <code>h0</code> will be between 1 and 2 orders of magnitude smaller than the amplitude of the noise. In my opinion, part of the challenge is to create your own signals with a distribution of <code>h0</code> similar to the one used for the test set.</li>\n</ul>\n<p>Regarding other parameters you mentioned like <code>yp, asini, period</code>I think they are used as an alternative way of specifying the pyhsical parameters of the souce and you can ignore them:</p>\n<blockquote>\n  <p>Depending on the emission mechanism, h0 can be further described using further physical quantities such as the source's frequency, ellipticity, or distance to the detector.</p>\n</blockquote>",
      "votes": 27,
      "replies": [
        {
          "id": 2002131,
          "author_name": "DennisSakva",
          "author_url": "",
          "post_date": "2022-10-24T14:30:05.977000",
          "content": "<p>Hi, Victor<br>\n\"Range used on the datasets: [50, 400] Hz.\" <br>\nThe range goes up to 500 Hz</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2002261,
          "author_name": "Victor Gonzalez",
          "author_url": "",
          "post_date": "2022-10-24T16:40:48.667000",
          "content": "<p>You are right! I was writing that from memory.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2001689,
      "author_name": "Rodrigo Tenorio",
      "author_url": "",
      "post_date": "2022-10-24T08:40:32.673000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/markwijkhuizen\" target=\"_blank\">@markwijkhuizen</a> ,</p>\n<p>Looks like <a href=\"https://www.kaggle.com/darkbitur\" target=\"_blank\">@darkbitur</a> did a good job giving an explanation, 👍.</p>\n<p>If I just may add the following:</p>\n<ul>\n<li><code>psi</code> is actually defined within [-pi /4 , pi / 4] (and it's periodic, so anything beyond that folds back onto this range).</li>\n<li><code>F2</code> is another term describing the intrinsic evolution of a gravitational wave. As <a href=\"https://www.kaggle.com/darkbitur\" target=\"_blank\">@darkbitur</a> correctly guesses, it's set to 0 in this competition as we only focus on frequency and spindown.</li>\n<li><code>tp, asini, period</code> are parameters used to describe neutron stars in binary systems, and they affect the <em>frequency</em> evolution of the signal. You can safely ignore those in this competition (but do feel free to play around with them if you wish to!).</li>\n</ul>\n<blockquote>\n  <p>Depending on the emission mechanism, h0 can be further described using further physical quantities such as the source's frequency, ellipticity, or distance to the detector.</p>\n</blockquote>\n<p>As for this, we normally don't worry about the physics at search time: We can safely encapsulate all that information on <code>h0</code>, as that would be what our detectors would basically measure (gory details: the signal is actually amplitude modulated depending on <code>psi</code> and <code>Alpha, Delta</code>, and then <code>cosi</code> acts as an overall scaling on top). Once the search is done and we get an upper bound of <code>h0</code> we work out the physical consequences of that (e.g. how far away could we have seen a star with a given ellipticity, how much ellipticity can nearby NS sustain…). </p>",
      "votes": 8,
      "replies": [
        {
          "id": 2016633,
          "author_name": "ForcewithMe",
          "author_url": "",
          "post_date": "2022-11-04T06:48:41.437000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/rodrigotenorio\" target=\"_blank\">@rodrigotenorio</a> , Thank you for the great competition. I have questions about the <code>F1</code> parameters. <br>\n<code>F1: This is technically the first derivative of the frequency (how it changes over time). Physically, the sources (neutron stars) lose energy over time because they emit the GWs, so this should be a negative number. A reasonable range could be [-1e-9, 0] Hz but that's up to us.</code><br>\nAnd you also mentioned that it should be negative in your topics.</p>\n<p>However, it will raise an error when the <code>F1</code> is set to any negative value. So should we set it as positive value in this competition? Or it's something that can't tell competitors.(If so, please also tell me)</p>\n<hr>\n<p>The error is<br>\n<code>CalledProcessError: Command 'lalapps_Makefakedata_v5 --outSingleSFT=TRUE --outSFTdir=\".\" --outLabel=\"custom_band_signal\" --noiseSFTs=\"./H-5760_H1_1800SFT_custom_band_noise-1238166018-10368000.sft;./L-5760_L1_1800SFT_custom_band_noise-1238166018-10368000.sft\" --SFTWindowType=\"tukey\" --SFTWindowBeta=0.001 --startTime=1238166018 --duration=10368000 --Tsft=1800 --injectionSources=\"./custom_band_signal.cff\" --ephemEarth=\"earth00-40-DE405.dat.gz\" --ephemSun=\"sun00-40-DE405.dat.gz\"' returned non-zero exit status 255.</code></p>\n<p>----------------------------------------Edited--------------------------------------<br>\nMy bad🤕. It isn't about positive/negetive. It's about the <code>abs</code> of <code>F1</code>. No matter F1 positive or negative, it's <code>abs</code> should be no larger than <code>1e-8</code>. <br>\nStill, I would be very grateful if you can tell me whether the <code>F1</code> used in this competition is positive, or negative, or both. 🙏</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2016766,
          "author_name": "Konstantin Dmitriev",
          "author_url": "",
          "post_date": "2022-11-04T08:42:29.450000",
          "content": "<p>I got exactly the same error. Somewhere in examples <code>F1</code> was set to <code>10**stats.uniform(-12, 4)</code>, so it could be significantly larger, than <code>1e-8</code>, which produces the error code 255.</p>\n<p>On the other hand, we have the records with the duration of approximately <code>1e7</code> seconds. The half band is <code>0.1Hz</code>. So, to make an estimation, let's consider a linear frequency modulated signal starting with some <code>F0</code> in the center of the band and having frequency derivative of <code>F1</code>. It can be easily seen, that the condition of <code>|F1|&lt;1e-8</code> is equivalent to that the signal is fully located inside the selected frequency band.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2016893,
          "author_name": "DennisSakva",
          "author_url": "",
          "post_date": "2022-11-04T10:36:55.193000",
          "content": "<p>10**stats.uniform(-12, 4) - the API for stats is different from np.uniform. In this case it samples from -12 to -8</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 2016903,
          "author_name": "Rodrigo Tenorio",
          "author_url": "",
          "post_date": "2022-11-04T10:44:19.600000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/forcewithme\" target=\"_blank\">@forcewithme</a> , <a href=\"https://www.kaggle.com/kdmitrie\" target=\"_blank\">@kdmitrie</a> ,</p>\n<p>First, note that the error you pasted is incomplete: Your error is likely happening at LALSuite level (i.e. while <code>Writer</code> calls a command-line process) and hence will be printed to STDOUT. You should have gotten a few printed lines saying <code>XLAL_ERROR</code> or similar.</p>\n<blockquote>\n  <p>Somewhere in examples F1 was set to 10**stats.uniform(-12, 4), so it could be significantly larger, than 1e-8</p>\n</blockquote>\n<p>Note that <code>stats.uniform(-12, 4)</code> generates random numbers in [-12, -8] (i.e. scipy's uniform notation is <em>different</em> than numpy's). EDIT: Looks like I overlapped with <a href=\"https://www.kaggle.com/sakvaua\" target=\"_blank\">@sakvaua</a> </p>\n<p>As <a href=\"https://www.kaggle.com/kdmitrie\" target=\"_blank\">@kdmitrie</a> points out, if you get spindown values with too much of an absolute value your signal is probably going to drift out of the 0.2Hz frequency band.</p>\n<blockquote>\n  <p>Still, I would be very grateful if you can tell me whether the F1 used in this competition is positive, or negative, or both. 🙏</p>\n</blockquote>\n<p>Both signs of <code>F1</code> are relevant from the point of view of continuous wave searches :).</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 2016935,
          "author_name": "ForcewithMe",
          "author_url": "",
          "post_date": "2022-11-04T11:20:21.927000",
          "content": "<p>Thank you so much! 👍</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2016938,
          "author_name": "ForcewithMe",
          "author_url": "",
          "post_date": "2022-11-04T11:24:35.313000",
          "content": "<p>Yeah <a href=\"https://www.kaggle.com/sakvaua\" target=\"_blank\">@sakvaua</a> , <br>\nI agree<code>10**stats.uniform(-12, 4) - the API for stats is different from np.uniform. In this case is samples from -12 to -8</code> .</p>\n<p>But I guess <code>10**stats.uniform(-12, 4)</code> may be the right choice. Since I think we do need to sample <code>F1</code> continuously, rather than chossing from 1e-12 to 1e-8 discretely.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1999419": "When generating training data using PyFstat there are many parameters to be tuned and the data section of this competition also states there are 8 randomised parameters.\nThe PyFstat documentation is however not very helpful at explaining the parameters, giving explanations like:\n\n* `Parameters at which to compute the statistic.`\n* `Additional frequency evolution and amplitude parameters for a signal.`\n\nThe [signal generating tutorial](https://github.com/PyFstat/PyFstat/blob/master/examples/tutorials/1_generating_signals.ipynb) does elaborate on some of these parameters, however it is still not fully clear what reasonable value ranges would be.\n\nCould someone explain (in simple terms) how the following parameters affect the signal and what the valid/reasonable range of values would be?\n\n1) phi\n2) psi\n3) cosi\n4) F0\n5) F1\n6) F2\n7) Band\n8) Alpha\n9) Delta\n10) tp\n11) h0\n12) asini\n13) period ",
    "2000275": "As explained in the tutorials, you can use a helper function to inject some parameters based on priors:\n`{**pyfstat.injection_parameters.isotropic_amplitude_priors}`\n`{'cosi': {'uniform': {'low': -1.0, 'high': 1.0}},\n 'psi': {'uniform': {'low': -0.7853981633974483, 'high': 0.7853981633974483}},\n 'phi': {'uniform': {'low': 0, 'high': 6.283185307179586}}}`\n\nThis already answer part of your question. Those are the valid ranges for `cosi`, `psi` and `phi`, which are expected to be isotropically distributed (uniform distribution, no preference for any particular value). \n\n- **cosi**: Cosine of the angle between the source and us. Range: [-1, 1]\n- **psi** and **phi**: polarization angle and phase. Ranges: [-pi/2, pi/2] and [0, 2*pi]\n- **Alpha**: Right ascension of the source's position on the sky. Range: [0, 2*pi]\n- **Delta**: Declination of the source's position on the sky. Range: [-pi/2, pi/2]\n- **Band**: This is just the width of the frequency \"slice\" to be taken. It's `0.2 hz` for all files in the train and test datasets, which translates to 360 \"frequency lines\".\n- **F0**: This may be tricky. The generated noise will be centered around this frequency. If a signal is created, it will be also a signal with this frequency (at the source; when it arrives to the detector, doppler and other effects will shift the frequency), so it will appear more or less on the center of the data. Range used on the datasets: [50, 400] Hz.\n- **F1**: This is technically the first derivative of the frequency (how it changs over time). Physically, the sources (neutron stars) lose energy over time because they emit the GWs, so this should be a negative number. A reasonable range could be [-1e-9, 0] Hz but that's up to us.\n- **F2**: This is guess it's the second derivative, which maybe is `0` for the purposes of this competition.\n- **h0**: The amplitude of the signal. In the tutorials, the approach is to define it as a ratio of the `sqrtSX`. What makes the competition (and the real-world problem of finding continuous GWs) is that expected `h0` will be between 1 and 2 orders of magnitude smaller than the amplitude of the noise. In my opinion, part of the challenge is to create your own signals with a distribution of `h0` similar to the one used for the test set.\n\nRegarding other parameters you mentioned like `yp, asini, period `I think they are used as an alternative way of specifying the pyhsical parameters of the souce and you can ignore them:\n> Depending on the emission mechanism, h0 can be further described using further physical quantities such as the source's frequency, ellipticity, or distance to the detector.\n\n",
    "2001689": "Hi @markwijkhuizen ,\n\nLooks like @darkbitur did a good job giving an explanation, :+1:.\n\nIf I just may add the following:\n\n- `psi` is actually defined within [-pi /4 , pi / 4] (and it's periodic, so anything beyond that folds back onto this range).\n- `F2` is another term describing the intrinsic evolution of a gravitational wave. As @darkbitur correctly guesses, it's set to 0 in this competition as we only focus on frequency and spindown.\n- `tp, asini, period` are parameters used to describe neutron stars in binary systems, and they affect the *frequency* evolution of the signal. You can safely ignore those in this competition (but do feel free to play around with them if you wish to!).\n\n> Depending on the emission mechanism, h0 can be further described using further physical quantities such as the source's frequency, ellipticity, or distance to the detector.\n\nAs for this, we normally don't worry about the physics at search time: We can safely encapsulate all that information on `h0`, as that would be what our detectors would basically measure (gory details: the signal is actually amplitude modulated depending on `psi` and `Alpha, Delta`, and then `cosi` acts as an overall scaling on top). Once the search is done and we get an upper bound of `h0` we work out the physical consequences of that (e.g. how far away could we have seen a star with a given ellipticity, how much ellipticity can nearby NS sustain...). \n"
  }
}