{"action":"created","issue":{"url":"https://api.github.com/repos/josephhardinee/PyDisdrometer/issues/31","repository_url":"https://api.github.com/repos/josephhardinee/PyDisdrometer","labels_url":"https://api.github.com/repos/josephhardinee/PyDisdrometer/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/josephhardinee/PyDisdrometer/issues/31/comments","events_url":"https://api.github.com/repos/josephhardinee/PyDisdrometer/issues/31/events","html_url":"https://github.com/josephhardinee/PyDisdrometer/issues/31","id":169785692,"number":31,"title":"How can i add new DSR function","user":{"login":"godofyoga","id":10925363,"avatar_url":"https://avatars.githubusercontent.com/u/10925363?v=3","gravatar_id":"","url":"https://api.github.com/users/godofyoga","html_url":"https://github.com/godofyoga","followers_url":"https://api.github.com/users/godofyoga/followers","following_url":"https://api.github.com/users/godofyoga/following{/other_user}","gists_url":"https://api.github.com/users/godofyoga/gists{/gist_id}","starred_url":"https://api.github.com/users/godofyoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godofyoga/subscriptions","organizations_url":"https://api.github.com/users/godofyoga/orgs","repos_url":"https://api.github.com/users/godofyoga/repos","events_url":"https://api.github.com/users/godofyoga/events{/privacy}","received_events_url":"https://api.github.com/users/godofyoga/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/josephhardinee/PyDisdrometer/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2016-08-07T08:13:30Z","updated_at":"2016-08-16T07:08:49Z","closed_at":null,"body":"I have calculated new axis ratio for our site  and want to use that for calculate radar parameters so to test performance of new equation i replace new equation in DSR.py module in the def bc(D_eq) function. But when i run command  \"dsd.calculate_radar_parameters\" then python  kernel is dying \r\ndef bc(D_eq):\r\n    '''Beard and Chuang Drop Shape relationship model.\r\n\r\n    Implementation of the Beard and Chuang Drop Shape model given in [1]\r\n    . This gives the ratio of the major to minor axis.\r\n\r\n    Parameters\r\n    -----------\r\n    D_eq: float\r\n        Volume Equivalent Drop Diameter\r\n\r\n    Returns\r\n    -------\r\n    axis_ratio: float\r\n        The ratio of the major to minor axis.\r\n\r\n    See Also\r\n    --------\r\n    tb : Thurai and Bringi DSR\r\n    pb : Pruppacher and Beard DSR\r\n\r\n    References\r\n    ----------\r\n    ..[1]  Beard, Kenneth V., Catherine Chuang, 1987: A New Model for the\r\n    Equilibrium Shape of Raindrops. J. Atmos. Sci., 44, 1509-1524.\r\n    '''\r\n\r\n#    return 1.0048 + 5.7e-04 * np.power(D_eq, 1) - \\\r\n#        2.628e-02 * np.power(D_eq, 2) + 3.682e-03 * np.power(D_eq, 3) - \\\r\n#        1.677e-04 * np.power(D_eq, 4)\r\n# Monsoon drop shape relationship for 0 < Deq <8\r\n#    return  0.1479 + 2.413*(D_eq) - 2.194*(D_eq**2) + 0.7531*(D_eq**3) - 0.08305*(D_eq**4)\r\n# Monsoon drop shape relationship for 1 < Deq <8\r\n    return 0.9946 + 0.02297 * D_eq - 0.02051 * D_eq ** 2 + 0.002795 * D_eq ** 3 -\\\r\n        0.0001849 * D_eq ** 4"},"comment":{"url":"https://api.github.com/repos/josephhardinee/PyDisdrometer/issues/comments/240020804","html_url":"https://github.com/josephhardinee/PyDisdrometer/issues/31#issuecomment-240020804","issue_url":"https://api.github.com/repos/josephhardinee/PyDisdrometer/issues/31","id":240020804,"user":{"login":"godofyoga","id":10925363,"avatar_url":"https://avatars.githubusercontent.com/u/10925363?v=3","gravatar_id":"","url":"https://api.github.com/users/godofyoga","html_url":"https://github.com/godofyoga","followers_url":"https://api.github.com/users/godofyoga/followers","following_url":"https://api.github.com/users/godofyoga/following{/other_user}","gists_url":"https://api.github.com/users/godofyoga/gists{/gist_id}","starred_url":"https://api.github.com/users/godofyoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godofyoga/subscriptions","organizations_url":"https://api.github.com/users/godofyoga/orgs","repos_url":"https://api.github.com/users/godofyoga/repos","events_url":"https://api.github.com/users/godofyoga/events{/privacy}","received_events_url":"https://api.github.com/users/godofyoga/received_events","type":"User","site_admin":false},"created_at":"2016-08-16T07:08:49Z","updated_at":"2016-08-16T07:08:49Z","body":"Getting same result:\r\ndsd.change_scattering_temperature(\"20C\")\r\ndsd.calculate_radar_parameters(wavelength=tmatrix_aux.wl_X, dsr_func = DSR.dsr_yogesh)\r\nAisy = dsd.fields['Ai']['data']\r\nzhsy = dsd.fields['Zh']['data'].copy()\r\ndsd.change_scattering_temperature(\"20C\")\r\ndsd.calculate_radar_parameters(wavelength=tmatrix_aux.wl_X, dsr_func = DSR.bc)\r\nZhs = dsd.fields['Zh']['data']\r\nAis = dsd.fields['Ai']['data']\r\n\r\nplt.plot(Zhs,zhsy,'r-',label = 'yogesh - BC',linewidth = 2)\r\n#plt.plot(Zhsy,'b-',label = 'yogesh',linewidth = 2)\r\nplt.legend(loc = 9)\r\nplt.xlabel('BC-Zh',fontsize = 20)\r\nplt.ylabel('yogesh-Zh',fontsize = 20)\r\n\r\nI verified DSR.py\r\ndef dsr_yogesh(D_eq):\r\n    if (D_eq <= 7.0):\r\n        ratio= 0.9857 + 4.03e-02 * np.power(D_eq, 1) - 3.25e-02*np.power(D_eq, 2) + \\\r\n        6.2e-03 * np.power(D_eq, 3) - 5.1e-04 * np.power(D_eq, 4) \r\n    else:\r\n        ratio = 0.577\r\n    return ratio \r\n\r\n\r\n"}}
{"actor":{"display_login":"godofyoga"}}