{"id":19382724,"url":"https://github.com/agrouaze/dspec","last_synced_at":"2026-05-14T23:43:39.055Z","repository":{"id":65759803,"uuid":"578632260","full_name":"agrouaze/dspec","owner":"agrouaze","description":"momentum spectrum decomposition","archived":false,"fork":false,"pushed_at":"2023-02-08T10:53:21.000Z","size":14,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T17:14:46.364Z","etag":null,"topics":["decomposition","numpy","orthogonal","python3","spectral-analysis","spectrum","xarray"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agrouaze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-15T14:13:17.000Z","updated_at":"2023-11-30T08:44:58.000Z","dependencies_parsed_at":"2023-02-25T22:45:59.345Z","dependency_job_id":null,"html_url":"https://github.com/agrouaze/dspec","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/agrouaze/dspec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrouaze%2Fdspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrouaze%2Fdspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrouaze%2Fdspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrouaze%2Fdspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrouaze","download_url":"https://codeload.github.com/agrouaze/dspec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrouaze%2Fdspec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261014050,"owners_count":23097165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decomposition","numpy","orthogonal","python3","spectral-analysis","spectrum","xarray"],"created_at":"2024-11-10T09:22:57.705Z","updated_at":"2026-05-14T23:43:39.016Z","avatar_url":"https://github.com/agrouaze.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dspec\nmomentum spectrum decomposition\n\n# Example of usage\n\n## open a .nc file containing spectral data\n```python\nimport datatree\nfile_L1b = './S1B_IW_SLC__1SDV_20210420T094142_20210420T094208_026549_032B99_7071.SAFE/s1b-iw3-slc-vv-20210420t094142-20210420t094208-026549-032b99-006_L1B_xspec_IFR_0.5.nc'\ndt = datatree.open_datatree(file_L1b)\n```\n\n\n## symmetrize both imaginary and real part spectrum \n```python\nimport spectrum_momentum\ncat_xspec = 'intra'\nds = dt[cat_xspec+'burst_xspectra'].to_dataset()\nfor tautau in range(3):\n    ds['xspectra_%stau'%tautau] = ds['xspectra_%stau_Re'%tautau] + 1j*ds['xspectra_%stau_Im'%tautau]\n    ds = ds.drop(['xspectra_%stau_Re'%tautau,'xspectra_%stau_Im'%tautau])\n\nxspec2tau  =  ds['xspectra_2tau'].swap_dims({'freq_sample':'k_rg','freq_line':'k_az'})\nxspec2tau = spectrum_momentum.symmetrize_xspectrum(xspec2tau, dim_range='k_rg', dim_azimuth='k_az')\none_spec_re = xspec2tau.isel(burst=0,tile_sample=0,tile_line=0).mean(dim='2tau').real\none_spec_im = xspec2tau.isel(burst=0,tile_sample=0,tile_line=0).mean(dim='2tau').imag\n\nprint(one_spec_re)\n\n```\n\n## compute 20 orthogonal momentum (floats) associated to convolution of the spectra with weights\n```python\nimport spectrum_momentum\ndecomp_moments = spectrum_momentum.orthogonalDecompSpec(real_part_spectrum=one_spec_re,\n                                                        imaginary_part_spectrum=one_spec_im)\ndecomp_moments\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrouaze%2Fdspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrouaze%2Fdspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrouaze%2Fdspec/lists"}