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

Updates to use visitInfo Tickets/dm 6625 #17

Merged
merged 14 commits into from Nov 23, 2016
Merged

Updates to use visitInfo Tickets/dm 6625 #17

merged 14 commits into from Nov 23, 2016

Conversation

parejkoj
Copy link
Collaborator

Now that DM-5503 is done, it's time to get lsstSim to work without my FakeRef hack (and properly deal with all camera metadata) by using VisitInfo. This PR encompasses all of the work related to that.

Copy link

@isullivan isullivan left a comment

Choose a reason for hiding this comment

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

I mostly had formatting comments, since that was what many of the changes were about. My main concern is in the new tests, where you use both astropy arcsecond units and lsst.afw.geom.arcseconds. Please use just one if you can

pdb.set_trace()
# plt.show()
# import pdb
# pdb.set_trace()

Choose a reason for hiding this comment

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

Remove the commented-out debugging code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. All the plotting code is going to be pulled into another place soon.

"""Make quiver plots of the WCS deltas for each CCD in each visit."""

for cat in visitCatalogs:
fig = plt.figure()
fig.set_tight_layout(True)
# fig.set_tight_layout(True)

Choose a reason for hiding this comment

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

Remove commented-out code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

};

#endif /* ASSOCIATIONS__H */

}} // end of namespaces
}
} // end of namespaces

Choose a reason for hiding this comment

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

Looks like just changes in indentation, which look fine.


};


}}
}
}
#endif /* ASTROMFIT__H */

Choose a reason for hiding this comment

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

The new variable names are much more intuitive, thank you for updating them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was having enough trouble tracking one instance through multiple files...

//!
Point ParallacticVector() const {return Point(tgz*coseta, tgz*sineta);}
//!
Point RefractionVector() const {return Point(tgz * coseta, tgz * sineta);}

Choose a reason for hiding this comment

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

I thought our coding standards specified no space around multiplication operators.

Copy link
Collaborator Author

@parejkoj parejkoj Nov 22, 2016

Choose a reason for hiding this comment

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

Oof. I've updated my SublimeAStyleFormatter config (that's what did the cleanup) to not put spaces around operators. I'll see if I can easily get these sorted out manually.

# # first run of jointcal on this data. We should always do better than
# # this in the future!
# relative_error = 10e-3*u.arcsecond
# self._testJointCalTask(6, relative_error, absolute_error)

Choose a reason for hiding this comment

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

Remove this commented-out test (and line 52)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is in flux right now because the hsc data set changed recently. I'm going to leave it for when I sort out how to run on the new hsc data (I don't remember which set of visits goes with which).

from __future__ import division, absolute_import, print_function

import matplotlib
# Have to import matplotlib at the top level, because it can be imported by

Choose a reason for hiding this comment

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

Now the previous matplotlib import I saw makes sense.

import unittest
import os

from astropy import units as u

Choose a reason for hiding this comment

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

Could you just 'from astropy import units'? I find 'u' short and confusing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's the shorthand that astropy recommends: http://docs.astropy.org/en/stable/units/#getting-started

def setUp(self):
jointcalTestBase.JointcalTestBase.setUp(self)
self.do_plot = do_plot
self.match_radius = 0.1*lsst.afw.geom.arcseconds

Choose a reason for hiding this comment

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

Why are you using astropy arcseconds above, and lsst.afw.geom.arcseconds here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

afw.arcseconds doesn't behave well with matplotlib, but astropy does, whereas lsst needs the afw version for e.g. IcrsCoord constructors.. It's very unfortunate, but I don't think there's a way around it until we can e.g. construct afw objects with astropy units or have afw things behave better with matplotlib.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also: the way afw angles were being managed made it difficult for me to perform some of the calculations, but it was much easier to manage with astropy.

self._prep_reference_loader(center, radius)

self.input_dir = os.path.join(data_dir, 'twinkles1')
self.all_visits = range(840, 850)

Choose a reason for hiding this comment

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

If you hard-code in numbers, please explain them in a comment.

Copy link
Collaborator Author

@parejkoj parejkoj Nov 23, 2016

Choose a reason for hiding this comment

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

Those are the visits in the validation data set? They'll always be hard coded in (you always have to specify the visits for processing), and all_visits is documented in jointcalTestBase.py

Fixed camelCase and expanded some names in AstromFit and associated classes.

expTime isn't used anywhere, so why are we saving it?

Fix / and * operator spacing
Removed old star selector code: don't need it any more.

Remove old lsstSim hack to test on a fake catalog with run()

Remove unneeded imports from test_jointcal_lsstSim
@parejkoj parejkoj merged commit 2d8945e into master Nov 23, 2016
@ktlim ktlim deleted the tickets/DM-6625 branch August 25, 2018 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants