From efe9b1000a7878fdcba9c0a6a46ee1c1c482d1c5 Mon Sep 17 00:00:00 2001 From: Roman Krivonos Date: Tue, 22 Apr 2025 12:05:09 +0300 Subject: [PATCH] setup --- README.md | 2 +- arches/pyproject.toml | 22 +++++++++++++++ arches/{setup.py => setup.py.obsolete} | 4 +-- scripts/01_init_events.py | 38 ++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 arches/pyproject.toml rename arches/{setup.py => setup.py.obsolete} (72%) create mode 100755 scripts/01_init_events.py diff --git a/README.md b/README.md index ae23860..47aab8d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Arches cluster, a search for non-thermal emission +# Arches cluster Содержит код для обработки данных XMM-Newton для звездного скопления Арки (Arches cluster). diff --git a/arches/pyproject.toml b/arches/pyproject.toml new file mode 100644 index 0000000..d50c3df --- /dev/null +++ b/arches/pyproject.toml @@ -0,0 +1,22 @@ +[project] +name = "arches" +description = "Arches cluster" +version = "0.1.0" +authors = [ + { name = "Roman Krivonos", email = "krivonos@cosmos.ru" } +] +dependencies = [ + "pandas", + "numpy" +] + +[project.optional-dependencies] +dev = [ + "tox", + "pre-commit", + "bump2version" +] + +[flitbuild-system] +build-backend = "flit_core.buildapi" +requires = ["flit_core >=3.2,<4"] diff --git a/arches/setup.py b/arches/setup.py.obsolete similarity index 72% rename from arches/setup.py rename to arches/setup.py.obsolete index eed6bad..3f9ecb4 100644 --- a/arches/setup.py +++ b/arches/setup.py.obsolete @@ -1,8 +1,8 @@ from setuptools import setup, find_packages -setup(name="uds", +setup(name="arches", version="0.1", - description='eROSITA UDS field analysis', + description='XMM data analysis for Arches cluster', author='Roman Krivonos', author_email='krivonos@cosmos.ru', url='https://www.srg.cosmos.ru', diff --git a/scripts/01_init_events.py b/scripts/01_init_events.py new file mode 100755 index 0000000..90a8b23 --- /dev/null +++ b/scripts/01_init_events.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +from pysas.wrapper import Wrapper as w +import os, sys + +from arches.utils import * +from arches.config import * + +root_path=dirname(dirname(dirname(inspect.getfile(arches)))) +print("Arches root path: {}".format(root_path)) + +sys.exit() + +root='/data/xmm' + +inargs = ['--version'] +t = w('sasver', inargs) +t.run() + +obsid='0862470501' +local_ccf=f'{root}/work/{obsid}/ccf.cif' +work_dir=f'{root}/work/{obsid}' + +os.environ['SAS_ODF'] = f'{root}/arc/{obsid}/odf/' + +if not os.path.exists(work_dir): + os.makedirs(work_dir) + +os.chdir(work_dir) + +if not os.path.exists(local_ccf): + w('cifbuild', []).run() +else: + print("Skip cifbuild, SAS_CCF = {}".format(local_ccf)) + +os.environ['SAS_CCF'] = local_ccf + +print(os.environ['SAS_CCF'])