Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions pycecream/pycecream/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,15 @@ def set_creaminpar(self):
content[idplot] = np.str(int(np.ceil(self.N_iterations / 4.0)))

#deal with multiplicative step sizes
step_multiplicative = list(self.lightcurve_input_params['noise model'].map(set(['multiplicative']).issubset))
#original way of finding the multiplicative flag in noise model. Didn't worked properly.
#returned all False flags, thus no fitting for step sizes.
#step_multiplicative = list(self.lightcurve_input_params['noise model'].map(set(['multiplicative']).issubset))

# NEW way of finding the multiplicative flag in noise model. Could be more pythonised.
step_multiplicative = []
for kk in self.lightcurve_input_params['noise model'].values:
step_multiplicative.append('multiplicative' in kk[0])

step = []
for i in range(self.count_lightcurves):
if step_multiplicative[i] is True:
Expand Down Expand Up @@ -307,16 +315,29 @@ def set_var(self):
creates the file instructing cream how to treat the extra variance parameters
(starting parameter values and step sizes)
:return:

History:
J. Hernandez Santisteban. Now it correctly sets the var parameter when added
to the noise model. Previously all were zeros and no added variance was included.
'''
f = open(self.dir_pycecream+'/'+self.dir_sim + '/cream_var.par', 'w')
# >> Juan change to check for var in noise model
step_var = []
for kk in self.lightcurve_input_params['noise model'].values:
step_var.append('var' in kk[0])
#print('>> Juan: ',step_var)
for i in range(self.count_lightcurves):
f.write('0.0 ')
if step_var[i] == True:
f.write('0.1 ')
else:
f.write('0.0 ')
f.write(np.str( self.p_extra_variance_step*
self.lightcurve_input_params['standard deviation'].values[i]) +'\n')
f.close()




def run(self):
'''
run the cream code. Make sure input above is correct first
Expand Down