-
Notifications
You must be signed in to change notification settings - Fork 1
/
DConeMaps.py
133 lines (119 loc) · 4.22 KB
/
DConeMaps.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
import sys
import numpy as np
import os
import os.path
from scipy import ndimage
from astropy.io import fits as pf
import re
from copy import deepcopy
from astropy.wcs import WCS
from scipy import optimize
import time
from time import gmtime,strftime
#import matplotlib as plt
#import matplotlib.pyplot as plt
#from pylab import *
#import matplotlib.colors as colors
include_path='/home/simon/common/python/include/'
sys.path.append(include_path)
import ConeRot.funcs_DConeMaps
class Model():
def __init__(self,
filename_source='',
filename_errormap='',
workdir='',
PA=95., # pass degrees
inc=40.*np.pi/180., # pass radians
tanpsi=0.05,
RA=False,
DEC=False,
x_center=0.,
y_center=0.,
# ErrorMap=False,
DoErrorMap=False,
XCheckInv=False,
ComputeSkyImages=True,
DoAzimuthalProfile=False,
PlotRadialProfile=True,
vsyst=0.,
sigma_vsyst=0.,
ComputeSystVelo=False,
DoAccr=False,
DoMerid=False,
a_min=0.2,
a_max=0.6,
LegBkgd=-1,
fieldscale=1.0,
pixscale_factor=1.,
unitscale=1.,
typicalerror=1E-2,
InjectNoise=True,
PrintOptimStatus=True,
DumpAllFitsFiles=False,
DoDCone=False,
domain=(),
RunMCMC=False,
BlindMCMC=False,
Hdu=False,
Hduw=False,
Hducentered=False,
Hduwcentered=False,
Hduregion=False,
Hdudiff=False,
Hdumoddrot=False,
Hduregion_faceon=False,
Verbose=False,
VerboseInit=False,
fout=False,
filelog='log_output.txt',
StoreRegions=False,
DoConjGrad=False,
DoMinuit=False,
ClearWorkDir=False,
InheritGlobalInit=False, # to force same initial conditions for all regions
PA0=0.,
inc0=10.,
tanpsi0=0.1,
a_min_regions=0.2,
a_max_regions=0.3,
iregion = 0, # region index
n_abins=12,
InheritMumap=False, # pass mumap from a previous orientation - used as weights in KepAmps
mumap=None,
Hdumumap=None,
HduDConemoddrot=None,
HdudiffDConemoddrot=None,
Hdudiff_faceon=None,
Hduresamp_faceon=None,
Hdurrs=None,
Hduphis=None,
Hdurrs_faceon=None,
Hduphis_faceon=None,
chi2_prev=0.,
polarchi2=0.,
skychi2=0.,
velodev_med=0.,
velodev_std=0.,
velodev_std2=0.,
DConeDeltaChi2=False,
RadialProfile=None,
bmaj=0.07, # arcsec
bmin=0.07, # arcsec
Ncorr=1., # dimensionless
DoFarSideOnly=False,
ExtendRegions=False, # True: extends inner and outer regions to whole radial domain - for plots only
RestrictAvToRadialDomain=False,
TriangleFile='triangle.png',
Diskgeometry={}):
initlocals=locals()
initlocals.pop('self')
for a_attribute in initlocals.keys():
if VerboseInit:
print( "DConeMaps setting ",a_attribute," to ",initlocals[a_attribute])
setattr(self,a_attribute,initlocals[a_attribute])
def conicpolar_expansions(self):
return ConeRot.funcs_DConeMaps.exec_conicpolar_expansions(self)
def prep_files(self):
ConeRot.funcs_DConeMaps.exec_prep_files(self)
def grid_4center(self):
ConeRot.funcs_DConeMaps.exec_grid_4center(self)