Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSF config handling and checkpoint filename fixes for Run2.1i #211

Merged
merged 10 commits into from
Mar 6, 2019

Conversation

jchiang87
Copy link
Collaborator

No description provided.

@jchiang87
Copy link
Collaborator Author

@villarrealas There are a couple changes to the checkpoint filenames to note:

  • Checkpoint files now have names of the form checkpoint-<file_id>-Rxx_Syy.cpkt, instead of checkpoint-<file_id>-R_x_x_S_y_y.ckpt.
  • Checkpoint summary sqlite files have names of the form ckpt_<file_id>_<node_id>.sqlite3 instead of ckpt_<visit>_<node_id>.sqlite3.

@jchiang87 jchiang87 requested a review from cwwalter March 5, 2019 17:03
@jchiang87 jchiang87 marked this pull request as ready for review March 5, 2019 17:03
@coveralls
Copy link

coveralls commented Mar 5, 2019

Coverage Status

Coverage decreased (-0.1%) to 73.289% when pulling 22e48e2 on u/jchiang/read_config_fix into aa0f896 on master.

Copy link
Member

@cwwalter cwwalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few questions and suggestions below.

@@ -257,8 +257,8 @@ def run(self, processes=1, wait_time=None, node_id=0):
pool = multiprocessing.Pool(processes=processes)
receivers = []
if wait_time is not None:
results.append(pool.apply_async(process_monitor, (),
dict(wait_time=wait_time)))
results.append(pool.apply_async(TracebackDecorator(process_monitor),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is wrapping a function just like a decorator with @ would do. Could you also use it that way? If not, I wonder if it would be better to call it something like TracebackWrapper?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Decorator" has an established meaning as a standard design pattern, which this class satisfies. "Wrapper" also has an established design pattern meaning, which does not fit this class, so I think the current class name is the right one.

added_keywords: dict [None]
Python dict of key/value pairs to add to the primary HDU.
These will be set just before writing the FITS file, so
they will override any existing keywords.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add:

'they will override any existing keywords or be added to the header list if they don't exist.'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the option indicates that the keywords will be added and the first sentence of the description also says that they will be added. I think it's probably ok as-is.

visit = self.obs_md.OpsimMetaData['obshistID']
CHECKPOINT_SUMMARY \
= CheckpointSummary(db_file='ckpt_{}_{}.sqlite3'.format(visit, node_id))
db_file = 'ckpt_{}_{}.sqlite3'.format(self.file_id, node_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rational for using the file_id command line parameter here instead of the visit_id as before (and same question for the the checkpoint)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visit_id was too restrictive. If I want to put additional information in the checkpoint summary file name (e.g., the filter), then file_id is the better way to do it.


if not cp.read(config_file):
raise FileNotFoundError("Config file {} not found".format(config_file))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub isn't letting me comment on the line since it hasn't changed, but below here (on line 776) you are still calling read_config (right after the function definition). But you are now doing this on line 57 in bin/imSim.py.

Will this wipe out any parameters that were changed programmatically since then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The read_config here picks up the defaults so that I can pop into ipython and not have to call read_config explicitly if I want to do something simple, like read the observing parameters from an instance catalog or construct an obs_md object from it. The read_config call at https://github.com/LSSTDESC/imSim/blob/u/jchiang/read_config_fix/bin.src/imsim.py#L57 ensures that any user provided config is read in and will be used when the code is executed.

@@ -50,4 +50,4 @@ sort_magnorm = True
# FWHM in arcsec of the Gaussian to convolve with the baseline
# AtmosphericPSF + OptWF PSF to account for additional instrumental
# effects.
gaussianFWHM = 0.3
gaussianFWHM = 0.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have the results in a histogram from the multiple visits you ran of ellipticity etc from Javier yet, to know if this is the value we want to use?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had an extensive discussion on this at XWG computing group session on Wednesday of the DESC meeting, and everyone agreed that this was the value we should use.

@jchiang87 jchiang87 merged commit bdf137b into master Mar 6, 2019
@jchiang87 jchiang87 deleted the u/jchiang/read_config_fix branch March 6, 2019 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants