Skip to content

Commit

Permalink
Added main file for creating catalogues, plus added functions to
Browse files Browse the repository at this point in the history
Makefile
  • Loading branch information
vcalderon2009 committed Feb 21, 2018
1 parent 6f66ef8 commit 8d1d09d
Show file tree
Hide file tree
Showing 2 changed files with 414 additions and 2 deletions.
40 changes: 38 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
#################################################################################

PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
BUCKET = [OPTIONAL] your-bucket-for-syncing-data (do not include 's3://')
PROFILE = default
PROJECT_NAME = ECO_Mocks_Catls
PYTHON_INTERPRETER = python3
ENVIRONMENT_FILE = environment.yml
ENVIRONMENT_NAME = eco_mocks_catls

DATA_DIR = $(PROJECT_DIR)/data
SRC_DIR = $(PROJECT_DIR)/src/data
MOCKS_CATL_DIR = $(DATA_DIR)/processed/*

# CPU-Fraction
CPU_FRAC = 0.75
REMOVE_FILES = "True"

ifeq (,$(shell which conda))
HAS_CONDA=False
else
Expand Down Expand Up @@ -61,6 +67,36 @@ endif
# PROJECT RULES #
#################################################################################

## Create catalogues for `ECO`
catl_mr_make:
@python $(SRC_DIR)/mocks_create_main.py -abopt mr -cpu_frac $(CPU_FRAC) -remove $(REMOVE_FILES)

## Delete existing `mock` catalogues
delete_mock_catls:
find $(MOCKS_CATL_DIR) -type f -name '*.hdf5' -name '*.gz' -delete

## Delete all files, except for `raw` files
delete_all_but_raw:
@rm -rf $(DATA_DIR)/external/*
@rm -rf $(DATA_DIR)/interim/*
@rm -rf $(DATA_DIR)/processed/*

## Clean the `./data` folder and remove all of the files
clean_data_dir:
@rm -rf $(DATA_DIR)/external/*
@rm -rf $(DATA_DIR)/interim/*
@rm -rf $(DATA_DIR)/processed/*
@rm -rf $(DATA_DIR)/raw/*

## Run tests to see if all files (Halobias, catalogues) are in order
test_files:
@pytest

## Delete screens from creating catalogues
delete_catl_screens:
screen -S "SDSS_Mocks_create" -X quit
screen -S "SDSS_Data_create" -X quit
screen -S "SDSS_Data_Mocks_create" -X quit


#################################################################################
Expand Down

0 comments on commit 8d1d09d

Please sign in to comment.