oirlab / liger_iris_pipeline

Data Reduction System (DRS) for the Thirty Meter Telescope IRIS imager/spectrograph
https://oirlab.github.io/iris-pipeline
0 stars 3 forks source link

Setting Up CRDS #20

Closed arunsurya77 closed 4 years ago

arunsurya77 commented 4 years ago

I am having a problem getting CRDS to work properly. I have run setup_local_crds.sh after installing crds_cache and tmt_crds from the repo. When I try to run the flat field step example I recieve the following error

2020-04-21 12:51:23,461 - stpipe.PreprocessFlatfield - INFO - PreprocessFlatfield instance created.
2020-04-21 12:51:23,462 - stpipe.PreprocessFlatfield.dark_current - INFO - DarkCurrentStep instance created.
2020-04-21 12:51:23,463 - stpipe.PreprocessFlatfield.normalize - INFO - NormalizeStep instance created.
2020-04-21 12:51:23,493 - stpipe.PreprocessFlatfield - INFO - Step PreprocessFlatfield running with args ('raw_flat_frame_cal.fits',).
2020-04-21 12:51:23,672 - stpipe.PreprocessFlatfield - WARNING - 'newspec' data loader provided for Spectrum1D without explicit identifier or list of compatible extensions
2020-04-21 12:51:23,675 - stpipe.PreprocessFlatfield - WARNING - 'kaka.py' data loader provided for Spectrum1D without explicit identifier or list of compatible extensions
2020-04-21 12:51:25,475 - stpipe.PreprocessFlatfield - INFO - Prefetching reference files for dataset: 'raw_flat_frame_cal.fits' reftypes = ['dark']

ERROR RUNNING STEP 'PreprocessFlatfield':
    CRDS server at 'https://jwst-crds.stsci.edu' is inconsistent with
    observatory 'tmt'. You may be configured for the wrong project.
    Check CRDS_SERVER_URL and CRDS_OBSERVATORY environment settings.
    See https://jwst-crds.stsci.edu/docs/cmdline_bestrefs/ (JWST) or
    https://hst-crds.stsci.edu/docs/cmdline_bestrefs/ (HST) for
    information on configuring CRDS.
Traceback (most recent call last):
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/jwst/stpipe/cmdline.py", line 297, in step_from_cmdline
    step.run(*positional)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/jwst/stpipe/step.py", line 392, in run
    self.prefetch(*args)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/jwst/stpipe/step.py", line 484, in prefetch
    self._precache_references(args[0])
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/jwst/stpipe/pipeline.py", line 166, in _precache_references
    self._precache_references_opened(model)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/jwst/stpipe/pipeline.py", line 189, in _precache_references_opened
    self._precache_references_impl(model_or_container)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/jwst/stpipe/pipeline.py", line 209, in _precache_references_impl
    crds_refs = crds_client.get_multiple_reference_paths(model, fetch_types)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/jwst/stpipe/crds_client.py", line 77, in get_multiple_reference_paths
    refpaths = _get_refpaths(data_dict, tuple(reference_file_types), observatory)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/jwst/stpipe/crds_client.py", line 106, in _get_refpaths
    data_dict, reftypes=reference_file_types, observatory=observatory)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/crds/core/heavy_client.py", line 122, in getreferences
    parameters, reftypes, context, ignore_cache, observatory, fast)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/crds/core/heavy_client.py", line 202, in _initial_recommendations
    mode, final_context = get_processing_mode(observatory, context)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/crds/core/utils.py", line 288, in __call__
    key, result = self._readonly(*args, **keys)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/crds/core/utils.py", line 275, in _readonly
    return key, self.uncached(*args, **keys)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/crds/core/heavy_client.py", line 389, in get_processing_mode
    info = get_config_info(observatory)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/crds/core/utils.py", line 288, in __call__
    key, result = self._readonly(*args, **keys)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/crds/core/utils.py", line 275, in _readonly
    return key, self.uncached(*args, **keys)
  File "/home/arun/anaconda3/envs/jwst_april/lib/python3.6/site-packages/crds/core/heavy_client.py", line 533, in get_config_info
    "You may be configured for the wrong project.  "
crds.core.exceptions.CrdsConfigError: CRDS server at 'https://jwst-crds.stsci.edu' is inconsistent with observatory 'tmt'. You may be configured for the wrong project.  Check CRDS_SERVER_URL and CRDS_OBSERVATORY environment settings.  See https://jwst-crds.stsci.edu/docs/cmdline_bestrefs/ (JWST) or https://hst-crds.stsci.edu/docs/cmdline_bestrefs/ (HST) for information on configuring CRDS.
zonca commented 4 years ago

are you running source setup_local_crds.sh and not bash setup_local_crds.sh? can you echo $CRDS_SERVER_URL to check it is correct?

zonca commented 4 years ago

also please paste the exact commands you are running, otherwise it is difficult for me to debug the issue.

arunsurya77 commented 4 years ago

So it was indeed the problem of using bash instead of source. Now it works. Thank you for your help. I will close this issue.

zonca commented 4 years ago

ok, just to be safe I added a warning in the script itself