pRT2 notebook retrieval_multiple_data
pRT2
When running through the notebook: https://gitlab.com/mauricemolli/petitRADTRANS/blob/master/docs/content/notebooks/retrieval_multiple_data.ipynb Running the retrieval
I initially get the error:
Fortran runtime error: Cannot open file '/home/testswp/astrophysics/input_data/opacities/lines/corr_k/SO2/kappa_g_info.dat': No such file or directory
I then download the missing SO2 from: https://keeper.mpdl.mpg.de/d/ddcbba48fd58426cbacf/ and unzipped it into the above directory
I then run the code again and get the following error:
At line 38 of file petitRADTRANS/fort_input.f90 (unit = 10, file = '/home/testswp/astrophysics/input_data/opacities/lines/corr_k/SO2/kappa_g_info.dat')
If I look under the SO2 directory it has the following structure:
[testswp@hpc-login1 SO2]$ find
.
./32S-16O2
./32S-16O2/32S-16O2__ExoAmes.R1000_0.3-50mu.ktable.petitRADTRANS.h5
./kappa_g_info.dat <<< this files has zero bytes - was not part of zip file
So, I then moved the .h5 file from 32S-16O2 to SO2 directly (is that correct?) and then re-ran the code and get the following error:
Read line opacities of H2O_Exomol_R_300...
Done.
Read line opacities of CO_all_iso_HITEMP_R_300...
Done.
Read line opacities of CO2_R_300...
Done.
Read line opacities of CH4_R_300...
Done.
Read line opacities of SO2_R_300...
Done.
Read CIA opacities for H2-H2...
Read CIA opacities for H2-He...
Done.
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
File ~/astrophysics/retrieval_multiple_data.py:292
277 # If in doubt, define all of the plot_kwargs used here.
278
279
(...)
289 # If you want to run the retrieval, you need to choose a different output directory name,
290 # due to pRT requirements.
291 output_dir = f"{path_to_data}retrieval/examples/transmission/"
--> 292 retrieval = Retrieval(RunDefinition,
293 output_dir = output_dir,
294 sample_spec = False, # Output the spectrum from nsample random samples.
295 pRT_plot_style=True, # We think that our plots look nice.
296 ultranest=False) # Let's use pyMultiNest rather than Ultranest
298 # Default pymultinest retrieval setup, but with 400 live points
299 retrieval.run(sampling_efficiency=0.8,
300 const_efficiency_mode=False,
301 n_live_points=400,
(...)
309 importance_nested_sampling = True,
310 Lepsilon=0.3)
File ~/astrophysics/astrophysics-env/lib/python3.9/site-packages/petitRADTRANS/retrieval/retrieval.py:155, in Retrieval.__init__(self, run_definition, output_dir, use_MPI, sample_spec, ultranest, bayes_factor_species, corner_plot_names, short_names, pRT_plot_style, test_plotting)
153 self.setup_data()
154 try:
--> 155 self.generate_retrieval_summary()
156 except ValueError as e: # TODO check if ValueError was expected here
157 print(f"Could not generate summary file! Error was: {str(e)}")
File ~/astrophysics/astrophysics-env/lib/python3.9/site-packages/petitRADTRANS/retrieval/retrieval.py:404, in Retrieval.generate_retrieval_summary(self, stats)
402 for key, value in self.parameters.items():
403 if value.is_free_parameter:
--> 404 low = value.transform_prior_cube_coordinate(0.0000001)
405 high = value.transform_prior_cube_coordinate(0.9999999)
407 if value.corner_transform is not None:
File ~/astrophysics/retrieval_multiple_data.py:178, in <lambda>(x)
172 # Choose two of log_g, radius and mass priors
173 RunDefinition.add_parameter('log_g',True,
174 transform_prior_cube_coordinate = \
175 lambda x : 2.0+3.5*x)
176 RunDefinition.add_parameter('R_pl', True,
177 transform_prior_cube_coordinate = \
--> 178 lambda x : 0.8*rj+ (x*0.8*rj))
180 # Priors for Guillot 2010 Temperature Profile
181 RunDefinition.add_parameter("T_int", True,\
182 transform_prior_cube_coordinate = \
183 lambda x : 100 + 3500*x)
NameError: name 'rj' is not defined