From 819ec4c9f38ca684aba88c04b81f7eb4f9d98634 Mon Sep 17 00:00:00 2001 From: Sylvie Dagoret Date: Mon, 28 Mar 2022 15:58:37 +0200 Subject: [PATCH 01/11] solve the problem of not finding target name in simbad and not finding the calspec filename --- spectractor/extractor/targets.py | 181 ++++++++++++++++++++++++++++++- 1 file changed, 176 insertions(+), 5 deletions(-) diff --git a/spectractor/extractor/targets.py b/spectractor/extractor/targets.py index 527e6d7f5..064d73124 100644 --- a/spectractor/extractor/targets.py +++ b/spectractor/extractor/targets.py @@ -6,6 +6,9 @@ from scipy.interpolate import interp1d import os import numpy as np +import re + +from astropy.io import fits from spectractor import parameters from spectractor.config import set_logger @@ -16,6 +19,147 @@ import pysynphot as S +def GetSimbadName(target_name): + """ + Try to find the simbad target name from the provided target_name + :param target_name: target name provided by the caller + :return: existing target name in simbad + """ + + object_name = (target_name).upper() + simbad_object_name = object_name + + # I was not able to find these entries in simbad database + if object_name in ["1732526","1740346","1743045","1757132","1802271","1805292","1808347","1812095","1812524","2M0036+18","2M0559-14","AGK+81D266", + "BD02D3375","BD17D4708","BD21D0607","BD26D2606","BD29D2091","BD54D1216","BD60D1753","BD75","ETAUMA","GRW+70D5824","HS2027","KF01T5", + "KF06T1","KF06T2","KF08T3","KSI2CETI","P041C","P177D","P330E","SF1615001A","SF1615+001A","SNAP-1","SNAP-2","SUN_REFERENCE","WD0947_857","WD1026_453", + "HZ43B","DELUMI","SDSS132811","SDSSJ151421","WD-0308-565","C26202", + "WD0320_539"]: + print(">>>>> SKIP TARGET {} ".format(object_name)) + return None + + + # for some special target name requiring a particular format in simbad + + if object_name == "LAMLEP": + simbad_object_name = "LAM LEP" + elif (object_name == "MUCOL") or (object_name == "MU COL") or (object_name == "MU. COL") or ( + object_name == "MU.COL"): + simbad_object_name = "mu. Col" + elif object_name == 'ETA1DOR' or object_name == "ETADOR" or object_name == "ETA DOR": + simbad_object_name = "ETA1 DOR" + elif object_name == 'BD11D3759': + simbad_object_name = "BD-11 3759" + elif object_name == 'WD0320-539': + simbad_object_name = "WD0320-539" + elif object_name == 'WD1327_083': + simbad_object_name = "WD1327-083" + elif object_name == 'GJ7541A': + simbad_object_name = "GJ754.1A" + elif object_name.split("-")[0] == 'NGC6681': + simbad_object_name = "NGC 6681" + else: + simbad_object_name = target_name + + return simbad_object_name + + +def GetListOfCAMSPECFiles(thedir): + """ + Get the list of CALSPEC files (fits file) inside the directory thedir + - thedir : directory where are the files + """ + + all_files=os.listdir(thedir) + sorted_files=sorted(all_files) + selected_files=[] + for sfile in sorted_files: + if re.search(".*fits$",sfile): + selected_files.append(sfile) + return selected_files + +def FilterListOfCALSPECFiles(listOfFiles): + """ + Filter list of files: + + The filename of spectrum could come in serveral sample in the input list. Only the last version is kept + + """ + + all_selected_files=[] + + current_root_fn=None # root of filename ex hd000000 + current_fn=None # filename of calspec ex hd000000_stis.fits + + for fn in listOfFiles: + + root_fn=fn.split("_")[0] + + if root_fn == "ngc6681": + root_fn = fn.split("_")[0]+"_"+fn.split("_")[1] + + + # special case for galaxy + #if root_fn == "ngc6681": + # all_selected_files.append(fn) + # current_root_fn=root_fn+"_"+fn.split("_")[1] + # current_fn=fn + # continue + + if current_root_fn==None: + current_root_fn=root_fn + current_fn=fn + continue + + if root_fn != current_root_fn: + all_selected_files.append(current_fn) + + current_fn=fn + current_root_fn=root_fn + + return all_selected_files + +def maptargetnametpfilename(all_selected_calspec): + """ + Make a dictionary target-name - filename + :param all_selected_calspec: list of calspec filename + :return: : dictionnary simbad - target filename : calspec filename + """ + + + pysynphot_root_path = os.environ['PYSYN_CDBS'] + path_sed_calspec = os.path.join(pysynphot_root_path, 'calspec') + + + dict_target_tofilename = {} + + + for file in all_selected_calspec: + + if file in ["WDcovar_001.fits", "WDcovar_002.fits"]: + print(">>>>> SKIP file {} ".format(file)) + continue + + fullfilename = os.path.join(path_sed_calspec,file) + + hdu = fits.open(fullfilename) + img = hdu[0].data + hd = hdu[0].header + + OBJNAME = hd["TARGETID"] + + simbad_target_name = GetSimbadName(OBJNAME) + + if simbad_target_name is not None: + dict_target_tofilename[simbad_target_name ] = file + + return dict_target_tofilename + + + + + + def load_target(label, verbose=False): """Load the target properties according to the type set by parameters.OBS_OBJECT_TYPE. @@ -208,8 +352,18 @@ def load(self): from astroquery.simbad import Simbad Simbad.add_votable_fields('flux(U)', 'flux(B)', 'flux(V)', 'flux(R)', 'flux(I)', 'flux(J)', 'sptype', 'parallax', 'pm', 'z_value') - simbad = Simbad.query_object(self.label) + + simbad_object_name = GetSimbadName(self.label) + + print(f"target_name = {self.label}, Selected object name for Simbad : {simbad_object_name}") + + simbad = Simbad.query_object(simbad_object_name) + print(simbad) + + self.label = simbad_object_name self.simbad = simbad + + if simbad is not None: if self.verbose or True: self.my_logger.info(f'\n\tSimbad:\n{simbad}') @@ -252,10 +406,27 @@ def load_spectra(self): is_calspec = False if os.getenv("PYSYN_CDBS") is not None: dirname = os.path.expandvars('$PYSYN_CDBS/calspec/') - for fname in os.listdir(dirname): - if os.path.isfile(os.path.join(dirname, fname)): - if self.label.lower().replace(' ','') in fname.lower(): - file_names.append(os.path.join(dirname, fname)) + #for fname in os.listdir(dirname): + # if os.path.isfile(os.path.join(dirname, fname)): + # if self.label.lower().replace(' ','') in fname.lower(): + # file_names.append(os.path.join(dirname, fname)) + + # get all calspec filenames + filenames_found_incalspecdir = GetListOfCAMSPECFiles(dirname) + + # select the last version of filenames + selected_filenames = FilterListOfCALSPECFiles(filenames_found_incalspecdir) + + # build a dictionnary to linl simbad target name with calspec filename + dict_star_filename = maptargetnametpfilename(selected_filenames) + + # select the unique filename corresponding to the target name + the_filename = dict_star_filename[self.label] + file_names.append(os.path.join(dirname,the_filename)) + + + + if len(file_names) > 0: is_calspec = True self.emission_spectrum = False From 40fe47af2e6f9cbb95f9fd5d4c74e2a7b8ca89d6 Mon Sep 17 00:00:00 2001 From: Sylvie Dagoret Date: Mon, 28 Mar 2022 16:08:23 +0200 Subject: [PATCH 02/11] suppress unnecessary prints --- spectractor/extractor/targets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spectractor/extractor/targets.py b/spectractor/extractor/targets.py index 064d73124..7dbb52a2a 100644 --- a/spectractor/extractor/targets.py +++ b/spectractor/extractor/targets.py @@ -35,7 +35,7 @@ def GetSimbadName(target_name): "KF06T1","KF06T2","KF08T3","KSI2CETI","P041C","P177D","P330E","SF1615001A","SF1615+001A","SNAP-1","SNAP-2","SUN_REFERENCE","WD0947_857","WD1026_453", "HZ43B","DELUMI","SDSS132811","SDSSJ151421","WD-0308-565","C26202", "WD0320_539"]: - print(">>>>> SKIP TARGET {} ".format(object_name)) + #print(">>>>> SKIP TARGET {} ".format(object_name)) return None @@ -137,7 +137,7 @@ def maptargetnametpfilename(all_selected_calspec): for file in all_selected_calspec: if file in ["WDcovar_001.fits", "WDcovar_002.fits"]: - print(">>>>> SKIP file {} ".format(file)) + #print(">>>>> SKIP file {} ".format(file)) continue fullfilename = os.path.join(path_sed_calspec,file) From af00c08ae44021e36ae133d1b3aa3ff200b3c48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Mon, 4 Apr 2022 11:08:27 +0200 Subject: [PATCH 03/11] correct image orientations for auxtel images produced with DM-Stack at CCIN2P3 --- config/auxtel.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/auxtel.ini b/config/auxtel.ini index eb17197c7..1df0555b4 100644 --- a/config/auxtel.ini +++ b/config/auxtel.ini @@ -39,7 +39,7 @@ OBS_QUANTUM_EFFICIENCY = calexp_2020031500162-EMPTY_ronchi90lpmm-det000_auxtel_t OBS_CAMERA_ROTATION = 0 # Camera (x,y) flip signs with respect to (north-up, east-left) system OBS_CAMERA_DEC_FLIP_SIGN = 1 -OBS_CAMERA_RA_FLIP_SIGN = -1 +OBS_CAMERA_RA_FLIP_SIGN = 1 [CCD] # size of the image in pixel # MFL: this number is wrong, and the CCD is not square From dea3263c10b6708d5f824c089c00157947c3dd9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Mon, 4 Apr 2022 11:09:11 +0200 Subject: [PATCH 04/11] update of the ratio order 2/1 for holo4_003 with a chimera built from LPNHE meausrements and hologram efficiency model fitted on data --- .../extractor/dispersers/holo4_003/NOTES | 2 + .../holo4_003/ratio_order_2over1.txt | 816 +++++++++++++++++- 2 files changed, 802 insertions(+), 16 deletions(-) create mode 100644 spectractor/extractor/dispersers/holo4_003/NOTES diff --git a/spectractor/extractor/dispersers/holo4_003/NOTES b/spectractor/extractor/dispersers/holo4_003/NOTES new file mode 100644 index 000000000..8b746d979 --- /dev/null +++ b/spectractor/extractor/dispersers/holo4_003/NOTES @@ -0,0 +1,2 @@ +- transmission.txt : measurements from LPNHE optical test bench using holo-4-003-diffraction-efficiencies-merged.npy +- ratio_order_2over1.txt : chimera with LPNHE opticl test bench measurements between 430 and 1000nm, then extrapolating with an hologram efficiency model fitted on data diff --git a/spectractor/extractor/dispersers/holo4_003/ratio_order_2over1.txt b/spectractor/extractor/dispersers/holo4_003/ratio_order_2over1.txt index 83fee889d..0b91ccadf 100644 --- a/spectractor/extractor/dispersers/holo4_003/ratio_order_2over1.txt +++ b/spectractor/extractor/dispersers/holo4_003/ratio_order_2over1.txt @@ -1,16 +1,800 @@ -4.000140000000000100e+02 9.258032705971752652e-01 4.231568176952237303e-01 -4.099649999999999750e+02 7.456642224474059333e-01 2.524258303434605000e-01 -4.199889999999999759e+02 8.206697556232603885e-01 1.550778848760470674e-01 -4.300079999999999814e+02 4.145847817899436794e-01 2.400836127560486422e-02 -4.400230000000000246e+02 3.896359875143290408e-01 5.122973837890793924e-04 -4.500339999999999918e+02 3.569414430011319528e-01 1.153640749520403689e-03 -4.599660000000000082e+02 3.231959795066510766e-01 1.687547770667485736e-03 -4.699669999999999845e+02 2.952134223303026217e-01 8.241579176448755092e-04 -4.799649999999999750e+02 2.747799337301949363e-01 1.164171288142639636e-04 -4.900330000000000155e+02 2.562613764855385390e-01 6.292668599739941046e-04 -5.000210000000000150e+02 2.375981575936403356e-01 1.142340402955344591e-03 -5.100049999999999955e+02 2.211097168927396994e-01 1.295726519620942060e-03 -5.199840000000000373e+02 2.081098698146498227e-01 1.457493861775800486e-03 -5.300330000000000155e+02 1.945921550754552420e-01 1.121141385090617575e-03 -5.400009999999999764e+02 1.840645652847427982e-01 7.979796336696842003e-04 -5.499640000000000555e+02 1.730779768983094768e-01 6.240218322699173656e-04 +3.000000000000000000e+02 4.000425949649632607e+00 +3.010000000000000000e+02 3.834789102316090936e+00 +3.020000000000000000e+02 3.680481339789571482e+00 +3.030000000000000000e+02 3.536450645010098537e+00 +3.040000000000000000e+02 3.401766113362143518e+00 +3.050000000000000000e+02 3.275601513608621396e+00 +3.060000000000000000e+02 3.157221396803993496e+00 +3.070000000000000000e+02 3.045969312164950260e+00 +3.080000000000000000e+02 2.941257772727685182e+00 +3.090000000000000000e+02 2.842559680180178461e+00 +3.100000000000000000e+02 2.749400971355822065e+00 +3.110000000000000000e+02 2.661354291434808950e+00 +3.120000000000000000e+02 2.578033533171692593e+00 +3.130000000000000000e+02 2.499089109186924063e+00 +3.140000000000000000e+02 2.424203846875973234e+00 +3.150000000000000000e+02 2.353089413854270173e+00 +3.160000000000000000e+02 2.285483196893635771e+00 +3.170000000000000000e+02 2.221145569667197339e+00 +3.180000000000000000e+02 2.159857494817908119e+00 +3.190000000000000000e+02 2.101418414309635274e+00 +3.200000000000000000e+02 2.045644389035319310e+00 +3.210000000000000000e+02 1.992366454504804762e+00 +3.220000000000000000e+02 1.941429164325458867e+00 +3.230000000000000000e+02 1.892689297291402672e+00 +3.240000000000000000e+02 1.846014707349327155e+00 +3.250000000000000000e+02 1.801283298621688678e+00 +3.260000000000000000e+02 1.758382110133456688e+00 +3.270000000000000000e+02 1.717206496980238972e+00 +3.280000000000000000e+02 1.677659396455493335e+00 +3.290000000000000000e+02 1.639650669172584063e+00 +3.300000000000000000e+02 1.603096506515639952e+00 +3.310000000000000000e+02 1.567918896865939660e+00 +3.320000000000000000e+02 1.534045144006785044e+00 +3.330000000000000000e+02 1.501407431932970438e+00 +3.340000000000000000e+02 1.469942431001805661e+00 +3.350000000000000000e+02 1.439590940977167444e+00 +3.360000000000000000e+02 1.410297567050846856e+00 +3.370000000000000000e+02 1.382010425388051411e+00 +3.380000000000000000e+02 1.354680875146723640e+00 +3.390000000000000000e+02 1.328263274271208383e+00 +3.400000000000000000e+02 1.302714756667616713e+00 +3.410000000000000000e+02 1.277995028636488950e+00 +3.420000000000000000e+02 1.254066182673734708e+00 +3.430000000000000000e+02 1.230892526957363620e+00 +3.440000000000000000e+02 1.208440429019355555e+00 +3.450000000000000000e+02 1.186678172262134234e+00 +3.460000000000000000e+02 1.165575824120479220e+00 +3.470000000000000000e+02 1.145105114794631840e+00 +3.480000000000000000e+02 1.125239325591037343e+00 +3.490000000000000000e+02 1.105953186005127931e+00 +3.500000000000000000e+02 1.087222778767753084e+00 +3.510000000000000000e+02 1.069025452154159339e+00 +3.520000000000000000e+02 1.051339738923527500e+00 +3.530000000000000000e+02 1.034145281318385345e+00 +3.540000000000000000e+02 1.017422761608225645e+00 +3.550000000000000000e+02 1.001153837710629046e+00 +3.560000000000000000e+02 9.853210834672083696e-01 +3.570000000000000000e+02 9.699079331909286061e-01 +3.580000000000000000e+02 9.548986301368102003e-01 +3.590000000000000000e+02 9.402781785796229252e-01 +3.600000000000000000e+02 9.260322992108316331e-01 +3.610000000000000000e+02 9.121473875926665587e-01 +3.620000000000000000e+02 8.986104754303975151e-01 +3.630000000000000000e+02 8.854091944447838314e-01 +3.640000000000000000e+02 8.725317426455723169e-01 +3.650000000000000000e+02 8.599668528239763354e-01 +3.660000000000000000e+02 8.477037630975349236e-01 +3.670000000000000000e+02 8.357321893547763336e-01 +3.680000000000000000e+02 8.240422994597991213e-01 +3.690000000000000000e+02 8.126246890884512020e-01 +3.700000000000000000e+02 8.014703590782431553e-01 +3.710000000000000000e+02 7.905706941837015167e-01 +3.720000000000000000e+02 7.799174431375440752e-01 +3.730000000000000000e+02 7.695026999259637623e-01 +3.740000000000000000e+02 7.593188861935543654e-01 +3.750000000000000000e+02 7.493587346999986964e-01 +3.760000000000000000e+02 7.396152737566187296e-01 +3.770000000000000000e+02 7.300818125764878541e-01 +3.780000000000000000e+02 7.207519274767453243e-01 +3.790000000000000000e+02 7.116194488764434611e-01 +3.800000000000000000e+02 7.026784490374587966e-01 +3.810000000000000000e+02 6.939232304998932399e-01 +3.820000000000000000e+02 6.853483151669378381e-01 +3.830000000000000000e+02 6.769484339974817244e-01 +3.840000000000000000e+02 6.687185172677249101e-01 +3.850000000000000000e+02 6.606536853658531161e-01 +3.860000000000000000e+02 6.527492400863565969e-01 +3.870000000000000000e+02 6.450006563929556735e-01 +3.880000000000000000e+02 6.374035746212466380e-01 +3.890000000000000000e+02 6.299537930941773167e-01 +3.900000000000000000e+02 6.226472611253234257e-01 +3.910000000000000000e+02 6.154800723866347134e-01 +3.920000000000000000e+02 6.084484586188969590e-01 +3.930000000000000000e+02 6.015487836646186137e-01 +3.940000000000000000e+02 5.947775378043944627e-01 +3.950000000000000000e+02 5.881313323790662295e-01 +3.960000000000000000e+02 5.816068946811380203e-01 +3.970000000000000000e+02 5.752010631009121244e-01 +3.980000000000000000e+02 5.689107825064778634e-01 +3.990000000000000000e+02 5.627330998632426029e-01 +4.000000000000000000e+02 5.566651600483045748e-01 +4.010000000000000000e+02 5.507042018798166128e-01 +4.020000000000000000e+02 5.448475543310149494e-01 +4.030000000000000000e+02 5.390926329248630910e-01 +4.040000000000000000e+02 5.334369362986222107e-01 +4.050000000000000000e+02 5.278780429288817411e-01 +4.060000000000000000e+02 5.224136080100216795e-01 +4.070000000000000000e+02 5.170413604739785285e-01 +4.080000000000000000e+02 5.117591001490900959e-01 +4.090000000000000000e+02 5.065646950469956389e-01 +4.100000000000000000e+02 5.014560787711390688e-01 +4.110000000000000000e+02 4.964312480436561259e-01 +4.120000000000000000e+02 4.914882603401037886e-01 +4.130000000000000000e+02 4.866252316298426139e-01 +4.140000000000000000e+02 4.818403342153860791e-01 +4.150000000000000000e+02 4.771317946659455744e-01 +4.160000000000000000e+02 4.724978918404452721e-01 +4.170000000000000000e+02 4.679369549955660901e-01 +4.180000000000000000e+02 4.634473619746133921e-01 +4.190000000000000000e+02 4.590275374732292746e-01 +4.200000000000000000e+02 4.546759513782185902e-01 +4.210000000000000000e+02 4.503911171759332754e-01 +4.220000000000000000e+02 4.461715904268729882e-01 +4.230000000000000000e+02 4.420159673033304260e-01 +4.240000000000000000e+02 4.379228831870855543e-01 +4.250000000000000000e+02 4.338910113243155675e-01 +4.260000000000000000e+02 4.299190615350345079e-01 +4.270000000000000000e+02 4.260057789745187451e-01 +4.280000000000000000e+02 4.221499429443110740e-01 +4.290000000000000000e+02 4.183503657505194262e-01 +4.300000000000000000e+02 4.146058916072418166e-01 +4.310000000000000000e+02 4.119825456711883604e-01 +4.320000000000000000e+02 4.093898494116849363e-01 +4.330000000000000000e+02 4.068272688083366395e-01 +4.340000000000000000e+02 4.042942821750211690e-01 +4.350000000000000000e+02 4.017903798058265474e-01 +4.360000000000000000e+02 3.993150636331172509e-01 +4.370000000000000000e+02 3.968678468972431372e-01 +4.380000000000000000e+02 3.944482538274347028e-01 +4.390000000000000000e+02 3.920558193334429120e-01 +4.400000000000000000e+02 3.896900887075042119e-01 +4.410000000000000000e+02 3.863464120825665371e-01 +4.420000000000000000e+02 3.830021396466499750e-01 +4.430000000000000000e+02 3.796806429491714763e-01 +4.440000000000000000e+02 3.763816901128489434e-01 +4.450000000000000000e+02 3.731050523973766797e-01 +4.460000000000000000e+02 3.698505041465567356e-01 +4.470000000000000000e+02 3.666178227364936260e-01 +4.480000000000000000e+02 3.634067885248317697e-01 +4.490000000000000000e+02 3.602171848010075617e-01 +4.500000000000000000e+02 3.570487977374958155e-01 +4.510000000000000000e+02 3.535387575126730519e-01 +4.520000000000000000e+02 3.500445630421452625e-01 +4.530000000000000000e+02 3.465787650670377751e-01 +4.540000000000000000e+02 3.431410188307837950e-01 +4.550000000000000000e+02 3.397309851351561494e-01 +4.560000000000000000e+02 3.363483302286987553e-01 +4.570000000000000000e+02 3.329927256978354455e-01 +4.580000000000000000e+02 3.296638483605794367e-01 +4.590000000000000000e+02 3.263613801627739952e-01 +4.600000000000000000e+02 3.230998375009818679e-01 +4.610000000000000000e+02 3.202752451780723764e-01 +4.620000000000000000e+02 3.174566625045751045e-01 +4.630000000000000000e+02 3.146440703215272472e-01 +4.640000000000000000e+02 3.118374495513185352e-01 +4.650000000000000000e+02 3.090367811972601908e-01 +4.660000000000000000e+02 3.062420463431562156e-01 +4.670000000000000000e+02 3.034532261528776753e-01 +4.680000000000000000e+02 3.006703018699391494e-01 +4.690000000000000000e+02 2.978932548170787897e-01 +4.700000000000000000e+02 2.951459760904612262e-01 +4.710000000000000000e+02 2.931021576732320555e-01 +4.720000000000000000e+02 2.910583528716119694e-01 +4.730000000000000000e+02 2.890145616854648547e-01 +4.740000000000000000e+02 2.869707841146547089e-01 +4.750000000000000000e+02 2.849270201590454188e-01 +4.760000000000000000e+02 2.828832698185010375e-01 +4.770000000000000000e+02 2.808395330928854516e-01 +4.780000000000000000e+02 2.787958099820626034e-01 +4.790000000000000000e+02 2.767521004858964351e-01 +4.800000000000000000e+02 2.747154427137348254e-01 +4.810000000000000000e+02 2.728731782847158005e-01 +4.820000000000000000e+02 2.710315629780004620e-01 +4.830000000000000000e+02 2.691905964505715287e-01 +4.840000000000000000e+02 2.673502783596536370e-01 +4.850000000000000000e+02 2.655106083627125635e-01 +4.860000000000000000e+02 2.636715861174555031e-01 +4.870000000000000000e+02 2.618332112818305690e-01 +4.880000000000000000e+02 2.599954835140266263e-01 +4.890000000000000000e+02 2.581584024724732362e-01 +4.900000000000000000e+02 2.563219678158401016e-01 +4.910000000000000000e+02 2.544438388414491659e-01 +4.920000000000000000e+02 2.525666864655649047e-01 +4.930000000000000000e+02 2.506919806513789872e-01 +4.940000000000000000e+02 2.488197166189657639e-01 +4.950000000000000000e+02 2.469498896008428257e-01 +4.960000000000000000e+02 2.450824948419309257e-01 +4.970000000000000000e+02 2.432175275995135388e-01 +4.980000000000000000e+02 2.413549831431966164e-01 +4.990000000000000000e+02 2.394948567548688956e-01 +5.000000000000000000e+02 2.376371437286614874e-01 +5.010000000000000000e+02 2.359825587202368791e-01 +5.020000000000000000e+02 2.343320338833386751e-01 +5.030000000000000000e+02 2.326812354821590767e-01 +5.040000000000000000e+02 2.310301634486801314e-01 +5.050000000000000000e+02 2.293788177148610996e-01 +5.060000000000000000e+02 2.277271982126389538e-01 +5.070000000000000000e+02 2.260753048739279902e-01 +5.080000000000000000e+02 2.244231376306199399e-01 +5.090000000000000000e+02 2.227706964145839130e-01 +5.100000000000000000e+02 2.211179811576664545e-01 +5.110000000000000000e+02 2.198108872677528580e-01 +5.120000000000000000e+02 2.185061172640102578e-01 +5.130000000000000000e+02 2.172019347368538966e-01 +5.140000000000000000e+02 2.158983392896033637e-01 +5.150000000000000000e+02 2.145953305259354349e-01 +5.160000000000000000e+02 2.132929080498834340e-01 +5.170000000000000000e+02 2.119910714658370665e-01 +5.180000000000000000e+02 2.106898203785417256e-01 +5.190000000000000000e+02 2.093891543930983812e-01 +5.200000000000000000e+02 2.080885232249250483e-01 +5.210000000000000000e+02 2.067532538315989821e-01 +5.220000000000000000e+02 2.054158006560976302e-01 +5.230000000000000000e+02 2.040761583367978194e-01 +5.240000000000000000e+02 2.027343214945102889e-01 +5.250000000000000000e+02 2.013902847324076095e-01 +5.260000000000000000e+02 2.000440426359518242e-01 +5.270000000000000000e+02 1.986955897728215903e-01 +5.280000000000000000e+02 1.973449206928394040e-01 +5.290000000000000000e+02 1.959920299278979650e-01 +5.300000000000000000e+02 1.946369119918864021e-01 +5.310000000000000000e+02 1.935814566816175253e-01 +5.320000000000000000e+02 1.925338964114397811e-01 +5.330000000000000000e+02 1.914839174960621115e-01 +5.340000000000000000e+02 1.904315115494197297e-01 +5.350000000000000000e+02 1.893766701466340074e-01 +5.360000000000000000e+02 1.883193848237877943e-01 +5.370000000000000000e+02 1.872596470776991817e-01 +5.380000000000000000e+02 1.861974483656932688e-01 +5.390000000000000000e+02 1.851327801053726796e-01 +5.400000000000000000e+02 1.840656336743866639e-01 +5.410000000000000000e+02 1.829798042128769897e-01 +5.420000000000000000e+02 1.818902416673986999e-01 +5.430000000000000000e+02 1.807969425194515256e-01 +5.440000000000000000e+02 1.796998875142705454e-01 +5.450000000000000000e+02 1.785990572645696772e-01 +5.460000000000000000e+02 1.774944322493998139e-01 +5.470000000000000000e+02 1.763859928129948573e-01 +5.480000000000000000e+02 1.752737191636057623e-01 +5.490000000000000000e+02 1.741575913723225899e-01 +5.500000000000000000e+02 1.730373857135460713e-01 +5.510000000000000000e+02 1.721084102799911586e-01 +5.520000000000000000e+02 1.711859143860539612e-01 +5.530000000000000000e+02 1.702698570066046024e-01 +5.540000000000000000e+02 1.693601972130408528e-01 +5.550000000000000000e+02 1.684568941785404284e-01 +5.560000000000000000e+02 1.675599071831263553e-01 +5.570000000000000000e+02 1.666691956185538392e-01 +5.580000000000000000e+02 1.657847189930168885e-01 +5.590000000000000000e+02 1.649064369356869619e-01 +5.600000000000000000e+02 1.640346266817868937e-01 +5.610000000000000000e+02 1.632741312954222035e-01 +5.620000000000000000e+02 1.625190994021210311e-01 +5.630000000000000000e+02 1.617694985327741974e-01 +5.640000000000000000e+02 1.610252963268890003e-01 +5.650000000000000000e+02 1.602864605362639416e-01 +5.660000000000000000e+02 1.595529590285424404e-01 +5.670000000000000000e+02 1.588247597906350672e-01 +5.680000000000000000e+02 1.581018309320243176e-01 +5.690000000000000000e+02 1.573841406879515625e-01 +5.700000000000000000e+02 1.566716574224873426e-01 +5.710000000000000000e+02 1.560340364435520710e-01 +5.720000000000000000e+02 1.554031197055657232e-01 +5.730000000000000000e+02 1.547770912839914470e-01 +5.740000000000000000e+02 1.541559251492456151e-01 +5.750000000000000000e+02 1.535395954164103238e-01 +5.760000000000000000e+02 1.529280763480461436e-01 +5.770000000000000000e+02 1.523213423569267089e-01 +5.780000000000000000e+02 1.517193680086905694e-01 +5.790000000000000000e+02 1.511221280244205711e-01 +5.800000000000000000e+02 1.505230930009028301e-01 +5.810000000000000000e+02 1.497035414374108253e-01 +5.820000000000000000e+02 1.488897872905295128e-01 +5.830000000000000000e+02 1.480817892989062246e-01 +5.840000000000000000e+02 1.472795064243363761e-01 +5.850000000000000000e+02 1.464828978530193504e-01 +5.860000000000000000e+02 1.456919229967295060e-01 +5.870000000000000000e+02 1.449065414939023355e-01 +5.880000000000000000e+02 1.441267132106352766e-01 +5.890000000000000000e+02 1.433523982416138043e-01 +5.900000000000000000e+02 1.425840540017451752e-01 +5.910000000000000000e+02 1.418656730348539785e-01 +5.920000000000000000e+02 1.411523651012469571e-01 +5.930000000000000000e+02 1.404440946157247683e-01 +5.940000000000000000e+02 1.397408261999645851e-01 +5.950000000000000000e+02 1.390425246831589468e-01 +5.960000000000000000e+02 1.383491551025900768e-01 +5.970000000000000000e+02 1.376606827041450265e-01 +5.980000000000000000e+02 1.369770729427720324e-01 +5.990000000000000000e+02 1.362982914828805292e-01 +6.000000000000000000e+02 1.356242968899954437e-01 +6.010000000000000000e+02 1.349477845058525971e-01 +6.020000000000000000e+02 1.342760449419541646e-01 +6.030000000000000000e+02 1.336090441850875665e-01 +6.040000000000000000e+02 1.329467484362770180e-01 +6.050000000000000000e+02 1.322891241108520022e-01 +6.060000000000000000e+02 1.316361378384709457e-01 +6.070000000000000000e+02 1.309877564630985425e-01 +6.080000000000000000e+02 1.303439470429420266e-01 +6.090000000000000000e+02 1.297046768503466174e-01 +6.100000000000000000e+02 1.290699133716485258e-01 +6.110000000000000000e+02 1.284016618467018755e-01 +6.120000000000000000e+02 1.277379580547196580e-01 +6.130000000000000000e+02 1.270789203217689844e-01 +6.140000000000000000e+02 1.264245142278976053e-01 +6.150000000000000000e+02 1.257747055868203567e-01 +6.160000000000000000e+02 1.251294604454006032e-01 +6.170000000000000000e+02 1.244887450830955006e-01 +6.180000000000000000e+02 1.238525260113776255e-01 +6.190000000000000000e+02 1.232207699731175943e-01 +6.200000000000000000e+02 1.225934439419454069e-01 +6.210000000000000000e+02 1.219303596987311167e-01 +6.220000000000000000e+02 1.212718326340983394e-01 +6.230000000000000000e+02 1.206179485242227095e-01 +6.240000000000000000e+02 1.199686720979510346e-01 +6.250000000000000000e+02 1.193239683385311500e-01 +6.260000000000000000e+02 1.186838024826091659e-01 +6.270000000000000000e+02 1.180481400191944613e-01 +6.280000000000000000e+02 1.174169466886129248e-01 +6.290000000000000000e+02 1.167901884814393082e-01 +6.300000000000000000e+02 1.161679960519706595e-01 +6.310000000000000000e+02 1.155909547424364137e-01 +6.320000000000000000e+02 1.150179394629486790e-01 +6.330000000000000000e+02 1.144489203430935353e-01 +6.340000000000000000e+02 1.138838677300137853e-01 +6.350000000000000000e+02 1.133227521874604210e-01 +6.360000000000000000e+02 1.127655444948289787e-01 +6.370000000000000000e+02 1.122122156461841103e-01 +6.380000000000000000e+02 1.116627368492679045e-01 +6.390000000000000000e+02 1.111170795244974530e-01 +6.400000000000000000e+02 1.105754981890980232e-01 +6.410000000000000000e+02 1.100539859017823779e-01 +6.420000000000000000e+02 1.095361065359849451e-01 +6.430000000000000000e+02 1.090218334955534302e-01 +6.440000000000000000e+02 1.085111403830634341e-01 +6.450000000000000000e+02 1.080040009988329913e-01 +6.460000000000000000e+02 1.075003893399280042e-01 +6.470000000000000000e+02 1.070002795991594202e-01 +6.480000000000000000e+02 1.065036461640725823e-01 +6.490000000000000000e+02 1.060104636159295011e-01 +6.500000000000000000e+02 1.055233253476783595e-01 +6.510000000000000000e+02 1.051075816804458024e-01 +6.520000000000000000e+02 1.046949065876338208e-01 +6.530000000000000000e+02 1.042852799579971068e-01 +6.540000000000000000e+02 1.038786818469952800e-01 +6.550000000000000000e+02 1.034750924761102947e-01 +6.560000000000000000e+02 1.030744922321589901e-01 +6.570000000000000000e+02 1.026768616666049183e-01 +6.580000000000000000e+02 1.022821814948653568e-01 +6.590000000000000000e+02 1.018904325956185436e-01 +6.600000000000000000e+02 1.015015960101069981e-01 +6.610000000000000000e+02 1.010113968301761395e-01 +6.620000000000000000e+02 1.005232991305678725e-01 +6.630000000000000000e+02 1.000385468900968355e-01 +6.640000000000000000e+02 9.955711501364279681e-02 +6.650000000000000000e+02 9.907897860188429051e-02 +6.660000000000000000e+02 9.860411295003274068e-02 +6.670000000000000000e+02 9.813249354656962409e-02 +6.680000000000000000e+02 9.766409607198310583e-02 +6.690000000000000000e+02 9.719889639750491084e-02 +6.700000000000000000e+02 9.673919330725835874e-02 +6.710000000000000000e+02 9.639068131363530412e-02 +6.720000000000000000e+02 9.604482624692470272e-02 +6.730000000000000000e+02 9.570161175761410233e-02 +6.740000000000000000e+02 9.536102164745090259e-02 +6.750000000000000000e+02 9.502303986881271980e-02 +6.760000000000000000e+02 9.468765052407805694e-02 +6.770000000000000000e+02 9.435483786500264980e-02 +6.780000000000000000e+02 9.402458629209900498e-02 +6.790000000000000000e+02 9.369688035402044812e-02 +6.800000000000000000e+02 9.337170474694812816e-02 +6.810000000000000000e+02 9.297067035354898701e-02 +6.820000000000000000e+02 9.257119840627724139e-02 +6.830000000000000000e+02 9.217446452683689118e-02 +6.840000000000000000e+02 9.178044902610867084e-02 +6.850000000000000000e+02 9.138913237308585180e-02 +6.860000000000000000e+02 9.100049519379686813e-02 +6.870000000000000000e+02 9.061451827023267458e-02 +6.880000000000000000e+02 9.023118253927561727e-02 +6.890000000000000000e+02 8.985046909163343920e-02 +6.900000000000000000e+02 8.947349446323199507e-02 +6.910000000000000000e+02 8.913573755614871696e-02 +6.920000000000000000e+02 8.880040304244014859e-02 +6.930000000000000000e+02 8.846747488163432538e-02 +6.940000000000000000e+02 8.813693717162912611e-02 +6.950000000000000000e+02 8.780877414784889201e-02 +6.960000000000000000e+02 8.748297018240538958e-02 +6.970000000000000000e+02 8.715950978326211795e-02 +6.980000000000000000e+02 8.683837759340441720e-02 +6.990000000000000000e+02 8.651955839001547466e-02 +7.000000000000000000e+02 8.620292539918561481e-02 +7.010000000000000000e+02 8.587474729862969169e-02 +7.020000000000000000e+02 8.554887807088534801e-02 +7.030000000000000000e+02 8.522530218671094115e-02 +7.040000000000000000e+02 8.490400424922033007e-02 +7.050000000000000000e+02 8.458496899300750604e-02 +7.060000000000000000e+02 8.426818128327537294e-02 +7.070000000000000000e+02 8.395362611497071692e-02 +7.080000000000000000e+02 8.364128861192372810e-02 +7.090000000000000000e+02 8.333115402599360066e-02 +7.100000000000000000e+02 8.302320773621811589e-02 +7.110000000000000000e+02 8.273268188961446779e-02 +7.120000000000000000e+02 8.244438422075291151e-02 +7.130000000000000000e+02 8.215819378637435888e-02 +7.140000000000000000e+02 8.187409738243750512e-02 +7.150000000000000000e+02 8.159208192635961088e-02 +7.160000000000000000e+02 8.131213445629800751e-02 +7.170000000000000000e+02 8.103424213043619595e-02 +7.180000000000000000e+02 8.075839222627698155e-02 +7.190000000000000000e+02 8.048457213994157644e-02 +7.200000000000000000e+02 8.021276938547634849e-02 +7.210000000000000000e+02 7.989588331874344918e-02 +7.220000000000000000e+02 7.958041380020018651e-02 +7.230000000000000000e+02 7.926706408471360932e-02 +7.240000000000000000e+02 7.895581939141257943e-02 +7.250000000000000000e+02 7.864666506183391748e-02 +7.260000000000000000e+02 7.833958655899915524e-02 +7.270000000000000000e+02 7.803456946649821313e-02 +7.280000000000000000e+02 7.773159948757814297e-02 +7.290000000000000000e+02 7.743066244423947586e-02 +7.300000000000000000e+02 7.713174427633738561e-02 +7.310000000000000000e+02 7.682108915003195426e-02 +7.320000000000000000e+02 7.651226044698522522e-02 +7.330000000000000000e+02 7.620546760368433759e-02 +7.340000000000000000e+02 7.590069625208906157e-02 +7.350000000000000000e+02 7.559793214212659485e-02 +7.360000000000000000e+02 7.529716114076769051e-02 +7.370000000000000000e+02 7.499836923110883569e-02 +7.380000000000000000e+02 7.470154251146066127e-02 +7.390000000000000000e+02 7.440666719444290200e-02 +7.400000000000000000e+02 7.411372960608671179e-02 +7.410000000000000000e+02 7.387266567539708950e-02 +7.420000000000000000e+02 7.363386801925188296e-02 +7.430000000000000000e+02 7.339682081001148994e-02 +7.440000000000000000e+02 7.316151361942176135e-02 +7.450000000000000000e+02 7.292793611965871226e-02 +7.460000000000000000e+02 7.269607808273698124e-02 +7.470000000000000000e+02 7.246592937992593630e-02 +7.480000000000000000e+02 7.223747998117072133e-02 +7.490000000000000000e+02 7.201071995452169860e-02 +7.500000000000000000e+02 7.178549899238731435e-02 +7.510000000000000000e+02 7.151532384955233690e-02 +7.520000000000000000e+02 7.124692665239515388e-02 +7.530000000000000000e+02 7.098029526109925214e-02 +7.540000000000000000e+02 7.071541763682018256e-02 +7.550000000000000000e+02 7.045228184089680212e-02 +7.560000000000000000e+02 7.019087603406819198e-02 +7.570000000000000000e+02 6.993118847569694541e-02 +7.580000000000000000e+02 6.967320752299817344e-02 +7.590000000000000000e+02 6.941692163027625428e-02 +7.600000000000000000e+02 6.916289344127254934e-02 +7.610000000000000000e+02 6.893384864851287430e-02 +7.620000000000000000e+02 6.870639673868460251e-02 +7.630000000000000000e+02 6.848052781375393860e-02 +7.640000000000000000e+02 6.825623206493618145e-02 +7.650000000000000000e+02 6.803349977208519861e-02 +7.660000000000000000e+02 6.781232130308585682e-02 +7.670000000000000000e+02 6.759268711325570889e-02 +7.680000000000000000e+02 6.737458774475169054e-02 +7.690000000000000000e+02 6.715801382598177161e-02 +7.700000000000000000e+02 6.694295607102393464e-02 +7.710000000000000000e+02 6.671085463565777640e-02 +7.720000000000000000e+02 6.647989777767757125e-02 +7.730000000000000000e+02 6.625047386242975678e-02 +7.740000000000000000e+02 6.602257294019471534e-02 +7.750000000000000000e+02 6.579618514620648451e-02 +7.760000000000000000e+02 6.557130070000985467e-02 +7.770000000000000000e+02 6.534790990482325368e-02 +7.780000000000000000e+02 6.512600314690884795e-02 +7.790000000000000000e+02 6.490557089494729259e-02 +7.800000000000000000e+02 6.468636995515991694e-02 +7.810000000000000000e+02 6.445330051097640511e-02 +7.820000000000000000e+02 6.422172619899053914e-02 +7.830000000000000000e+02 6.399163702954392685e-02 +7.840000000000000000e+02 6.376302309559241099e-02 +7.850000000000000000e+02 6.353587457204708244e-02 +7.860000000000000000e+02 6.331018171533601968e-02 +7.870000000000000000e+02 6.308593486190165744e-02 +7.880000000000000000e+02 6.286312442884550711e-02 +7.890000000000000000e+02 6.264174091243245035e-02 +7.900000000000000000e+02 6.242177488767716026e-02 +7.910000000000000000e+02 6.220460578884652592e-02 +7.920000000000000000e+02 6.198885209406317098e-02 +7.930000000000000000e+02 6.177448349566008051e-02 +7.940000000000000000e+02 6.156149094614541545e-02 +7.950000000000000000e+02 6.134986547339259244e-02 +7.960000000000000000e+02 6.113959818004850721e-02 +7.970000000000000000e+02 6.093068024294642088e-02 +7.980000000000000000e+02 6.072310291252393938e-02 +7.990000000000000000e+02 6.051685751224766124e-02 +8.000000000000000000e+02 6.031311451931210127e-02 +8.010000000000000000e+02 6.014134206511170810e-02 +8.020000000000000000e+02 5.997081488069362643e-02 +8.030000000000000000e+02 5.980152620477142272e-02 +8.040000000000000000e+02 5.963346934433497171e-02 +8.050000000000000000e+02 5.946663767426641628e-02 +8.060000000000000000e+02 5.930102463696360071e-02 +8.070000000000000000e+02 5.913662374196735488e-02 +8.080000000000000000e+02 5.897342856559539825e-02 +8.090000000000000000e+02 5.881143275058085124e-02 +8.100000000000000000e+02 5.864991293377635334e-02 +8.110000000000000000e+02 5.845773006473295452e-02 +8.120000000000000000e+02 5.826678000364033522e-02 +8.130000000000000000e+02 5.807705498571705260e-02 +8.140000000000000000e+02 5.788854731155541888e-02 +8.150000000000000000e+02 5.770124934662260174e-02 +8.160000000000000000e+02 5.751515352076305709e-02 +8.170000000000000000e+02 5.733025232770792845e-02 +8.180000000000000000e+02 5.714653832458635452e-02 +8.190000000000000000e+02 5.696400413144499936e-02 +8.200000000000000000e+02 5.678336323005137021e-02 +8.210000000000000000e+02 5.664819667270175330e-02 +8.220000000000000000e+02 5.651415033568013557e-02 +8.230000000000000000e+02 5.638121953477413795e-02 +8.240000000000000000e+02 5.624939965075449050e-02 +8.250000000000000000e+02 5.611868612922340377e-02 +8.260000000000000000e+02 5.598907448046856056e-02 +8.270000000000000000e+02 5.586056027932634338e-02 +8.280000000000000000e+02 5.573313916505111265e-02 +8.290000000000000000e+02 5.560680684119275602e-02 +8.300000000000000000e+02 5.548085845843418046e-02 +8.310000000000000000e+02 5.531981985428016668e-02 +8.320000000000000000e+02 5.515986269500824934e-02 +8.330000000000000000e+02 5.500098082199576105e-02 +8.340000000000000000e+02 5.484316813271161023e-02 +8.350000000000000000e+02 5.468641858034247599e-02 +8.360000000000000000e+02 5.453072617342217404e-02 +8.370000000000000000e+02 5.437608497546626840e-02 +8.380000000000000000e+02 5.422248910460922972e-02 +8.390000000000000000e+02 5.406993273324925409e-02 +8.400000000000000000e+02 5.391790307767493212e-02 +8.410000000000000000e+02 5.374994190270410144e-02 +8.420000000000000000e+02 5.358303471820993757e-02 +8.430000000000000000e+02 5.341717509434511929e-02 +8.440000000000000000e+02 5.325235665491443587e-02 +8.450000000000000000e+02 5.308857307696729366e-02 +8.460000000000000000e+02 5.292581809039583612e-02 +8.470000000000000000e+02 5.276408547753376477e-02 +8.480000000000000000e+02 5.260336907276275814e-02 +8.490000000000000000e+02 5.244366276212002187e-02 +8.500000000000000000e+02 5.228496048291095266e-02 +8.510000000000000000e+02 5.210744257355006542e-02 +8.520000000000000000e+02 5.193044758251318116e-02 +8.530000000000000000e+02 5.175449841888343783e-02 +8.540000000000000000e+02 5.157958834398787551e-02 +8.550000000000000000e+02 5.140571067228211222e-02 +8.560000000000000000e+02 5.123285877091668383e-02 +8.570000000000000000e+02 5.106102605930844945e-02 +8.580000000000000000e+02 5.089020600871537597e-02 +8.590000000000000000e+02 5.072039214181530559e-02 +8.600000000000000000e+02 5.055165698304067701e-02 +8.610000000000000000e+02 5.042327208204296085e-02 +8.620000000000000000e+02 5.029579647765410055e-02 +8.630000000000000000e+02 5.016922566232774605e-02 +8.640000000000000000e+02 5.004355517483422694e-02 +8.650000000000000000e+02 4.991878060002000184e-02 +8.660000000000000000e+02 4.979489756856918942e-02 +8.670000000000000000e+02 4.967190175677051178e-02 +8.680000000000000000e+02 4.954978888628733258e-02 +8.690000000000000000e+02 4.942855472393171967e-02 +8.700000000000000000e+02 4.930819508144279606e-02 +8.710000000000000000e+02 4.917031616340080541e-02 +8.720000000000000000e+02 4.903265217876416615e-02 +8.730000000000000000e+02 4.889586543361826299e-02 +8.740000000000000000e+02 4.875995100571955260e-02 +8.750000000000000000e+02 4.862490401554916269e-02 +8.760000000000000000e+02 4.849071962601759350e-02 +8.770000000000000000e+02 4.835739304217224338e-02 +8.780000000000000000e+02 4.822491951090918105e-02 +8.790000000000000000e+02 4.809329432068668725e-02 +8.800000000000000000e+02 4.796278099650309878e-02 +8.810000000000000000e+02 4.785965481847712782e-02 +8.820000000000000000e+02 4.775735761429882736e-02 +8.830000000000000000e+02 4.765588619603575160e-02 +8.840000000000000000e+02 4.755523741998878701e-02 +8.850000000000000000e+02 4.745540818659134408e-02 +8.860000000000000000e+02 4.735639544031238629e-02 +8.870000000000000000e+02 4.725819616956634939e-02 +8.880000000000000000e+02 4.716080740662548926e-02 +8.890000000000000000e+02 4.706422622753832219e-02 +8.900000000000000000e+02 4.696844975205330397e-02 +8.910000000000000000e+02 4.684014262954096230e-02 +8.920000000000000000e+02 4.671230211154689393e-02 +8.930000000000000000e+02 4.658526046961702916e-02 +8.940000000000000000e+02 4.645901329433892862e-02 +8.950000000000000000e+02 4.633355621400560981e-02 +8.960000000000000000e+02 4.620888489435445029e-02 +8.970000000000000000e+02 4.608499503831164218e-02 +8.980000000000000000e+02 4.596188238573679918e-02 +8.990000000000000000e+02 4.583954271317190049e-02 +9.000000000000000000e+02 4.571797183359236488e-02 +9.010000000000000000e+02 4.562397499628800118e-02 +9.020000000000000000e+02 4.553128327838604911e-02 +9.030000000000000000e+02 4.543934678405045502e-02 +9.040000000000000000e+02 4.534816282241438401e-02 +9.050000000000000000e+02 4.525772874228189274e-02 +9.060000000000000000e+02 4.516804193205872092e-02 +9.070000000000000000e+02 4.507909981968953594e-02 +9.080000000000000000e+02 4.499089987259704410e-02 +9.090000000000000000e+02 4.490343959762801984e-02 +9.100000000000000000e+02 4.481671654100165963e-02 +9.110000000000000000e+02 4.467070221733684954e-02 +9.120000000000000000e+02 4.452420874525640088e-02 +9.130000000000000000e+02 4.437851948705304889e-02 +9.140000000000000000e+02 4.423362943054717084e-02 +9.150000000000000000e+02 4.408953360115602099e-02 +9.160000000000000000e+02 4.394622706159197895e-02 +9.170000000000000000e+02 4.380370491155925056e-02 +9.180000000000000000e+02 4.366196228745783392e-02 +9.190000000000000000e+02 4.352099436208671512e-02 +9.200000000000000000e+02 4.338079634435128978e-02 +9.210000000000000000e+02 4.323840601706284426e-02 +9.220000000000000000e+02 4.309674896831448832e-02 +9.230000000000000000e+02 4.295585943103861354e-02 +9.240000000000000000e+02 4.281573264276960361e-02 +9.250000000000000000e+02 4.267636387644826307e-02 +9.260000000000000000e+02 4.253774844013590711e-02 +9.270000000000000000e+02 4.239988167673179598e-02 +9.280000000000000000e+02 4.226275896369358076e-02 +9.290000000000000000e+02 4.212637571275876930e-02 +9.300000000000000000e+02 4.199097559926108503e-02 +9.310000000000000000e+02 4.191808418769660260e-02 +9.320000000000000000e+02 4.184585903953789293e-02 +9.330000000000000000e+02 4.177429843534383874e-02 +9.340000000000000000e+02 4.170340069224737212e-02 +9.350000000000000000e+02 4.163316416398819136e-02 +9.360000000000000000e+02 4.156358724094870449e-02 +9.370000000000000000e+02 4.149466835019512828e-02 +9.380000000000000000e+02 4.142640595552442989e-02 +9.390000000000000000e+02 4.135879855751446732e-02 +9.400000000000000000e+02 4.129037195454651754e-02 +9.410000000000000000e+02 4.117656058102670685e-02 +9.420000000000000000e+02 4.106339468959516181e-02 +9.430000000000000000e+02 4.095087065017756489e-02 +9.440000000000000000e+02 4.083898486081709994e-02 +9.450000000000000000e+02 4.072773374746638253e-02 +9.460000000000000000e+02 4.061711376378113192e-02 +9.470000000000000000e+02 4.050712139091840885e-02 +9.480000000000000000e+02 4.039775313733207085e-02 +9.490000000000000000e+02 4.028900553857513861e-02 +9.500000000000000000e+02 4.018087515710015711e-02 +9.510000000000000000e+02 4.006663043389496054e-02 +9.520000000000000000e+02 3.995297802112339480e-02 +9.530000000000000000e+02 3.983994817337078304e-02 +9.540000000000000000e+02 3.972753732264516086e-02 +9.550000000000000000e+02 3.961574192770145331e-02 +9.560000000000000000e+02 3.950455847383951835e-02 +9.570000000000000000e+02 3.939398347270265527e-02 +9.580000000000000000e+02 3.928401346207867351e-02 +9.590000000000000000e+02 3.917464500570297381e-02 +9.600000000000000000e+02 3.906587469306208038e-02 +9.610000000000000000e+02 3.901813336536606724e-02 +9.620000000000000000e+02 3.897302714051179701e-02 +9.630000000000000000e+02 3.892855885551077533e-02 +9.640000000000000000e+02 3.888472850709544931e-02 +9.650000000000000000e+02 3.884153613748387440e-02 +9.660000000000000000e+02 3.879898183472439699e-02 +9.670000000000000000e+02 3.875706573304945474e-02 +9.680000000000000000e+02 3.871578801324038893e-02 +9.690000000000000000e+02 3.867514890300259578e-02 +9.700000000000000000e+02 3.863468719945920005e-02 +9.710000000000000000e+02 3.857606420915803830e-02 +9.720000000000000000e+02 3.851801391154767440e-02 +9.730000000000000000e+02 3.846053521084175086e-02 +9.740000000000000000e+02 3.840362704256211623e-02 +9.750000000000000000e+02 3.834728837361372350e-02 +9.760000000000000000e+02 3.829151820235977138e-02 +9.770000000000000000e+02 3.823631555870635190e-02 +9.780000000000000000e+02 3.818167950418717427e-02 +9.790000000000000000e+02 3.812760913205641422e-02 +9.800000000000000000e+02 3.807275106762120914e-02 +9.810000000000000000e+02 3.794471350931531706e-02 +9.820000000000000000e+02 3.781732131686629805e-02 +9.830000000000000000e+02 3.769057057879910549e-02 +9.840000000000000000e+02 3.756445741136588135e-02 +9.850000000000000000e+02 3.743897795832569486e-02 +9.860000000000000000e+02 3.731412839072824339e-02 +9.870000000000000000e+02 3.718990490669780297e-02 +9.880000000000000000e+02 3.706630373121987121e-02 +9.890000000000000000e+02 3.694332111592962820e-02 +9.900000000000000000e+02 3.682238569801758038e-02 +9.910000000000000000e+02 3.676879352498731851e-02 +9.920000000000000000e+02 3.671572619242652324e-02 +9.930000000000000000e+02 3.666318276717355634e-02 +9.940000000000000000e+02 3.661116234406087272e-02 +9.950000000000000000e+02 3.655966404598365305e-02 +9.960000000000000000e+02 3.650868702397577770e-02 +9.970000000000000000e+02 3.645823045728481537e-02 +9.980000000000000000e+02 3.640829355345714946e-02 +9.990000000000000000e+02 3.635887554842117536e-02 +1.000000000000000000e+03 3.630997570657873430e-02 +1.001000000000000000e+03 3.623064857631308477e-02 +1.002000000000000000e+03 3.615161140136593371e-02 +1.003000000000000000e+03 3.607286275092072558e-02 +1.004000000000000000e+03 3.599440120297695694e-02 +1.005000000000000000e+03 3.591622534428613039e-02 +1.006000000000000000e+03 3.583833377028632083e-02 +1.007000000000000000e+03 3.576072508503852498e-02 +1.008000000000000000e+03 3.568339790116364235e-02 +1.009000000000000000e+03 3.560635083977941456e-02 +1.010000000000000000e+03 3.552958253043782266e-02 +1.011000000000000000e+03 3.545309161106428159e-02 +1.012000000000000000e+03 3.537687672789561338e-02 +1.013000000000000000e+03 3.530093653541947762e-02 +1.014000000000000000e+03 3.522526969631470384e-02 +1.015000000000000000e+03 3.514987488139107580e-02 +1.016000000000000000e+03 3.507475076953042725e-02 +1.017000000000000000e+03 3.499989604762791806e-02 +1.018000000000000000e+03 3.492530941053392790e-02 +1.019000000000000000e+03 3.485098956099649814e-02 +1.020000000000000000e+03 3.477693520960434964e-02 +1.021000000000000000e+03 3.470314507472929688e-02 +1.022000000000000000e+03 3.462961788247122946e-02 +1.023000000000000000e+03 3.455635236660131032e-02 +1.024000000000000000e+03 3.448334726850768583e-02 +1.025000000000000000e+03 3.441060133713973873e-02 +1.026000000000000000e+03 3.433811332895483903e-02 +1.027000000000000000e+03 3.426588200786307575e-02 +1.028000000000000000e+03 3.419390614517497234e-02 +1.029000000000000000e+03 3.412218451954830700e-02 +1.030000000000000000e+03 3.405071591693500932e-02 +1.031000000000000000e+03 3.397949913052923654e-02 +1.032000000000000000e+03 3.390853296071661555e-02 +1.033000000000000000e+03 3.383781621502129217e-02 +1.034000000000000000e+03 3.376734770805658870e-02 +1.035000000000000000e+03 3.369712626147415568e-02 +1.036000000000000000e+03 3.362715070391353311e-02 +1.037000000000000000e+03 3.355741987095343937e-02 +1.038000000000000000e+03 3.348793260506156833e-02 +1.039000000000000000e+03 3.341868775554694693e-02 +1.040000000000000000e+03 3.334968417851061351e-02 +1.041000000000000000e+03 3.328092073679850271e-02 +1.042000000000000000e+03 3.321239629995293569e-02 +1.043000000000000000e+03 3.314410974416669847e-02 +1.044000000000000000e+03 3.307605995223471262e-02 +1.045000000000000000e+03 3.300824581350955689e-02 +1.046000000000000000e+03 3.294066622385342230e-02 +1.047000000000000000e+03 3.287332008559392532e-02 +1.048000000000000000e+03 3.280620630747808908e-02 +1.049000000000000000e+03 3.273932380462800384e-02 +1.050000000000000000e+03 3.267267149849611280e-02 +1.051000000000000000e+03 3.260624831682022717e-02 +1.052000000000000000e+03 3.254005319358125453e-02 +1.053000000000000000e+03 3.247408506895849145e-02 +1.054000000000000000e+03 3.240834288928662321e-02 +1.055000000000000000e+03 3.234282560701417369e-02 +1.056000000000000000e+03 3.227753218065960300e-02 +1.057000000000000000e+03 3.221246157476961164e-02 +1.058000000000000000e+03 3.214761275987838146e-02 +1.059000000000000000e+03 3.208298471246526923e-02 +1.060000000000000000e+03 3.201857641491325651e-02 +1.061000000000000000e+03 3.195438685546989760e-02 +1.062000000000000000e+03 3.189041502820513796e-02 +1.063000000000000000e+03 3.182665993297274093e-02 +1.064000000000000000e+03 3.176312057536928579e-02 +1.065000000000000000e+03 3.169979596669585120e-02 +1.066000000000000000e+03 3.163668512391765858e-02 +1.067000000000000000e+03 3.157378706962642168e-02 +1.068000000000000000e+03 3.151110083200109324e-02 +1.069000000000000000e+03 3.144862544477033256e-02 +1.070000000000000000e+03 3.138635994717409172e-02 +1.071000000000000000e+03 3.132430338392577091e-02 +1.072000000000000000e+03 3.126245480517562958e-02 +1.073000000000000000e+03 3.120081326647394446e-02 +1.074000000000000000e+03 3.113937782873335211e-02 +1.075000000000000000e+03 3.107814755819305122e-02 +1.076000000000000000e+03 3.101712152638255726e-02 +1.077000000000000000e+03 3.095629881008616496e-02 +1.078000000000000000e+03 3.089567849130690769e-02 +1.079000000000000000e+03 3.083525965723160275e-02 +1.080000000000000000e+03 3.077504140019568166e-02 +1.081000000000000000e+03 3.071502281764889458e-02 +1.082000000000000000e+03 3.065520301212015450e-02 +1.083000000000000000e+03 3.059558109118377944e-02 +1.084000000000000000e+03 3.053615616742577990e-02 +1.085000000000000000e+03 3.047692735841001088e-02 +1.086000000000000000e+03 3.041789378664402910e-02 +1.087000000000000000e+03 3.035905457954806222e-02 +1.088000000000000000e+03 3.030040886941931175e-02 +1.089000000000000000e+03 3.024195579340215045e-02 +1.090000000000000000e+03 3.018369449345356323e-02 +1.091000000000000000e+03 3.012562411631206083e-02 +1.092000000000000000e+03 3.006774381346603506e-02 +1.093000000000000000e+03 3.001005274112159005e-02 +1.094000000000000000e+03 2.995255006017151153e-02 +1.095000000000000000e+03 2.989523493616362201e-02 +1.096000000000000000e+03 2.983810653927133558e-02 +1.097000000000000000e+03 2.978116404426087160e-02 +1.098000000000000000e+03 2.972440663046261797e-02 +1.099000000000000000e+03 2.966783348174060336e-02 From ee2d4fc5fe0592b0cbc4239efb99e3c8869454f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Mon, 4 Apr 2022 11:10:18 +0200 Subject: [PATCH 05/11] new computation of the camera orientation angle from auxtel ROTPA header parameter --- spectractor/extractor/images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spectractor/extractor/images.py b/spectractor/extractor/images.py index 4d1d5c262..3f9feaf81 100644 --- a/spectractor/extractor/images.py +++ b/spectractor/extractor/images.py @@ -704,7 +704,7 @@ def load_AUXTEL_image(image): # pragma: no cover image.humidity = 40 if 'adu' in image.header['BUNIT']: image.units = 'ADU' - parameters.OBS_CAMERA_ROTATION = 90 - float(image.header["ROTPA"]) + parameters.OBS_CAMERA_ROTATION = 270 - float(image.header["ROTPA"]) if parameters.OBS_CAMERA_ROTATION > 360: parameters.OBS_CAMERA_ROTATION -= 360 if parameters.OBS_CAMERA_ROTATION < -360: From 99c12316f83e6f873d62cbd763c97d443b00f855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Mon, 4 Apr 2022 11:17:01 +0200 Subject: [PATCH 06/11] add SPECTRACTOR_DECONVOLUTION_SIGMA_CLIP = 20 (default) new sigma clip parameter and set it to 100 for auxtel.ini --- config/auxtel.ini | 2 ++ config/default.ini | 2 ++ spectractor/extractor/chromaticpsf.py | 3 ++- spectractor/extractor/extractor.py | 3 ++- spectractor/parameters.py | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/auxtel.ini b/config/auxtel.ini index 1df0555b4..2cdeb6cbd 100644 --- a/config/auxtel.ini +++ b/config/auxtel.ini @@ -13,6 +13,8 @@ SPECTRACTOR_COMPUTE_ROTATION_ANGLE = disperser SPECTRACTOR_DECONVOLUTION_PSF2D = False # deconvolve spectrogram with full forward model: False, True SPECTRACTOR_DECONVOLUTION_FFM = True +# value of sigma clip parameter for the spectractor deconvolution process PSF2D and FFM +SPECTRACTOR_DECONVOLUTION_SIGMA_CLIP = 100 [instrument] # instrument name diff --git a/config/default.ini b/config/default.ini index bb71c2cc4..936360863 100644 --- a/config/default.ini +++ b/config/default.ini @@ -13,6 +13,8 @@ SPECTRACTOR_COMPUTE_ROTATION_ANGLE = hessian SPECTRACTOR_DECONVOLUTION_PSF2D = True # deconvolve spectrogram with full forward model: False, True SPECTRACTOR_DECONVOLUTION_FFM = True +# value of sigma clip parameter for the spectractor deconvolution process PSF2D and FFM +SPECTRACTOR_DECONVOLUTION_SIGMA_CLIP = 20 [instrument] # instrument name diff --git a/spectractor/extractor/chromaticpsf.py b/spectractor/extractor/chromaticpsf.py index 0530a4684..d2bbbcf1e 100644 --- a/spectractor/extractor/chromaticpsf.py +++ b/spectractor/extractor/chromaticpsf.py @@ -1142,7 +1142,8 @@ def fit_chromatic_psf(self, data, bgd_model_func=None, data_errors=None, mode="1 w.set_mask(poly_params=w.poly_params) # precise fit with sigma clipping run_minimisation_sigma_clipping(w, method="newton", ftol=1 / (w.Nx * w.Ny), xtol=1e-6, niter=50, - fix=w.fixed, sigma_clip=20, niter_clip=3, verbose=verbose) + fix=w.fixed, sigma_clip=parameters.SPECTRACTOR_DECONVOLUTION_SIGMA_CLIP, + niter_clip=3, verbose=verbose) else: raise ValueError(f"Unknown fitting mode={mode}. Must be '1D' or '2D'.") diff --git a/spectractor/extractor/extractor.py b/spectractor/extractor/extractor.py index b32dcdd5f..19f7ea87e 100644 --- a/spectractor/extractor/extractor.py +++ b/spectractor/extractor/extractor.py @@ -699,7 +699,8 @@ def run_ffm_minimisation(w, method="newton", niter=2): for i in range(niter): w.set_mask(psf_poly_params=w.p[w.psf_params_start_index:]) run_minimisation_sigma_clipping(w, "newton", epsilon, w.fixed, xtol=1e-5, - ftol=1 / w.data.size, sigma_clip=20, niter_clip=3) + ftol=1 / w.data.size, niter_clip=3, + sigma_clip=parameters.SPECTRACTOR_DECONVOLUTION_SIGMA_CLIP) my_logger.info(f"\n\tNewton: total computation time: {time.time() - start}s") if parameters.DEBUG: diff --git a/spectractor/parameters.py b/spectractor/parameters.py index a08c906f9..96dad088e 100644 --- a/spectractor/parameters.py +++ b/spectractor/parameters.py @@ -38,6 +38,7 @@ def __getattr__(name): SPECTRACTOR_COMPUTE_ROTATION_ANGLE = "hessian" # method to get image rotation angle: False, disperser, hessian SPECTRACTOR_DECONVOLUTION_PSF2D = True # deconvolve spectrogram with simple 2D PSF analysis: False, True SPECTRACTOR_DECONVOLUTION_FFM = True # deconvolve spectrogram with full forward model: False, True +SPECTRACTOR_DECONVOLUTION_SIGMA_CLIP = 20 # value of sigma clip parameter for the spectractor deconvolution process PSF2D and FFM # Paths mypath = os.path.dirname(__file__) From 19e911be4152b71b39c8133f97acf8aca7f932da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Thu, 7 Apr 2022 15:08:37 +0200 Subject: [PATCH 07/11] refine the prior on DCCD for auxtel --- config/auxtel.ini | 4 ++-- spectractor/extractor/images.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/auxtel.ini b/config/auxtel.ini index 2cdeb6cbd..b8f18649d 100644 --- a/config/auxtel.ini +++ b/config/auxtel.ini @@ -59,9 +59,9 @@ CCD_REBIN = 2 [spectrograph] # distance between hologram and CCD in mm -DISTANCE2CCD = 175 +DISTANCE2CCD = 181 # uncertainty on distance between hologram and CCD in mm -DISTANCE2CCD_ERR = 0.75 +DISTANCE2CCD_ERR = 0.4 # default value for order 2 over order 1 transmission ratio GRATING_ORDER_2OVER1 = 0.1 diff --git a/spectractor/extractor/images.py b/spectractor/extractor/images.py index 3f9feaf81..808e18b15 100644 --- a/spectractor/extractor/images.py +++ b/spectractor/extractor/images.py @@ -723,7 +723,7 @@ def load_AUXTEL_image(image): # pragma: no cover image.target_guess = [parameters.CCD_IMSIZE - float(image.header["OBJECTY"]), parameters.CCD_IMSIZE - float(image.header["OBJECTX"])] image.disperser_label = image.header["GRATING"] - parameters.DISTANCE2CCD = 115 + float(image.header["LINSPOS"]) # mm + parameters.DISTANCE2CCD = 113 + float(image.header["LINSPOS"]) # mm image.compute_parallactic_angle() From b67dd321334b08cd9ed0512d36489a2e818f07e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Wed, 8 Jun 2022 18:04:27 +0200 Subject: [PATCH 08/11] fix name holo4_003/hologram_rotation_angles.txt --- .../{hologram_rotation_angle.txt => hologram_rotation_angles.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spectractor/extractor/dispersers/holo4_003/{hologram_rotation_angle.txt => hologram_rotation_angles.txt} (100%) diff --git a/spectractor/extractor/dispersers/holo4_003/hologram_rotation_angle.txt b/spectractor/extractor/dispersers/holo4_003/hologram_rotation_angles.txt similarity index 100% rename from spectractor/extractor/dispersers/holo4_003/hologram_rotation_angle.txt rename to spectractor/extractor/dispersers/holo4_003/hologram_rotation_angles.txt From 7ff61c4e71252012c1d12dd28bf04194a56d9a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Wed, 8 Jun 2022 18:06:57 +0200 Subject: [PATCH 09/11] fix pickle/lambda functions --- spectractor/extractor/dispersers.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/spectractor/extractor/dispersers.py b/spectractor/extractor/dispersers.py index c51f688da..9e0276cc7 100644 --- a/spectractor/extractor/dispersers.py +++ b/spectractor/extractor/dispersers.py @@ -647,6 +647,12 @@ def __init__(self, label, D=parameters.DISTANCE2CCD, data_dir=parameters.DISPERS self.is_hologram = True self.load_specs(verbose=verbose) + def theta_func(self, x, y): + return self.theta_tilt + + def N_func(self, x, y): + return self.N_input + def N(self, x): """Return the number of grooves per mm of the grating at position x. If the position is inside the data provided by the text files, this number is computed from an interpolation. If it lies outside, @@ -749,11 +755,10 @@ def load_specs(self, verbose=True): filename = os.path.join(self.data_dir, self.label, "N.txt") if os.path.isfile(filename): a = np.loadtxt(filename) - - def N_func(x, y): - return a[0] - self.N_interp = N_func - self.N_fit = N_func + self.N_input = a[0] + self.N_err = a[1] + self.N_interp = self.N_func + self.N_fit = self.N_func else: raise ValueError("To define an hologram, you must provide hologram_grooves_per_mm.txt or N.txt files.") filename = os.path.join(self.data_dir, self.label, "hologram_center.txt") @@ -773,9 +778,7 @@ def N_func(x, y): self.theta_y /= parameters.CCD_REBIN self.theta_interp = interpolate.interp2d(self.theta_x, self.theta_y, self.theta_data, kind='cubic') else: - def theta_func(x, y): - return self.theta_tilt - self.theta_interp = theta_func + self.theta_interp = self.theta_func self.x_lines, self.line1, self.line2 = neutral_lines(self.holo_center[0], self.holo_center[1], self.theta_tilt) if verbose: if self.is_hologram: From e93d189b071cb2ccd78e286290c5b0c464bed205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Wed, 8 Jun 2022 18:33:56 +0200 Subject: [PATCH 10/11] repair apply_max_width_to_bounds to change only the needed bounds and not modifying others --- spectractor/extractor/psf.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spectractor/extractor/psf.py b/spectractor/extractor/psf.py index a2bdae337..9d90f5e10 100644 --- a/spectractor/extractor/psf.py +++ b/spectractor/extractor/psf.py @@ -641,8 +641,8 @@ def __init__(self, p=None, clip=False): def apply_max_width_to_bounds(self, max_half_width=None): if max_half_width is not None: self.max_half_width = max_half_width - self.bounds = np.array([(0, np.inf), (-np.inf, np.inf), (0, 2 * self.max_half_width), - (0.1, self.max_half_width), (1.1, 100), (0, np.inf)]) + self.bounds[2] = (0, 2 * self.max_half_width) + self.bounds[3] = (0.1, self.max_half_width) def evaluate(self, pixels, p=None): r"""Evaluate the Moffat function. @@ -728,8 +728,8 @@ def __init__(self, p=None, clip=False): def apply_max_width_to_bounds(self, max_half_width=None): if max_half_width is not None: self.max_half_width = max_half_width - self.bounds = np.array([(0, np.inf), (-np.inf, np.inf), (0, 2 * self.max_half_width), - (1, self.max_half_width), (0, np.inf)]) + self.bounds[2] = (0, 2 * self.max_half_width) + self.bounds[3] = (1, self.max_half_width) def evaluate(self, pixels, p=None): r"""Evaluate the Gauss function. @@ -812,9 +812,9 @@ def __init__(self, p=None, clip=False): def apply_max_width_to_bounds(self, max_half_width=None): if max_half_width is not None: self.max_half_width = max_half_width - self.bounds = np.array([(0, np.inf), (-np.inf, np.inf), (0, 2 * self.max_half_width), - (0.1, self.max_half_width), (1.1, 100), (-1, 0), (0.1, self.max_half_width), - (0, np.inf)]) + self.bounds[2] = (0, 2 * self.max_half_width) + self.bounds[3] = (0.1, self.max_half_width) + self.bounds[6] = (0.1, self.max_half_width) def evaluate(self, pixels, p=None): r"""Evaluate the MoffatGauss function. @@ -924,7 +924,7 @@ def func(x, y, amplitude, x_c, y_c, gamma): def apply_max_width_to_bounds(self, max_half_width=None): if max_half_width is not None: self.max_half_width = max_half_width - self.bounds = np.array([(0, np.inf), (-np.inf, np.inf), (0, 2 * self.max_half_width), (0.5, 5), (0, np.inf)]) + self.bounds[2] = (0, 2 * self.max_half_width) def evaluate(self, pixels, p=None): r"""Evaluate the Order 0 interpolated function. From 20e06c08b7f0e68387ad0eea2ad340850c054a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Thu, 9 Jun 2022 09:41:40 +0200 Subject: [PATCH 11/11] remove pysynphot heavy dependence and add getCalspec light package --- README.md | 8 +- requirements.txt | 2 +- spectractor/extractor/targets.py | 227 ++++--------------------------- 3 files changed, 30 insertions(+), 207 deletions(-) diff --git a/README.md b/README.md index 57bcc1906..934966a3d 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,17 @@ Some submodules complete the structures with generic functions: ## Installation -Spectractor is written in Python 3.7. The dependencies are listed in the `requirements.txt` file. To install Spectractor, just run +Spectractor is written in Python 3.9. The dependencies are listed in the `requirements.txt` file. To install Spectractor, just run ``` pip install -r requirements.txt . ``` -Be careful, Spectractor can perform fits using the MCMC library [emcee](https://emcee.readthedocs.io/en/stable/) with [mpi4py](https://mpi4py.readthedocs.io/en/stable/) and [h5py](https://www.h5py.org/). The latter might be better installed using `conda install ...` command to get their own dependencies (openmp and hdf5). - For the simulation of spectra, Spectractor needs the following external libraries: - [libradtran](http://www.libradtran.org/doku.php) to simulate atmospheric transmission: it needs the installation of [netcdf](https://www.unidata.ucar.edu/software/netcdf/) and a python 2 environment (for the compilation only, not the usage); `uvpsec` executable must in the user `$PATH` or the user has to set an environmental variable `$LIBRADTRAN_DIR` pointing to the install directory. -- [pysynphot](https://pysynphot.readthedocs.io/en/latest/) to get the CALSPEC star spectra: the HST CALSPEC calibration spectra must be downloaded and the environment variable `$PYSYN_CDBS` must be created. +- [getCalspec](https://github.com/LSSTDESC/getCalspec) to get the CALSPEC star spectra; - [astrometry.net](https://astrometrynet.readthedocs.io/en/latest/) (optional): needed to create World Coordinate System files from the images; `solve-field` executable must in the user `$PATH` or the user has to set an environmental variable `$ASTROMETRYNET_DIR` pointing to the install directory. Version below or equal v0.78 should be used. +Be careful, Spectractor can perform fits using the MCMC library [emcee](https://emcee.readthedocs.io/en/stable/) with [mpi4py](https://mpi4py.readthedocs.io/en/stable/) and [h5py](https://www.h5py.org/). The latter might be better installed using `conda install ...` command to get their own dependencies (openmp and hdf5). + Detailled command lines for the installation of Spectractor and the external dependencies can be found in the file `.travis.yml`. ## Basic extraction diff --git a/requirements.txt b/requirements.txt index b9098bf81..1a5e40ff3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ iminuit>=2 coverage>=3.6 # <5 configparser coveralls -pysynphot deprecated pyyaml nose +getCalspec diff --git a/spectractor/extractor/targets.py b/spectractor/extractor/targets.py index f98f8699c..b4b481a2b 100644 --- a/spectractor/extractor/targets.py +++ b/spectractor/extractor/targets.py @@ -4,160 +4,14 @@ import matplotlib.pyplot as plt from scipy.interpolate import interp1d -import os import numpy as np -import re - -from astropy.io import fits from spectractor import parameters from spectractor.config import set_logger from spectractor.extractor.spectroscopy import (Lines, HGAR_LINES, HYDROGEN_LINES, ATMOSPHERIC_LINES, ISM_LINES, STELLAR_LINES) -if os.getenv("PYSYN_CDBS"): - import pysynphot as S - - -def GetSimbadName(target_name): - """ - Try to find the simbad target name from the provided target_name - :param target_name: target name provided by the caller - :return: existing target name in simbad - """ - - object_name = (target_name).upper() - simbad_object_name = object_name - - # I was not able to find these entries in simbad database - if object_name in ["1732526","1740346","1743045","1757132","1802271","1805292","1808347","1812095","1812524","2M0036+18","2M0559-14","AGK+81D266", - "BD02D3375","BD17D4708","BD21D0607","BD26D2606","BD29D2091","BD54D1216","BD60D1753","BD75","ETAUMA","GRW+70D5824","HS2027","KF01T5", - "KF06T1","KF06T2","KF08T3","KSI2CETI","P041C","P177D","P330E","SF1615001A","SF1615+001A","SNAP-1","SNAP-2","SUN_REFERENCE","WD0947_857","WD1026_453", - "HZ43B","DELUMI","SDSS132811","SDSSJ151421","WD-0308-565","C26202", - "WD0320_539"]: - #print(">>>>> SKIP TARGET {} ".format(object_name)) - return None - - - # for some special target name requiring a particular format in simbad - - if object_name == "LAMLEP": - simbad_object_name = "LAM LEP" - elif (object_name == "MUCOL") or (object_name == "MU COL") or (object_name == "MU. COL") or ( - object_name == "MU.COL"): - simbad_object_name = "mu. Col" - elif object_name == 'ETA1DOR' or object_name == "ETADOR" or object_name == "ETA DOR": - simbad_object_name = "ETA1 DOR" - elif object_name == 'BD11D3759': - simbad_object_name = "BD-11 3759" - elif object_name == 'WD0320-539': - simbad_object_name = "WD0320-539" - elif object_name == 'WD1327_083': - simbad_object_name = "WD1327-083" - elif object_name == 'GJ7541A': - simbad_object_name = "GJ754.1A" - elif object_name.split("-")[0] == 'NGC6681': - simbad_object_name = "NGC 6681" - else: - simbad_object_name = target_name - - return simbad_object_name - - -def GetListOfCAMSPECFiles(thedir): - """ - Get the list of CALSPEC files (fits file) inside the directory thedir - - thedir : directory where are the files - """ - - all_files=os.listdir(thedir) - sorted_files=sorted(all_files) - selected_files=[] - for sfile in sorted_files: - if re.search(".*fits$",sfile): - selected_files.append(sfile) - return selected_files - -def FilterListOfCALSPECFiles(listOfFiles): - """ - Filter list of files: - - The filename of spectrum could come in serveral sample in the input list. Only the last version is kept - - """ - - all_selected_files=[] - - current_root_fn=None # root of filename ex hd000000 - current_fn=None # filename of calspec ex hd000000_stis.fits - - for fn in listOfFiles: - - root_fn=fn.split("_")[0] - - if root_fn == "ngc6681": - root_fn = fn.split("_")[0]+"_"+fn.split("_")[1] - - - # special case for galaxy - #if root_fn == "ngc6681": - # all_selected_files.append(fn) - # current_root_fn=root_fn+"_"+fn.split("_")[1] - # current_fn=fn - # continue - - if current_root_fn==None: - current_root_fn=root_fn - current_fn=fn - continue - - if root_fn != current_root_fn: - all_selected_files.append(current_fn) - - current_fn=fn - current_root_fn=root_fn - - return all_selected_files - -def maptargetnametpfilename(all_selected_calspec): - """ - Make a dictionary target-name - filename - :param all_selected_calspec: list of calspec filename - :return: : dictionnary simbad - target filename : calspec filename - """ - - - pysynphot_root_path = os.environ['PYSYN_CDBS'] - path_sed_calspec = os.path.join(pysynphot_root_path, 'calspec') - - - dict_target_tofilename = {} - - - for file in all_selected_calspec: - - if file in ["WDcovar_001.fits", "WDcovar_002.fits"]: - #print(">>>>> SKIP file {} ".format(file)) - continue - - fullfilename = os.path.join(path_sed_calspec,file) - - hdu = fits.open(fullfilename) - img = hdu[0].data - hd = hdu[0].header - - OBJNAME = hd["TARGETID"] - - simbad_target_name = GetSimbadName(OBJNAME) - - if simbad_target_name is not None: - dict_target_tofilename[simbad_target_name ] = file - - return dict_target_tofilename - - - - +from getCalspec import getCalspec def load_target(label, verbose=False): @@ -341,10 +195,15 @@ def load(self): Examples -------- + >>> parameters.VERBOSE = True >>> s = Star('3C273') >>> print(s.radec_position.dec) - 2d03m08.598s - + 2d03m08.597s + >>> print(s.redshift) + 0.158339 + >>> s = Star('eta dor') + >>> print(s.radec_position.dec) + -66d02m22.635s """ # currently (pending a new release) astroquery has a race # condition at import time, so putting here rather than at the @@ -352,18 +211,12 @@ def load(self): from astroquery.simbad import Simbad Simbad.add_votable_fields('flux(U)', 'flux(B)', 'flux(V)', 'flux(R)', 'flux(I)', 'flux(J)', 'sptype', 'parallax', 'pm', 'z_value') - - simbad_object_name = GetSimbadName(self.label) - - print(f"target_name = {self.label}, Selected object name for Simbad : {simbad_object_name}") - - simbad = Simbad.query_object(simbad_object_name) - print(simbad) - - self.label = simbad_object_name + astroquery_label = self.label + if getCalspec.is_calspec(self.label): + calspec = getCalspec.Calspec(self.label) + astroquery_label = calspec.Astroquery_Name + simbad = Simbad.query_object(astroquery_label) self.simbad = simbad - - if simbad is not None: if self.verbose or True: self.my_logger.info(f'\n\tSimbad:\n{simbad}') @@ -401,51 +254,21 @@ def load_spectra(self): """ self.wavelengths = [] # in nm self.spectra = [] - # first try with pysynphot - file_names = [] - is_calspec = False - if os.getenv("PYSYN_CDBS") is not None: - dirname = os.path.expandvars('$PYSYN_CDBS/calspec/') - #for fname in os.listdir(dirname): - # if os.path.isfile(os.path.join(dirname, fname)): - # if self.label.lower().replace(' ','') in fname.lower(): - # file_names.append(os.path.join(dirname, fname)) - - # get all calspec filenames - filenames_found_incalspecdir = GetListOfCAMSPECFiles(dirname) - - # select the last version of filenames - selected_filenames = FilterListOfCALSPECFiles(filenames_found_incalspecdir) - - # build a dictionnary to linl simbad target name with calspec filename - dict_star_filename = maptargetnametpfilename(selected_filenames) - - # select the unique filename corresponding to the target name - the_filename = dict_star_filename[self.label] - file_names.append(os.path.join(dirname,the_filename)) - - - - - if len(file_names) > 0: - is_calspec = True + # first try if it is a Calspec star + is_calspec = getCalspec.is_calspec(self.label) + if is_calspec: + calspec = getCalspec.Calspec(self.label) self.emission_spectrum = False self.hydrogen_only = False self.lines = Lines(HYDROGEN_LINES + ATMOSPHERIC_LINES + STELLAR_LINES, redshift=self.redshift, emission_spectrum=self.emission_spectrum, hydrogen_only=self.hydrogen_only) - for k, f in enumerate(file_names): - if '_mod_' in f: - continue - if self.verbose: - self.my_logger.info('\n\tLoading %s' % f) - data = S.FileSpectrum(f, keepneg=True) - if isinstance(data.waveunits, S.units.Angstrom): - self.wavelengths.append(data.wave / 10.) - self.spectra.append(data.flux * 10.) - else: - self.wavelengths.append(data.wave) - self.spectra.append(data.flux) + spec_dict = calspec.get_spectrum_numpy() + # official units in spectractor are nanometers for wavelengths and erg/s/cm2/nm for fluxes + spec_dict["WAVELENGTH"] = spec_dict["WAVELENGTH"].to(u.nm) + spec_dict["FLUX"] = spec_dict["FLUX"].to(u.erg / u.second / u.cm**2 / u.nm) + self.wavelengths.append(spec_dict["WAVELENGTH"].value) + self.spectra.append(spec_dict["FLUX"].value) # TODO DM-33731: the use of self.label in parameters.STAR_NAMES: # below works for running but breaks a test so needs fixing for DM elif 'HD' in self.label: # or self.label in parameters.STAR_NAMES: # it is a star @@ -554,10 +377,10 @@ def plot_spectra(self): # target.load_spectra() ## No global target object available here (SDC) plt.figure() # necessary to create a new plot (SDC) for isp, sp in enumerate(self.spectra): - plt.plot(self.wavelengths[isp], sp, label='Spectrum %d' % isp) + plt.plot(self.wavelengths[isp], sp, label=f'Spectrum {isp}') plt.xlim((300, 1100)) plt.xlabel(r'$\lambda$ [nm]') - plt.ylabel('Flux') + plt.ylabel('Flux [erg/s/cm2/nm]') plt.title(self.label) plt.legend() if parameters.DISPLAY: # pragma: no cover