astro-datalab / notebooks-latest

Default set of Data Lab notebooks, by DL team and contributed by users
BSD 3-Clause "New" or "Revised" License
60 stars 48 forks source link

Replicate DESI's official database tutorial notebook #176

Closed weaverba137 closed 1 year ago

weaverba137 commented 1 year ago

This PR adds a notebook that tries to replicate the functionality of DESI's official database tutorial as closely as possible.

The official notebook has not yet been finalized, so this PR is also a Work In Progress.

weaverba137 commented 1 year ago

@jacquesalice @rnikutta @stephjuneau, today is a very busy day, but I hope I can test this later today or on Tuesday.

One question is: does this notebook overlap in functionality with other DESI EDR notebooks that are also in the pipeline?

stephjuneau commented 1 year ago

Hi Ben, possibly a little bit of overlap with the Intro to DESI EDR notebook here (https://github.com/astro-datalab/notebooks-latest/pull/175) which I'm reviewing. However, I will request a change to use only the zpix table for the main query for that one. This means that there will no longer be an example joint query so it will be valuable to have several different queries like the ones demonstrated in the database notebook. (That said, tomorrow will be fine for the database notebook if today is tight!)

weaverba137 commented 1 year ago

Thank you @stephjuneau!

weaverba137 commented 1 year ago

Thank you for the comments. This is indeed still a work in progress, so I will be sure to incorporate the suggested changes.

weaverba137 commented 1 year ago

@jacquesalice @stephjuneau this is now ready for review.

  1. I addressed all of @jacquesalice 's previous comments.
  2. I picked the directory arbitrarily, so if this notebook should be moved elsewhere, please let me know.
  3. I have not generated an HTML copy yet.
rnikutta commented 1 year ago

Hi @weaverba137 Hoping that it helps speeding up the merge process, I've just reviewed your NB. It runs a flows very well. Just a few small comments:

  plt.bar(pd.to_datetime(response['night'],format="%Y%m%d"),response['n_exp'],width=1)   
  plt.xlabel('date')
  plt.ylabel('n_exp')

(needs an import pandas as pd up front)

  %%time
  # This will run for ~1 minute
  # foo = axes.legend(loc=1)

For the location of the NB in the tree, I'm swinging between here, and 03_ScienceExamples/DESI/, but think I prefer here more, as it's a technical NB.

weaverba137 commented 1 year ago

OK, I've addressed everything, please take a look. However, I kept the from desitarget.targetmask import (desi_mask, mws_mask, bgs_mask), and now I'm actually using desi_mask.

I've also added an HTML version.

I can make further changes until about 12:00 MST, but earlier would be better.

rnikutta commented 1 year ago

Thanks @weaverba137

weaverba137 commented 1 year ago

OK, I'll make those changes momentarily.

weaverba137 commented 1 year ago

OK, should be good to go.

rnikutta commented 1 year ago

@jacquesalice Can you please sign off on your review of @weaverba137 's NB? I currently can't merge (without overriding) unless you sign off on it ;-) Thanks.

stephjuneau commented 1 year ago

Hi @rnikutta @weaverba137 @jacquesalice I think it's already been agreed to leave this notebook in the HowTos/ folder. I wanted to mention that I suggesting linking it among a compilation of notebook links for a short Mirror article on DESI EDR. I'm not sure whether the compilation of links will make it to the final publication, but I'm giving it a try! Also, I propose adding a README file to the 03_ScienceExamples/DESI/ folder to point to that notebook and to the HowTo on SPARCL. I will work on this today and send it for approval.

rnikutta commented 1 year ago

Sounds good @stephjuneau . I'll merge after your commit.

stephjuneau commented 1 year ago

Hi @rnikutta this branch doesn't have the DESI/ folder with Raga's notebooks. Should I go ahead and add those as well then? That's the folder where I'm planning on adding a README.

Edit: I'm also happy to do a separate branch after this one is merged.

rnikutta commented 1 year ago

Better start a new branch, and a new PR @stephjuneau . I'll merge Ben's branch now, so that it shows up on master. (sorry @jacquesalice , going to override!)

rnikutta commented 1 year ago

@stephjuneau Merged!