Commit 3fe9280fc9d41623c2e518000ebf6c98ad760a54
1 parent
5a020d92
fix also extended source model size
Showing
1 changed file
with
29 additions
and
8 deletions
scripts/cssens.py
| @@ -349,26 +349,47 @@ class cssens(GApplication): | @@ -349,26 +349,47 @@ class cssens(GApplication): | ||
| 349 | if type == "point": | 349 | if type == "point": |
| 350 | spatial = GModelSpatialPtsrc(location) | 350 | spatial = GModelSpatialPtsrc(location) |
| 351 | if fitpos: | 351 | if fitpos: |
| 352 | - spatial[0].free() | ||
| 353 | - spatial[1].free() | 352 | + spatial["RA"].free() |
| 353 | + spatial["DEC"].free() | ||
| 354 | + else: | ||
| 355 | + spatial["RA"].fix() | ||
| 356 | + spatial["DEC"].fix() | ||
| 354 | source = GModelPointSource(spatial, spectrum) | 357 | source = GModelPointSource(spatial, spectrum) |
| 355 | elif type == "gauss": | 358 | elif type == "gauss": |
| 356 | radial = GModelRadialGauss(location, sigma) | 359 | radial = GModelRadialGauss(location, sigma) |
| 357 | if fitpos: | 360 | if fitpos: |
| 358 | - radial[0].free() | ||
| 359 | - radial[1].free() | 361 | + radial["RA"].free() |
| 362 | + radial["DEC"].free() | ||
| 363 | + radial["Sigma"].free() | ||
| 364 | + else: | ||
| 365 | + radial["RA"].fix() | ||
| 366 | + radial["DEC"].fix() | ||
| 367 | + radial["Sigma"].fix() | ||
| 360 | source = GModelExtendedSource(radial, spectrum) | 368 | source = GModelExtendedSource(radial, spectrum) |
| 361 | elif type == "disk": | 369 | elif type == "disk": |
| 362 | radial = GModelRadialDisk(location, radius) | 370 | radial = GModelRadialDisk(location, radius) |
| 363 | if fitpos: | 371 | if fitpos: |
| 364 | - radial[0].free() | ||
| 365 | - radial[1].free() | 372 | + if fitpos: |
| 373 | + radial["RA"].free() | ||
| 374 | + radial["DEC"].free() | ||
| 375 | + radial["Radius"].free() | ||
| 376 | + else: | ||
| 377 | + radial["RA"].fix() | ||
| 378 | + radial["DEC"].fix() | ||
| 379 | + radial["Radius"].fix() | ||
| 366 | source = GModelExtendedSource(radial, spectrum) | 380 | source = GModelExtendedSource(radial, spectrum) |
| 367 | elif type == "shell": | 381 | elif type == "shell": |
| 368 | radial = GModelRadialShell(location, radius, width) | 382 | radial = GModelRadialShell(location, radius, width) |
| 369 | if fitpos: | 383 | if fitpos: |
| 370 | - radial[0].free() | ||
| 371 | - radial[1].free() | 384 | + radial["RA"].free() |
| 385 | + radial["DEC"].free() | ||
| 386 | + radial["Radius"].free() | ||
| 387 | + radial["Width"].free() | ||
| 388 | + else: | ||
| 389 | + radial["RA"].fix() | ||
| 390 | + radial["DEC"].fix() | ||
| 391 | + radial["Radius"].fix() | ||
| 392 | + radial["Width"].fix() | ||
| 372 | source = GModelExtendedSource(radial, spectrum) | 393 | source = GModelExtendedSource(radial, spectrum) |
| 373 | else: | 394 | else: |
| 374 | self.log("ERROR: Unknown source type '"+type+"'.\n") | 395 | self.log("ERROR: Unknown source type '"+type+"'.\n") |