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

GCR reader for DC2 static coadd catalogs #157

Merged
merged 9 commits into from
May 30, 2018
Merged

Conversation

yymao
Copy link
Member

@yymao yymao commented May 1, 2018

This PR adds a GCR reader for the DC2 static coadd catalogs generated by @wmwv in #153 and also an example notebook of how to use it.

@wmwv
Copy link
Contributor

wmwv commented May 2, 2018

The LSST Project refers to its 'y' filter as lower-case, and I presume this will be the case for distributed data products as well.

@RobertLuptonTheGood
Copy link

HSC also calls it y. Y is usually reserved for the HgCdTe c. 1 micron band.

@wmwv
Copy link
Contributor

wmwv commented May 2, 2018

Expand patches back out as strings.

In the LSST current skymap scheme patches are strings. E.g., '0,4', 1,2' or '2,3'. It is often convenient to represent them as '04', '12', or '23', but those shouldn't be translated back into ints of 4, 12, 23. Such ints are of course unique, but it's less obvious how to get all of the patches in a given row or column and makes the neighbor relationship less clear.

@yymao
Copy link
Member Author

yymao commented May 2, 2018

thanks for the feedback!

Copy link
Contributor

@wmwv wmwv left a comment

Choose a reason for hiding this comment

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

I'm happy with this.

self.base_dir = base_dir or '/global/projecta/projectdirs/lsst/global/in2p3/Run1.1-test2/summary/'
assert os.path.isdir(self.base_dir), '{} is not a valid directory'.format(self.base_dir)
self._datasets, self._columns = self._generate_native_datasets_and_columns(self.base_dir)
assert self._datasets, 'No catalogs were found in {}'.format(self.base_dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer a try/except to these two asserts. An assert should generally be reserved for testing. Not finding a catalog because you mistyped a directory path shouldn't trigger an assertion. Or put another way, if you remove all of the asserts from code it should run the same way.

'dec': 'coord_dec',
}

for band in 'ugrizY':
Copy link
Contributor

Choose a reason for hiding this comment

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

Lower-case y

for band in 'ugrizy':

Capitalization of y-band filters has certainly drifted around, but at least for the past few years the LSST Project has been pretty consistent internally and externally about listing 'y'.

@@ -10,36 +10,45 @@

class DC2StaticCoaddCatalog(BaseGenericCatalog):

_native_filter_quantities = {'tract', 'patch'}
_native_filter_quantities = {'tract', 'patch_ra', 'patch_dec'}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like patch_ra and patch_dec, although I'm fine with dividing them up. There's nothing that says that patches have to be oriented along RA or Dec.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need an int lookup for something? Is there a reason you can't just have

_native_filter_quantities = {'tract', 'patch'}

but have patch be a str?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's programatically important to be able to iterate over patches in row, column. I just want the patch value to match the name the user will see in loading an image or otherwise looking up data by tract, patch.

Copy link
Member Author

Choose a reason for hiding this comment

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

@wmwv it surely can. I've updated per your suggestions. The only downside is that people cannot do (lambda p: p < 2, 'patch_ra') as a native filter, but I agree with you that this is probably not a common use case.

@wmwv
Copy link
Contributor

wmwv commented May 29, 2018

@yymao Could you merge this in in advance of the DESC Seminar tomorrow (May 30)?

@yymao
Copy link
Member Author

yymao commented May 29, 2018

Sure. If there's no objection I'll merge this tonight.

(cc @jchiang87 @katrinheitmann @cwwalter)

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