-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add explicitly mode in the executePlan args * Fix typo * use ticks for name when hsing SQL commands * Expand PYTHONPATH * Fix syntax * hardcode py4j version for test * Missing dollar when updating ENV * Update CAST with ALIAS * Try hadoop3 compiled jar in prod (warning: we still have hbase 2.2 whereas the jar is compiled for hbase 2.4) * Try hadoop3 compiled jar in prod (warning: we still have hbase 2.2 whereas the jar is compiled for hbase 2.4) * Bump shaded jar * Disable PROD workflow to test the hypothesis that HBase 2.2 is not compatible with Hadoop 3 * Manually add deps on Json4s * Manually add deps on Json4s * Manually add deps on scala JSON * Manually add deps on scala JSON * New HBase connectors * Add slf4j dependency explicitly * Add slf4j-simple dependency explicitly * Downgrade slf4j deps * Use ALIAS when selecting casted columns * Upgrade to Spark 3.4.1 on kubernetes * Automatic generation of the SSOFT (#760) * New bin to generate the SSOFT * Update args * Update type of frac * Missing deps * Missing deps * Fix bug in the argument name * Fix typo * Take the number of cores differently * PEP89 * add fast transient module to the science pipeline (#757) * add fast transient module to the science pipeline * fix DataFrame --------- Co-authored-by: FusRoman <[email protected]>
- Loading branch information
1 parent
47e4b0f
commit 3a058ca
Showing
13 changed files
with
152 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2023 AstroLab Software | ||
# Author: Julien Peloton | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Construct the Solar System Object Fink Table (SSOFT) | ||
""" | ||
import argparse | ||
import datetime | ||
|
||
from fink_broker.loggingUtils import get_fink_logger, inspect_application | ||
from fink_broker.sparkUtils import init_sparksession | ||
|
||
from fink_spins.ssoft import build_the_ssoft | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description=__doc__) | ||
|
||
# Add specific arguments | ||
parser.add_argument( | ||
'-model', type=str, default='SHG1G2', | ||
help=""" | ||
Lightcurve model: SHG1G2, HG1G2, HG | ||
""" | ||
) | ||
parser.add_argument( | ||
'-version', type=str, default=None, | ||
help=""" | ||
Version to use in the format YYYY.MM | ||
Default is None, meaning current Year.Month | ||
""" | ||
) | ||
parser.add_argument( | ||
'-frac', type=float, default=None, | ||
help=""" | ||
Use only fraction (between 0 and 1) of the input dataset to build the SSOFT | ||
Default is None, meaning all available data is considered. | ||
""" | ||
) | ||
parser.add_argument( | ||
'-nmin', type=int, default=50, | ||
help=""" | ||
Minimum number of points in the lightcurve of an | ||
object to be considered for the SSOFT. Default is 50 | ||
""" | ||
) | ||
parser.add_argument( | ||
'--pre_aggregate_data', action="store_true", | ||
help=""" | ||
If specified, aggregate and save data on HDFS before computing the SSOFT (slower). | ||
Otherwise, read pre-aggregated data on HDFS to compute the SSOFT (faster). | ||
""" | ||
) | ||
args = parser.parse_args(None) | ||
|
||
if args.version is None: | ||
now = datetime.datetime.now() | ||
version = '{}.{:02d}'.format(now.year, now.month) | ||
else: | ||
version = args.version | ||
|
||
# Initialise Spark session | ||
spark = init_sparksession( | ||
name="ssoft_{}_{}".format(args.model, version), | ||
shuffle_partitions=2 | ||
) | ||
|
||
# The level here should be controlled by an argument. | ||
logger = get_fink_logger(spark.sparkContext.appName, "INFO") | ||
|
||
# debug statements | ||
inspect_application(logger) | ||
|
||
# We map processing 1:1 with the cores | ||
ncores = int(spark.sparkContext.getConf().get("spark.cores.max")) | ||
print("NCORES: {}".format(ncores)) | ||
|
||
if args.pre_aggregate_data: | ||
filename = None | ||
else: | ||
filename = 'sso_aggregated_{}'.format(version) | ||
|
||
pdf = build_the_ssoft( | ||
aggregated_filename=filename, | ||
nproc=ncores, nmin=args.nmin, | ||
frac=args.frac, model=args.model, | ||
version=version | ||
) | ||
|
||
pdf.to_parquet('ssoft_{}_{}.parquet'.format(args.model, version)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+39.4 KB
libs/hbase-spark-protocol-shaded-hbase2.3.0_spark3.4.1_scala2.12.0_hadoop3.3.6.jar
Binary file not shown.
Binary file added
BIN
+39.4 KB
libs/hbase-spark-protocol-shaded-hbase2.4.8_spark3.4.1_scala2.12.0_hadoop3.3.6.jar
Binary file not shown.