def add_regional_EIR_node(cb): regional_EIR_node_label = 100000 monthly_profile = 0.5*np.array([12.1, 23.9, 33.5, 14.8, 6.8, 4.9, 3.3, 3.8, 3.5, 3.3, 2.8, 4.3]) add_InputEIR(cb, monthlyEIRs=list(monthly_profile), nodes={'class': 'NodeSetNodeList', 'Node_List': [regional_EIR_node_label]}, start_day=0)
def set_up_EIR_node(self, cb, EIR_scale_factor=6, EIR_start_day=0): # From Jaline cb.update_params({ 'Enable_Regional_Migration': 1, 'Regional_Migration_Roundtrip_Duration': 3, 'Regional_Migration_Roundtrip_Probability': 1, 'x_Regional_Migration': 0.0405, # 'Regional_Migration_Filename': 'Regional_Migration.bin', }) # EIR profile copied from Jaline's household model monthly_profile = [ 0.21, 0.28, 0.43, 0.65, 0.84, 1.21, 1.24, 1.04, 0.84, 0.57, 0.29, 0.17 ] add_InputEIR( cb, monthlyEIRs=[x * EIR_scale_factor for x in monthly_profile], nodes={ 'class': 'NodeSetNodeList', 'Node_List': [100000] }, start_day=EIR_start_day) return {"EIR_scale_factor": EIR_scale_factor}
def sweep_scale_factor(cb, scale_factor): monthly_EIR = [ 43.8, 68.5, 27.4, 46.6, 49.4, 24.7, 13.7, 11, 11, 2.74, 13.7, 16.5 ] add_InputEIR(cb, [x * scale_factor for x in monthly_EIR]) return {'annual EIR': scale_factor * sum(monthly_EIR)}
def add_regional_EIR_node(self): # From Jaline self.cb.update_params({ 'Enable_Regional_Migration': 1, 'Regional_Migration_Roundtrip_Duration': 3, 'Regional_Migration_Roundtrip_Probability': 1, 'x_Regional_Migration': 0.0405, 'Regional_Migration_Filename': 'Migration/_Regional_Migration.bin', }) monthly_profile = [ 12.1, 23.9, 33.5, 14.8, 6.8, 4.9, 3.3, 3.8, 3.5, 3.3, 2.8, 4.3 ] add_InputEIR( self.cb, monthlyEIRs=[x * self.EIR_scale_factor for x in monthly_profile], nodes={ 'class': 'NodeSetNodeList', 'Node_List': [self.EIR_node_label] }, start_day=self.EIR_start_day) add_filtered_report(self.cb, nodes=[self.EIR_node_label], description='Work')
def add_regional_EIR_node(cb): regional_EIR_node_label = 100000 monthly_profile = 0.5 * np.array( [12.1, 23.9, 33.5, 14.8, 6.8, 4.9, 3.3, 3.8, 3.5, 3.3, 2.8, 4.3]) add_InputEIR(cb, monthlyEIRs=list(monthly_profile), nodeIDs=[regional_EIR_node_label], start_day=0)
def add_regional_EIR_node(self): # From Jaline self.cb.update_params({ 'Enable_Regional_Migration': 1, 'Regional_Migration_Roundtrip_Duration': 3, 'Regional_Migration_Roundtrip_Probability': 1, 'x_Regional_Migration': 0.0405, 'Regional_Migration_Filename': 'regional_migration.bin', }) monthly_profile = [12.1, 23.9, 33.5, 14.8, 6.8, 4.9, 3.3, 3.8, 3.5, 3.3, 2.8, 4.3] add_InputEIR(self.cb, monthlyEIRs=[x * self.regional_EIR_scale_factor for x in monthly_profile], nodes={'class': 'NodeSetNodeList', 'Node_List': [self.regional_EIR_node_label]}, start_day=0) # Add filtered reports to separate this node out add_filtered_report(self.cb, nodes=[self.regional_EIR_node_label], description='Work') all_catch_nodes = get_ids_from_demographics_file(os.path.join(self.input_files_root,self.demo_fp)) all_catch_nodes.remove(self.regional_EIR_node_label) add_filtered_report(self.cb, nodes= all_catch_nodes, description='Catchment')
def configure_site_EIR(cb, site, habitat=1, circular_shift=0, birth_cohort=True, set_site_geography=True, **geo_kwargs): if site not in study_site_monthly_EIRs.keys(): raise Exception("Don't know how to configure site: %s " % site) EIRs = [habitat * m for m in study_site_monthly_EIRs[site]] # Calibration is done with CONSTANT_INITIAL_IMMUNITY on birth cohort # but with a downscaling to account for maternal immunity levels # Here, we'll keep the CONSTANT model and downscale as a function of annual EIR annual_EIR = sum(EIRs) mAb = cb.get_param('Maternal_Antibody_Protection') * mAb_vs_EIR(annual_EIR) if birth_cohort: set_geography(cb, "Birth_Cohort") elif set_site_geography: geo = geography_from_site(site) set_geography(cb, geo, **geo_kwargs) cb.update_params({ 'Config_Name': site, 'Vector_Species_Names': [], # no mosquitoes 'Maternal_Antibodies_Type': 'CONSTANT_INITIAL_IMMUNITY', 'Maternal_Antibody_Protection': mAb }) # Shift order of months according to circular_shift argument EIR_deque = deque(EIRs) EIR_deque.rotate(circular_shift) monthlyEIRs = list(EIR_deque) add_InputEIR(cb, monthlyEIRs=monthlyEIRs) return {'monthlyEIRs': monthlyEIRs}
def __call__(self, cb): return add_InputEIR(cb, monthlyEIRs=self.monthlyEIRs, start_day=self.start_day, nodes=self.nodes)
"Serialized_Population_Path": "//internal.idm.ctr/IDM/Home/jsuresh/input/kariba_gridded_sims", 'Serialized_Population_Filenames': ['{}_2010-000.dtk'.format(catch), '{}_2010-001.dtk'.format(catch)] }) # # Drop EIR in regional node by a factor of 10 at beginning of 2014: this will overwrite previous EIR intervention monthly_profile = [ 0.21, 0.28, 0.43, 0.65, 0.84, 1.21, 1.24, 1.04, 0.84, 0.57, 0.29, 0.17 ] EIR_scale_factor = 0.1 EIR_start_day = 365 * (2014 - sim_start_year) add_InputEIR(cb, monthlyEIRs=[x * EIR_scale_factor for x in monthly_profile], nodes={ 'class': 'NodeSetNodeList', 'Node_List': [100000] }, start_day=EIR_start_day) if __name__ == "__main__": SetupParser.init() SetupParser.set("HPC", "priority", priority) SetupParser.set("HPC", "node_group", coreset) modlists = [] # if num_seeds > 1: # new_modlist = [ModFn(DTKConfigBuilder.set_param, 'Run_Number', seed) for seed in range(num_seeds)] # modlists.append(new_modlist) #