{"action":"created","issue":{"url":"https://api.github.com/repos/asteca/asteca/issues/206","labels_url":"https://api.github.com/repos/asteca/asteca/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/asteca/asteca/issues/206/comments","events_url":"https://api.github.com/repos/asteca/asteca/issues/206/events","html_url":"https://github.com/asteca/asteca/issues/206","id":77724727,"number":206,"title":"Binning methods in best fit function leaves out regions of synth clusters","user":{"login":"Gabriel-p","id":6054951,"avatar_url":"https://avatars.githubusercontent.com/u/6054951?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel-p","html_url":"https://github.com/Gabriel-p","followers_url":"https://api.github.com/users/Gabriel-p/followers","following_url":"https://api.github.com/users/Gabriel-p/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel-p/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel-p/subscriptions","organizations_url":"https://api.github.com/users/Gabriel-p/orgs","repos_url":"https://api.github.com/users/Gabriel-p/repos","events_url":"https://api.github.com/users/Gabriel-p/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel-p/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/asteca/asteca/labels/best-fit","name":"best-fit","color":"fef2c0"},{"url":"https://api.github.com/repos/asteca/asteca/labels/bug","name":"bug","color":"eb6420"},{"url":"https://api.github.com/repos/asteca/asteca/labels/p:high","name":"p:high","color":"e11d21"}],"state":"closed","locked":false,"assignee":{"login":"Gabriel-p","id":6054951,"avatar_url":"https://avatars.githubusercontent.com/u/6054951?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel-p","html_url":"https://github.com/Gabriel-p","followers_url":"https://api.github.com/users/Gabriel-p/followers","following_url":"https://api.github.com/users/Gabriel-p/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel-p/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel-p/subscriptions","organizations_url":"https://api.github.com/users/Gabriel-p/orgs","repos_url":"https://api.github.com/users/Gabriel-p/repos","events_url":"https://api.github.com/users/Gabriel-p/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel-p/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/asteca/asteca/milestones/10","html_url":"https://github.com/asteca/asteca/milestones/v0.2.0","labels_url":"https://api.github.com/repos/asteca/asteca/milestones/10/labels","id":1110651,"number":10,"title":"v0.2.0","description":"Major upgrade. The code now should be able to handle any number of observed magnitudes/colors in any of the photometric systems supported by the CMD service.","creator":{"login":"Gabriel-p","id":6054951,"avatar_url":"https://avatars.githubusercontent.com/u/6054951?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel-p","html_url":"https://github.com/Gabriel-p","followers_url":"https://api.github.com/users/Gabriel-p/followers","following_url":"https://api.github.com/users/Gabriel-p/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel-p/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel-p/subscriptions","organizations_url":"https://api.github.com/users/Gabriel-p/orgs","repos_url":"https://api.github.com/users/Gabriel-p/repos","events_url":"https://api.github.com/users/Gabriel-p/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel-p/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":1,"state":"open","created_at":"2015-05-14T18:13:11Z","updated_at":"2015-05-19T20:21:49Z","due_on":"2015-07-31T03:00:00Z","closed_at":null},"comments":1,"created_at":"2015-05-18T16:49:47Z","updated_at":"2015-05-19T20:21:49Z","closed_at":"2015-05-19T20:21:49Z","body":"When the `dolphin` function is used to obtain the best-fit between the observed cluster and a synthetic one, a binning method must be selected.\r\n\r\nThese methods generate a grid for the CMD based on the *observed cluster* and apply the same grid on each synthetic cluster (SC) generated. \r\n\r\nThis means that stars in the SC located beyond the edges of this grid, **will not be considered when the likelihood is calculated**. See image below for a visual description of this issue:\r\n\r\n![figure_1](https://cloud.githubusercontent.com/assets/6054951/7685379/3e7ab526-fd64-11e4-8084-deb8de5e35a8.png)\r\n\r\nAs can be seen, the grid leaves out an important number of bright stars in the SC (the same can happen for dim stars). This can lead to nonsensical best-fit results like the one below:\r\n\r\n![captura de pantalla de 2015-05-18 13 47 21](https://cloud.githubusercontent.com/assets/6054951/7685409/7779d244-fd64-11e4-8b99-cfe34169dbd1.png)\r\n\r\nwhere the result is clearly due to stars in the SC above 17 mag and below 20 mag, not being considered in the likelihood obtention."},"comment":{"url":"https://api.github.com/repos/asteca/asteca/issues/comments/103658133","html_url":"https://github.com/asteca/asteca/issues/206#issuecomment-103658133","issue_url":"https://api.github.com/repos/asteca/asteca/issues/206","id":103658133,"user":{"login":"Gabriel-p","id":6054951,"avatar_url":"https://avatars.githubusercontent.com/u/6054951?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel-p","html_url":"https://github.com/Gabriel-p","followers_url":"https://api.github.com/users/Gabriel-p/followers","following_url":"https://api.github.com/users/Gabriel-p/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel-p/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel-p/subscriptions","organizations_url":"https://api.github.com/users/Gabriel-p/orgs","repos_url":"https://api.github.com/users/Gabriel-p/repos","events_url":"https://api.github.com/users/Gabriel-p/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel-p/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T20:21:49Z","updated_at":"2015-05-19T20:21:49Z","body":"**The above is not correct.**\r\n\r\n1- Those stars in the SC that are located outside of the grid defined using the observed cluster, are in fact considered by the likelihood equation of Dolphin (2002). This equation can be written as:\r\n\r\n    -2 ln(PLR) = 2M - 2 * \\sum [n_i * ln(m_i)]\r\n\r\n(disregarding terms that depend on the observed cluster exclusively) where `PLR` is the *Poisson Likelihood Ratio*, `M` is the total number of stars in the SC, and `n_i, m_i` are the number of stars in bin `i` of the observed and synthetic cluster respectively.\r\n\r\nAs can be seen, if `n_i=0` then the value of `m_i` **does not matter** because the bin will contribute nothing to the sum. Since the condition `n_i=0` will be met for *every bin defined outside of the boundaries of the observed cluster*, obtaining the `m_i` values is irrelevant and unnecessary. I.e. there is no need to extend the grid beyond the observed cluster's limits.\r\n\r\nThose stars in the SC that are located outside of the grid defined for the observed cluster, will affect the likelihood solely through the `2M` term.\r\n\r\n2- The fit shown in the second image is not nonsensical. It responds to the fact that the observed cluster (LMC-SL579) presents no MS beyond `T_1=20` and no RC stars, which makes old clusters a not so suitable match.\r\n\r\nSee image below were the cluster region (right) is compared to the field region (left) for this cluster:\r\n\r\n![captura de pantalla de 2015-05-19 15 54 31](https://cloud.githubusercontent.com/assets/6054951/7711219/75b5b8d4-fe3f-11e4-91f6-3530d4fd68ac.png)\r\n\r\nAs can be seen, for the cluster region both the MS and the red giants branch are missing. Increasing the radius used by ~20-30 px results in some MS stars appearing in the cluster's CMD sequence."}}