grizli
grizli copied to clipboard
'PermissionError: [Errno 1] Operation not permitted' when using autoscript.go()
When running the following code to extract spectra for G141 observations of EGS, I get the following error:
PermissionError: [Errno 1] Operation not permitted: '/tmp/aegis-01-bhj-39-000.0-f140w_tmpwcs.fits'
Any idea where this could be coming from? Is the query not getting files correctly?
import glob
import time
import os
import sys
import yaml
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import Image
from astropy.io import fits
from astropy.table import Table
import drizzlepac
import warnings
warnings.filterwarnings('ignore')
from mastquery import query, overlaps
import grizli
from grizli.pipeline import auto_script
from grizli import utils, fitting, multifit, prep
from grizli.pipeline.auto_script import get_yml_parameters
import grizli.utils
# HST calibs to iref/iref
# set get_acs=True below to get files necessary for G800L processing
grizli.utils.fetch_default_calibs()
# config files to $GRIZLI/CONF
# set get_jwst=True to get config files for jwst processing
grizli.utils.fetch_config_files()
grizli.utils.symlink_templates(force=False)
HOME_PATH = os.getcwd()
print(HOME_PATH)
parent = query.run_query(box=[214.6500, 52.6500, 50], proposal_id=[12177, 12547, 13063, 12063],
instruments=['WFC3/IR'],
filters=['F140W','G141'])
tabs = overlaps.find_overlaps(parent, buffer_arcmin=10, proposal_id=[12177, 12547, 13063, 12063], instruments=['WFC3/IR'], filters=['F140W', 'G141'], close=False)
print(glob.glob('*footprint.fits'))
foot_files = np.array(glob.glob('*footprint.fits'))
print('Footprint files: ', foot_files)
print('\n# id ra dec e(b-v) filters')
for tab in tabs:
print('{0} {1:.5f} {2:.5f} {3:.4f} {4}'.format(tab.meta['NAME'], tab.meta['RA'],
tab.meta['DEC'], tab.meta['MW_EBV'],
','.join(np.unique(tab['filter']))))
root_list = [tab.meta['NAME'] for tab in tabs]
print(root_list)
## Read the default parameters that can be edited and passed en-masse to `auto_script.go`
kwargs = get_yml_parameters()
print(list(kwargs.keys()))
############# need to check
kwargs['fetch_files_args']['reprocess_clean_darks'] = False
kwargs['fetch_files_args']['reprocess_parallel'] = True
## Set to True for parallel programs like WISPS
IS_PARALLEL = False
kwargs['is_parallel_field'] = IS_PARALLEL
# the magic piece of code that will do everything for you
# This line (auto_script.go) does everything up to extracting spectra
for i in range(0,1):
auto_script.go(root=root_list[i], **kwargs)
Does /tmp exist and do you have write access to it? Dumping things there is hard-coded a few places in grizli and should be done a bit more cleanly. I'm just working on a PR to fix this.