first run

This commit is contained in:
Roman Krivonos 2024-04-13 15:31:40 +03:00
parent 036f8d3f1c
commit c4391df246
4 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,10 @@
datadir="./data"
proddir="./products"
"""
Предполагается, что скрипты запускаются непосредственно в директории scripts
Пути должны оканчиваться на /
"""
datadir="../data/"
proddir="../products/"
""" Определение областей "Галактика" и "Внегалактика" """
bmax=30.0

View File

@ -63,7 +63,7 @@ def plot_best_fit(X, y, model):
y_pred = model.predict(X)
resid = y - y_pred
err = np.sqrt(np.sum((resid)**2))/len(resid)
print("ax+b: a={}, b={}, std={}".format(a,b,err))
print("ax+b: a={:.2e}, b={:.2e}, std={:.2f}".format(a,b,err))
"""
plt.scatter(X, y)
xaxis = arange(X.min(), X.max(), 0.01)

4
scripts/01_bgdmodel.py Normal file → Executable file
View File

@ -28,6 +28,7 @@ from ridge.config import *
enkey = sys.argv[1]
fn="detcnts.{}.fits".format(enkey)
print("Reading {}".format(datadir+fn))
d = fits.getdata(datadir+fn)
df=pd.DataFrame(np.array(d).byteswap().newbyteorder())
@ -139,4 +140,5 @@ with open(proddir+fn.replace(".fits",".pkl"), 'wb') as fp:
with open(proddir+fn.replace(".fits",".ignored_scw.pkl"), 'wb') as fp:
pickle.dump(ignored_scw, fp, protocol=pickle.HIGHEST_PROTOCOL)
print(ignored_scw)
print("Removed ScWs:",ignored_scw)

0
scripts/01_bgdmodel.sh Normal file → Executable file
View File