Convert Data Formats¶
cklm2sc_new(clm_mat, lmax)
¶
Transforms the spherical harmonics coefficients data in clm or klm format into a SC matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clm_mat |
ndarray
|
The input matrix containing spherical harmonics coefficients. |
required |
lmax |
int
|
The maximum degree of the spherical harmonic expansion. |
required |
Returns:
Name | Type | Description |
---|---|---|
tuple |
A tuple containing: - scmat (numpy.ndarray): The SC matrix. - dev_scmat (numpy.ndarray): The deviation SC matrix. |
Source code in pyshbundle/reshape_SH_coefficients.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
|
clm2cs(data_mat, lmax, sigma_flag=False)
¶
Converts the format from CLM to CS.
Under the hood uses the clm2sc
and sc2cs
functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_mat |
ndarray
|
List containing [degree, order, clm, slm, delta clm, delta slm, start date, end date]. |
required |
lmax |
int
|
Max Degree of the spherical harmonic expansion. |
required |
sigma_flag |
bool
|
Flag to return the standard deviation data in CS format or not. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
ndarray
|
Spherical Harmonic Coefficients in CS format. |
Source code in pyshbundle/reshape_SH_coefficients.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
clm2sc(data_mat, lmax, sigma_flag=False)
¶
Converts the spherical harmonic coefficients from CLM format to SC format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_mat |
ndarray
|
List containing [degree, order, clm, slm, delta clm, delta slm, start date, end date]. |
required |
lmax |
int
|
Max Degree of the spherical harmonic expansion. |
required |
sigma_flag |
bool
|
Flag to return the standard deviation data in CS format or not. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
ndarray
|
Spherical Harmonic Coefficients in SC format. |
References
Refer to the SHBundle or PySHBundle docs for the different data storage and retrieval formats.
Source code in pyshbundle/reshape_SH_coefficients.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
cs2sc(field)
¶
Converts SH coefficients from CS to SC format.
Converts the square (L+1)x(L+1) matrix field
, containing
spherical harmonics coefficients in CS storage format, into a
rectangular (L+1)x(2L+1) matrix in SC format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
field |
ndarray
|
The square (L+1)x(L+1) matrix, containing spherical harmonics coefficients in CS storage format. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Rectangular (L+1)x(2L+1) matrix in SC format. |
Raises:
Type | Description |
---|---|
TypeError
|
If the input is neither in CS nor in SC format. |
Examples:
cs2sc(field)
Source code in pyshbundle/reshape_SH_coefficients.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
klm2sc(data_mat, lmax, sigma_flag=False)
¶
Converts the spherical harmonic coefficients from klm format to SC format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_mat |
ndarray
|
List containing [degree, order, clm, slm, delta clm, delta slm, start date, end date]. |
required |
lmax |
int
|
Max Degree of the spherical harmonic expansion. |
required |
sigma_flag |
bool
|
Flag to return the standard deviation data in CS format or not. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
ndarray
|
Spherical Harmonic Coefficients or/and associated standard deviations in SC format. |
Source code in pyshbundle/reshape_SH_coefficients.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
sc2cs(field)
¶
Converts SH coefficients from SC to CS format.
Converts the rectangular (L+1) x (2L+1) matrix field
, containing
spherical harmonics coefficients in SC storage format, into a
square (L+1) x (L+1) matrix in CS format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
field |
ndarray
|
The rectangular (L+1) x (2L+1) matrix, containing the spherical harmonics coefficients in SC storage format. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Square (L+1) x (L+1) matrix in CS format. |
References
See the SHBundle docs or PySHBundle docs for more info about SH coefficient storage and retrieval formats being implemented.
Examples:
sc2cs(field)
Source code in pyshbundle/reshape_SH_coefficients.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
Reference¶
- Nico Sneeuw, Matthias Weigelt, Markus Antoni, Matthias Roth, Balaji Devaraju, et. al. (2021). SHBUNDLE 2021. http://www.gis.uni-stuttgart.de/research/projects/Bundles.