{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/specutils/issues/256","repository_url":"https://api.github.com/repos/astropy/specutils","labels_url":"https://api.github.com/repos/astropy/specutils/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/astropy/specutils/issues/256/comments","events_url":"https://api.github.com/repos/astropy/specutils/issues/256/events","html_url":"https://github.com/astropy/specutils/issues/256","id":343747287,"node_id":"MDU6SXNzdWUzNDM3NDcyODc=","number":256,"title":"Template matching: you have n models (which may be spectra themselves), and want to know which is the best","user":{"login":"SaOgaz","id":5287848,"node_id":"MDQ6VXNlcjUyODc4NDg=","avatar_url":"https://avatars1.githubusercontent.com/u/5287848?v=4","gravatar_id":"","url":"https://api.github.com/users/SaOgaz","html_url":"https://github.com/SaOgaz","followers_url":"https://api.github.com/users/SaOgaz/followers","following_url":"https://api.github.com/users/SaOgaz/following{/other_user}","gists_url":"https://api.github.com/users/SaOgaz/gists{/gist_id}","starred_url":"https://api.github.com/users/SaOgaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaOgaz/subscriptions","organizations_url":"https://api.github.com/users/SaOgaz/orgs","repos_url":"https://api.github.com/users/SaOgaz/repos","events_url":"https://api.github.com/users/SaOgaz/events{/privacy}","received_events_url":"https://api.github.com/users/SaOgaz/received_events","type":"User","site_admin":false},"labels":[{"id":1443696584,"node_id":"MDU6TGFiZWwxNDQzNjk2NTg0","url":"https://api.github.com/repos/astropy/specutils/labels/sflag","name":"sflag","color":"c8bef7","default":false}],"state":"open","locked":false,"assignee":{"login":"javerbukh","id":7179333,"node_id":"MDQ6VXNlcjcxNzkzMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/7179333?v=4","gravatar_id":"","url":"https://api.github.com/users/javerbukh","html_url":"https://github.com/javerbukh","followers_url":"https://api.github.com/users/javerbukh/followers","following_url":"https://api.github.com/users/javerbukh/following{/other_user}","gists_url":"https://api.github.com/users/javerbukh/gists{/gist_id}","starred_url":"https://api.github.com/users/javerbukh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javerbukh/subscriptions","organizations_url":"https://api.github.com/users/javerbukh/orgs","repos_url":"https://api.github.com/users/javerbukh/repos","events_url":"https://api.github.com/users/javerbukh/events{/privacy}","received_events_url":"https://api.github.com/users/javerbukh/received_events","type":"User","site_admin":false},"assignees":[{"login":"javerbukh","id":7179333,"node_id":"MDQ6VXNlcjcxNzkzMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/7179333?v=4","gravatar_id":"","url":"https://api.github.com/users/javerbukh","html_url":"https://github.com/javerbukh","followers_url":"https://api.github.com/users/javerbukh/followers","following_url":"https://api.github.com/users/javerbukh/following{/other_user}","gists_url":"https://api.github.com/users/javerbukh/gists{/gist_id}","starred_url":"https://api.github.com/users/javerbukh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javerbukh/subscriptions","organizations_url":"https://api.github.com/users/javerbukh/orgs","repos_url":"https://api.github.com/users/javerbukh/repos","events_url":"https://api.github.com/users/javerbukh/events{/privacy}","received_events_url":"https://api.github.com/users/javerbukh/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-07-23T18:36:45Z","updated_at":"2019-07-17T22:47:17Z","closed_at":null,"author_association":"COLLABORATOR","body":"original card posted by @eteq"},"comment":{"url":"https://api.github.com/repos/astropy/specutils/issues/comments/512596418","html_url":"https://github.com/astropy/specutils/issues/256#issuecomment-512596418","issue_url":"https://api.github.com/repos/astropy/specutils/issues/256","id":512596418,"node_id":"MDEyOklzc3VlQ29tbWVudDUxMjU5NjQxOA==","user":{"login":"camipacifici","id":19998720,"node_id":"MDQ6VXNlcjE5OTk4NzIw","avatar_url":"https://avatars3.githubusercontent.com/u/19998720?v=4","gravatar_id":"","url":"https://api.github.com/users/camipacifici","html_url":"https://github.com/camipacifici","followers_url":"https://api.github.com/users/camipacifici/followers","following_url":"https://api.github.com/users/camipacifici/following{/other_user}","gists_url":"https://api.github.com/users/camipacifici/gists{/gist_id}","starred_url":"https://api.github.com/users/camipacifici/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camipacifici/subscriptions","organizations_url":"https://api.github.com/users/camipacifici/orgs","repos_url":"https://api.github.com/users/camipacifici/repos","events_url":"https://api.github.com/users/camipacifici/events{/privacy}","received_events_url":"https://api.github.com/users/camipacifici/received_events","type":"User","site_admin":false},"created_at":"2019-07-17T22:47:17Z","updated_at":"2019-07-17T22:47:17Z","author_association":"COLLABORATOR","body":"Indeed calling that term \"weight\" is confusing, apologies. Normalization is the correct term and the equation should read:\r\nchi^2 = sum { [(observation-normalization*model)/uncertainty]**2 }.\r\n\r\nThe normalization is necessary to bring the model to the same magnitude as the observation and minimize the chi^2. A practical science case: I want to fit the spectrum of a galaxy of magnitude H=20; in my spectral library the models are all normalized to different magnitudes; if I do not renormalize the models, the smallest chi^2 will be given by the model closest in normalization but not necessarily in features, while I want the model that is closest in features to my observation. The function should then return the minimum-chi^2 model multiplied by the appropriate normalization.\r\n\r\nThe normalization is:\r\nnormalization = sum{(observation*model)/(uncertainty**2)} / sum{(model/uncertainty)**2}.\r\n\r\nAll sums run on the spectral points."}}
{"actor":{"display_login":"camipacifici"}}