diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..4cfa1a928e01237767e786640cbd1722d7b11747 --- /dev/null +++ b/.gitignore @@ -0,0 +1,136 @@ +.idea/* +*.png +*.DS_Store* + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit examples / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# joblib temp +joblib* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..09ef202c6b3235402eef35026f156f60fd28bf07 --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +## csst_proto +[![Documentation Status](https://readthedocs.org/projects/csst-proto/badge/?version=latest)](https://csst-proto.readthedocs.io/en/latest/?badge=latest) + +CSST L1 pipeline prototype. + +## homepage + +This code is available at *CSST GitLab*: +- [https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto](https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto). + +## documentation + +A sphinx-based documentation is available at +- [https://csst-proto.readthedocs.io/en/latest/](https://csst-proto.readthedocs.io/en/latest/) + +## dependency + +- numpy~=1.20.3 +- joblib~=1.1.0 +- astropy~=5.1 + +## installation + +`csst_proto` can be installed with the following shell command + +```bash +git clone https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto.git +cd csst_proto +pip install -r requirements.txt +python setup.py install +``` + +or a single-line command + +```bash +sh -c "$(curl -fsSL https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto/-/raw/main/install.sh)" +``` + +## instruction + +A simple example on how to use this package: + +```python +from csst_proto.top_level_interface import flip_image +from astropy.io import fits + +# read an L0 image +img = fits.getdata("CSST_MS_SCI_06_L0_img.fits") +# flip the image +img_flipped = flip_image(img=img) +``` + +## algorithm description + +The `csst_proto` uses an awesome algorithm based on `numpy.ndarray` indices to flip images. diff --git a/install.sh b/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..4d880c55d9e86ed1ccfd2b98218fdb54ef8b785b --- /dev/null +++ b/install.sh @@ -0,0 +1,10 @@ +echo "csst_common Installer" +echo "==============================================" + +pip uninstall csst_common -y + +echo "Installing csst_common" +echo "➑===============================================" +pip install git+https://csst-tb.bao.ac.cn/code/csst-l1/csst_common.git +echo "➑===============================================" +echo "πŸ‡¨πŸ‡³πŸ‡¨πŸ‡³πŸ‡¨πŸ‡³πŸš€πŸš€πŸš€Done!" diff --git a/install_local.sh b/install_local.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e0632543d0d28529d9cecda8aa81938e8bac690 --- /dev/null +++ b/install_local.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +rm -rf build +rm -rf dist +#python setup.py build_ext --inplace +#python setup.py install +python setup.py sdist +pip install dist/*.tar.gz --force-reinstall +rm -rf ./*.egg-info \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..3b80d37e29f794e233e0b66262dec7aa913c4cd5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +numpy~=1.20.3 +joblib~=1.1.0 +setuptools~=58.0.4 +astropy~=5.1 +pytest \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..41bb3e892b056f608cf710c20d61d9b89bcc069f --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +import setuptools +import csst_common + +with open("README.md", "r") as fh: + long_description = fh.read() + +setuptools.setup( + name='csst_common', + version=csst_common.__version__, + author='CSST Team', + author_email='bozhang@nao.cas.cn', + description='The CSST L1 pipeline - common modules', # short description + long_description=long_description, + long_description_content_type="text/markdown", + url='https://csst-tb.bao.ac.cn/code/csst-l1/csst_common', + project_urls={ + 'Source': 'https://csst-tb.bao.ac.cn/code/csst-l1/csst_common', + }, + packages=setuptools.find_packages(), + license='MIT', + classifiers=["Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.8", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering :: Astronomy"], + package_dir={'csst': 'csst'}, + # include_package_data=True, + package_data={"": ["LICENSE", "README.md"], + "csst_common": []}, + # install_requires=['sphinx', + # 'numpy', + # 'scipy', 'matplotlib', + # 'astropy', 'healpy', 'ccdproc', 'deepCR', 'photutils'], + python_requires='>=3.8', +)