Giter VIP home page Giter VIP logo

rubin_sim_notebooks's Introduction

rubin_sim_notebooks

Example notebooks for the rubin_sim package

rubin_sim_notebooks's People

Contributors

bregeon avatar bricmank avatar ebellm avatar ehneilsen avatar jeffcarlin avatar ktlim avatar nsabrams avatar rhiannonlynne avatar yoachim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rubin_sim_notebooks's Issues

Error running Scheduler_intro notebook

Hello,

I am trying to run scheduler_intro.ipynb to generate a list of observations and then schedule the simulated observations.

The generation of the list of observations is done in the following way:

class MySurvey(BaseSurvey):
   def generate_observations_rough(self, conditions):
       obs = empty_observation()
       obs['RA'] = np.radians(273.0)
       obs['dec'] = np.radians(-78.0)
       #obs['RA'] = 0
       #obs['dec'] = np.radians(-87)
       obs['exptime'] = 30.  # Seconds
       obs['nexp'] = 2
       obs['filter'] = 'r'
       # If it's been 12 hours or more, don't try to execute the observation anymore
       obs['flush_by_mjd'] = conditions.mjd + 1
       obs['note'] = 'mysurvey'  # Always good to set the note to which survey generated the observation
       # Make it a list of n
       result = [obs] * 7
       return result
       #print(empty_observation)

The simulated observations are scheduled using the following:

# Now to build our scheduler object, and run it for a day
scheduler = CoreScheduler([my_survey], nside=nside)
# sim_runner will return the updated model observatory, the updated scheduler, and an array of
# completed observations
mo, scheduler, observations = sim_runner(mo, scheduler,survey_length=1,
                                                verbose=True)

When the notebook is ran for the default RA and DEC given in the tutorial, it seems to be working fine. However, if the RA and DEC are changed to a different coordinates (described below) it seems to run into problems.

There are two different issues when the RA and DEC are changed:

The notebook runs perfectly fine when the RA is 228 deg or more and DEC is < -77, but seems to break once the RA and DEC are outside these limits.
Secondly, at times for some of the values of the RA and DEC that are within the above mentioned limits seems to not work for the notebook. For example:

  • Run 1: RA 360 DEC -77 works fine
  • Run 2: RA 350 DEC -77 works fine
  • Run 3: RA 360 DEC -77 doesnt work

The block above produces the following error:

RuntimeError                              Traceback (most recent call last)
[scheduler.ipynb](about:blank) Cell 10 line 7
      2 scheduler = CoreScheduler([my_survey], nside=nside)
      3 # sim_runner will return the updated model observatory, the updated scheduler, and an array of
      4 # completed observations
----> 7 mo, scheduler, observations = sim_runner(mo, scheduler,survey_length=1,
      8                                                  verbose=True)

File[ ~/.conda/envs/rubin-sim/lib/python3.11/site-packages/rubin_sim/scheduler/sim_runner.py:105](about:blank), in sim_runner(observatory, scheduler, filter_scheduler, mjd_start, survey_length, filename, delete_past, n_visit_limit, step_none, verbose, extra_info, event_table, record_rewards)
    102 if observatory.mjd == mjd_last_flush:
    103     #sush
    104     print(mjd_last_flush)
-->[ 105](about:blank)     raise RuntimeError("Scheduler has failed to provide a valid observation multiple times.")
    106 # if this is a first offence, might just be that targets set. Flush queue and get some new targets.
    107 scheduler.flush_queue()

RuntimeError: Scheduler has failed to provide a valid observation multiple times

I am running these in rubin_sim version 1.3.3 and with opsim baseline v3.3_10yrs
I was wondering if someone will be able to help me with this issue.

Extracting information about light curves in xrb_metric notebook

Hello,

I am working with the notebook 'xrb_metrics' and trying to understand if it is possible to get the information for the light curves in the form of a CSV file. The main objective for doing so is to be able to plot the light curves myself and do some further analysis. For example, a CSV consisting of the time, magnitude, magnitude err, filter, and source name/id would be the most helpful.

Any help on how to do this for the lightcurves produced by the notebook xrb_metric would be very much appreciated.

Thank you

Susmita

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.