From 7fa07b0a277b7e3733d94132de5921264633caa3 Mon Sep 17 00:00:00 2001 From: NPGFusillo <88496326+NPGFusillo@users.noreply.github.com> Date: Wed, 11 Dec 2024 23:32:43 +0100 Subject: [PATCH 1/2] made Gaia sourceID a str for comparison and expanded limits of second fit --- python/astra/pipelines/snow_white/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/python/astra/pipelines/snow_white/__init__.py b/python/astra/pipelines/snow_white/__init__.py index 9f7e260..22d9dbc 100644 --- a/python/astra/pipelines/snow_white/__init__.py +++ b/python/astra/pipelines/snow_white/__init__.py @@ -134,9 +134,10 @@ def snow_white( log_H=np.array(tl[u'logg_H']).astype(float) eT_H=np.array(tl[u'eteff_H']).astype(float) elog_H=np.array(tl[u'elogg_H']).astype(float) - if spectrum.source.gaia_dr3_source_id in sourceID: #if there is a photometric solution use that as starting point - first_T=T_H[sourceID==spectrum.source.gaia_dr3_source_id][0] - first_g=log_H[sourceID==spectrum.source.gaia_dr3_source_id][0]*100 + GaiaID=str(spectrum.source.gaia_dr3_source_id) + if GaiaID in sourceID: #if there is a photometric solution use that as starting point + first_T=T_H[GaiaID][0] + first_g=log_H[GaiaID][0]*100 initial=1 if first_T > 80000: first_T=80000 @@ -201,12 +202,12 @@ def snow_white( if first_T <=13000.: tmp_Tg,tmp_chi= grid_param[grid_param[:,0]>13000.], grid_chi[grid_param[:,0]>13000.] second_T= tmp_Tg[tmp_chi==np.min(tmp_chi)][0][0] - fit_params['teff'] = lmfit.Parameter(name="teff",value=second_T,min=13000,max=80000) + fit_params['teff'] = lmfit.Parameter(name="teff",value=second_T,min=12000,max=80000) elif first_T >13000.: tmp_Tg,tmp_chi= grid_param[grid_param[:,0]<13000.], grid_chi[grid_param[:,0]<13000.] second_T= tmp_Tg[tmp_chi==np.min(tmp_chi)][0][0] - fit_params['teff'] = lmfit.Parameter(name="teff",value=second_T,min=3000,max=13000) + fit_params['teff'] = lmfit.Parameter(name="teff",value=second_T,min=3000,max=14000) if second_T>=16000 and second_T<=40000: line_crop = np.loadtxt(os.path.join(PIPELINE_DATA_DIR, 'line_crop.dat'),skiprows=1) From 720cae56762b8032bc9148cac4ac49f2dd9d38d1 Mon Sep 17 00:00:00 2001 From: NPGFusillo <88496326+NPGFusillo@users.noreply.github.com> Date: Wed, 11 Dec 2024 23:37:29 +0100 Subject: [PATCH 2/2] small typo fix --- python/astra/pipelines/snow_white/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/astra/pipelines/snow_white/__init__.py b/python/astra/pipelines/snow_white/__init__.py index 22d9dbc..79da9cc 100644 --- a/python/astra/pipelines/snow_white/__init__.py +++ b/python/astra/pipelines/snow_white/__init__.py @@ -136,8 +136,8 @@ def snow_white( elog_H=np.array(tl[u'elogg_H']).astype(float) GaiaID=str(spectrum.source.gaia_dr3_source_id) if GaiaID in sourceID: #if there is a photometric solution use that as starting point - first_T=T_H[GaiaID][0] - first_g=log_H[GaiaID][0]*100 + first_T=T_H[sourceID==GaiaID][0] + first_g=log_H[sourceID==GaiaID][0]*100 initial=1 if first_T > 80000: first_T=80000