Skip to content

Commit

Permalink
Merge pull request #902 from Keck-DataReductionPipelines/develop
Browse files Browse the repository at this point in the history
Version 2.7.1
  • Loading branch information
bjfultn authored May 29, 2024
2 parents 86d86fa + 89481a7 commit 4b344d1
Show file tree
Hide file tree
Showing 13 changed files with 1,367 additions and 58 deletions.
8 changes: 8 additions & 0 deletions configs/kpf_masters_l1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ quicklook = False
gain_keyword = 'CCDGAIN'
n_sigma_read_noise = 3.0

[WLS_INTERPOLATION]
cal_type = 'WLS'
object_before = 'autocal-lfc-all-eve'
object_after = 'autocal-lfc-all-morn'
#master_file_before_default = /masters/20240128/kpf_20240128_master_WLS_autocal-etalon-all-eve_L1.fits
#master_file_after_default = /masters/20240129/kpf_20240129_master_WLS_autocal-etalon-all-morn_L1.fits
do_db_query_for_before_after_master_files = True

# config file associated with the modules
[MODULE_CONFIGS]
order_trace = modules/order_trace/configs/default_recipe_kpf_20220505.cfg
Expand Down
6 changes: 4 additions & 2 deletions cronjobs/cleanOldFilesFromDisk.pl
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ sub removeOldSubDirs {
closedir DIR;
foreach my $file (@files) {
print "file = $file\n";
if (($file eq ".") or ($file eq "..") or ($file =~ /\.+/)) {
if (($file eq ".") or ($file eq "..") or ($file =~ /^\.+/)) {
print "Skipping file---->[$file]\n";
next;
}
$file = $dir . "/" . $file;
if ((-d $file) and (! ($file =~ /^.+\/\..*$/))) {
Expand Down Expand Up @@ -71,8 +72,9 @@ sub removeOldFiles {
closedir DIR;
foreach my $file (@files) {
print "file = $file\n";
if (($file eq ".") or ($file eq "..") or ($file =~ /\.+/)) {
if (($file eq ".") or ($file eq "..") or ($file =~ /^\.+/)) {
print "Skipping file---->[$file]\n";
next;
}
$file = $dir . "/" . $file;
if ((-f $file) and (! ($file =~ /^.+\/\..*$/))) {
Expand Down
96 changes: 96 additions & 0 deletions cronjobs/updateSoftwareAndReferenceFits.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#! /usr/local/bin/perl

use strict;
use warnings;

select STDERR; $| = 1; select STDOUT; $| = 1;

my $swdir = '/data/user/rlaher/git/KPF-Pipeline';
&updateSoftwareWithGitPull($swdir);

my $privaterefdir = '/data/user/rlaher/sbx/reference_fits';
my $publicrefdir = '/data/kpf/reference_fits';
&updateReferenceFits($privaterefdir,$publicrefdir);

exit 0;


#------------------------------------------
# Update software with git pull.

sub updateSoftwareWithGitPull {

my ($workdir) = @_;


# Change directory.

print "Changing to workdir = $workdir\n";

if (! chdir "$workdir") {
print "*** Warning: Could not change to $workdir; sleep for 10 seconds and try again...\n";
sleep(10);
if (! chdir "$workdir") {
die "*** Error: Could not change to $workdir; quitting...\n";
}
}

my $cmd0 = "git pull";
print "Executing [$cmd0]...\n";
my @op0 = `$cmd0`;
if (@op0) { print "Output from [$cmd0]=[@op0]\n"; }
}


#------------------------------------------
# Update files in private reference_fits.

sub updateReferenceFits {

my ($dir,$dir2) = @_;


# Change to private directory.

print "Changing to private reference_fits directory = $dir\n";

if (! chdir "$dir") {
print "*** Warning: Could not change to $dir; sleep for 10 seconds and try again...\n";
sleep(10);
if (! chdir "$dir") {
die "*** Error: Could not change to $dir; quitting...\n";
}
}

print "dir = $dir\n";
opendir(DIR, "$dir");
my @files = readdir DIR;
closedir DIR;

print "dir2 = $dir2\n";
opendir(DIR, "$dir2");
my @files2 = readdir DIR;
closedir DIR;

foreach my $file2 (@files2) {
print "file2 = $file2\n";
if (($file2 eq ".") or ($file2 eq "..") or ($file2 =~ /^\.+/)) {
print "1 Skipping file2---->[$file2]\n";
next;
}

# Check if file2 exists in private (current) directory.
# If not, copy it from the public directory.

if (-e $file2) {
print "$file2 already exists in private directory; skipping...\n";
} else {
$file2 = $dir2 . "/" . $file2;

my $cmd0 = "cp -p $file2 .";
print "Executing [$cmd0]...\n";
my @op0 = `$cmd0`;
if (@op0) { print "Output from [$cmd0]=[@op0]\n"; }
}
}
}
4 changes: 4 additions & 0 deletions database/schema/kpfOpsRoles.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ GRANT kpfporole to bfulton;

-- Make it so Andrew can run the master-files pipeline.
GRANT kpfporole to howard;

-- Make it so Howard Isaacson has a read-only database role (per his request).
REVOKE kpfporole from isaacson;
GRANT kpfreadrole to isaacson;
Loading

0 comments on commit 4b344d1

Please sign in to comment.