Commit 606c112d94d04275ea785aa518c56d84c827067d

Authored by Jürgen Knödlseder
1 parent 262c8961

Adapt to spatial model reorganization.

scripts/cssens.py
... ... @@ -347,52 +347,49 @@ class cssens(GApplication):
347 347  
348 348 # Set source
349 349 if type == "point":
350   - spatial = GModelSpatialPtsrc(location)
  350 + spatial = GModelSpatialPointSource(location)
351 351 if fitpos:
352 352 spatial["RA"].free()
353 353 spatial["DEC"].free()
354 354 else:
355 355 spatial["RA"].fix()
356 356 spatial["DEC"].fix()
357   - source = GModelPointSource(spatial, spectrum)
358 357 elif type == "gauss":
359   - radial = GModelRadialGauss(location, self.m_radius)
  358 + spatial = GModelSpatialRadialGauss(location, self.m_radius)
360 359 if fitpos:
361   - radial["RA"].free()
362   - radial["DEC"].free()
363   - radial["Sigma"].free()
  360 + spatial["RA"].free()
  361 + spatial["DEC"].free()
  362 + spatial["Sigma"].free()
364 363 else:
365   - radial["RA"].fix()
366   - radial["DEC"].fix()
367   - radial["Sigma"].fix()
368   - source = GModelExtendedSource(radial, spectrum)
  364 + spatial["RA"].fix()
  365 + spatial["DEC"].fix()
  366 + spatial["Sigma"].fix()
369 367 elif type == "disk":
370   - radial = GModelRadialDisk(location, self.m_radius)
  368 + spatial = GModelSpatialRadialDisk(location, self.m_radius)
371 369 if fitpos:
372   - radial["RA"].free()
373   - radial["DEC"].free()
374   - radial["Radius"].free()
  370 + spatial["RA"].free()
  371 + spatial["DEC"].free()
  372 + spatial["Radius"].free()
375 373 else:
376   - radial["RA"].fix()
377   - radial["DEC"].fix()
378   - radial["Radius"].fix()
379   - source = GModelExtendedSource(radial, spectrum)
  374 + spatial["RA"].fix()
  375 + spatial["DEC"].fix()
  376 + spatial["Radius"].fix()
380 377 elif type == "shell":
381   - radial = GModelRadialShell(location, self.m_radius, self.m_width)
  378 + spatial = GModelSpatialRadialShell(location, self.m_radius, self.m_width)
382 379 if fitpos:
383   - radial["RA"].free()
384   - radial["DEC"].free()
385   - radial["Radius"].free()
386   - radial["Width"].free()
  380 + spatial["RA"].free()
  381 + spatial["DEC"].free()
  382 + spatial["Radius"].free()
  383 + spatial["Width"].free()
387 384 else:
388   - radial["RA"].fix()
389   - radial["DEC"].fix()
390   - radial["Radius"].fix()
391   - radial["Width"].fix()
392   - source = GModelExtendedSource(radial, spectrum)
  385 + spatial["RA"].fix()
  386 + spatial["DEC"].fix()
  387 + spatial["Radius"].fix()
  388 + spatial["Width"].fix()
393 389 else:
394 390 self.log("ERROR: Unknown source type '"+type+"'.\n")
395 391 return None
  392 + source = GModelSky(spatial, spectrum)
396 393  
397 394 # Set source name
398 395 source.name("Test")
... ...
scripts/cstsdist.py
... ... @@ -3,7 +3,7 @@
3 3 # This script generates the TS distribution for a particular model based
4 4 # on Monte-Carlo simulations.
5 5 #
6   -# Copyright (C) 2011 Jurgen Knodlseder
  6 +# Copyright (C) 2011-2013 Jurgen Knodlseder
7 7 #
8 8 # This program is free software: you can redistribute it and/or modify
9 9 # it under the terms of the GNU General Public License as published by
... ... @@ -324,32 +324,29 @@ class cstsdist(GApplication):
324 324  
325 325 # Set source
326 326 if type == "point":
327   - spatial = GModelSpatialPtsrc(location)
  327 + spatial = GModelSpatialPointSource(location)
328 328 if fitpos:
329 329 spatial[0].free()
330 330 spatial[1].free()
331   - source = GModelPointSource(spatial, spectrum)
332 331 elif type == "gauss":
333   - radial = GModelRadialGauss(location, sigma)
  332 + spatial = GModelSpatialRadialGauss(location, sigma)
334 333 if fitpos:
335   - radial[0].free()
336   - radial[1].free()
337   - source = GModelExtendedSource(radial, spectrum)
  334 + spatial[0].free()
  335 + spatial[1].free()
338 336 elif type == "disk":
339   - radial = GModelRadialDisk(location, radius)
  337 + spatial = GModelSpatialRadialDisk(location, radius)
340 338 if fitpos:
341   - radial[0].free()
342   - radial[1].free()
343   - source = GModelExtendedSource(radial, spectrum)
  339 + spatial[0].free()
  340 + spatial[1].free()
344 341 elif type == "shell":
345   - radial = GModelRadialShell(location, radius, width)
  342 + spatial = GModelSpatialRadialShell(location, radius, width)
346 343 if fitpos:
347   - radial[0].free()
348   - radial[1].free()
349   - source = GModelExtendedSource(radial, spectrum)
  344 + spatial[0].free()
  345 + spatial[1].free()
350 346 else:
351 347 self.log("ERROR: Unknown source type '"+type+"'.\n")
352 348 return None
  349 + source = GModelSky(spatial, spectrum)
353 350  
354 351 # Set source name
355 352 source.name("Test")
... ...