Changes between Initial Version and Version 1 of PublicPages/MayallZbandLegacy/NotesforObservers


Ignore:
Timestamp:
Apr 26, 2015 2:38:43 AM (10 years ago)
Author:
Robert Blum
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PublicPages/MayallZbandLegacy/NotesforObservers

    v1 v1  
     1= OBSERVING INSTRUCTIONS FOR MzLS =
     2
     3These are instructions for using the MzLS planning scripts for the nightly program. To see the Mosaic observing manual, go here: http://www.noao.edu/kpno/mosaic/manual.
     4
     5[[PageOutline]]
     6
     7Log on to the ?? account on the observer2 machine:
     8    Username : ?? [[BR]]
     9    Password : Ask Arjun, David, or previous observers [[BR]][[BR]]
     10
     11Two environment variables define the locations of data and code:
     12   '''$??_DATA=/home4/images/fits/2014B-0404''' -- This is where our raw data files are written [[BR]]
     13   '''$??_OBS=$HOME/observing''' -- This contains the observing product with code and versioned log files. [[BR]]
     14To set these, type "setenv ??_DATA /home4/images/fits/2014B-0404"
     15
     16Other directories in the home directory:
     17   '''idl/''' -- IDL products that we make use of, including the idlutils product and the Goodard libraries (a more current version than in idlutils, that does funpack) [[BR]]
     18   '''!ObservingStrategy/''' -- Outputs from Anna Patej's observing strategy code [[BR]]
     19   '''OBSOLETE/''' -- Obsolete code, data files, log files, etc. [[BR]]
     20   '''ps1/''' -- Doug Finkbeiner's Pan-STARRS1 catalogs used by the IDL DECSTAT routine for computing astrometric offsets and photometry [[BR]]
     21   '''rawdata@''' -- Convenient link to the raw data directory $??_DATA [[BR]]
     22
     23Documentation for the IDL scripts can be printed from the IDL prompt with the DOC_LIBRARY command, for example:
     24{{{
     25      IDL> doc_library,'decstat'
     26}}}
     27
     28
     29= Date convention =
     30
     31All dates in log files are set to the local date of the '''beginning of the night'''.  For example,
     32any data taken during the night of August 17/18, 2014 will be written as 2014-08-17.
     33This is consistent with how the NOAO Science Archive timestamps and saves the raw data files.
     34(This convention has changed from what we did at the start of the survey, but Greg has made
     35everything consistent.)
     36
     37
     38= Visualizing the available tiles (not required) =
     39
     40The IDL routine WHICHTILES_TONIGHT can be used to visualize the available tiles for the night:
     41{{{
     42IDL> whichtiles_tonight
     43SYNTAX: whichtiles_tonight,utdate,goodtiles,band,moonlimit=moonlimit,amlimit=amlimit
     44   Inputs:
     45       utdate - string - the UT date for the ''midpoint'' of the night (e.g., "2014-08-12")
     46       band - string - the observation band preferred (e.g., "g", "z", or "r") - default is "z"
     47   Keywords:
     48       moonlimit = minimum acceptable angle from the moon (default=20 deg)
     49       amlimit = maximum acceptable airmass (default=2.2)
     50       ps - string - name of an output postscript file; if not provided, defaults to a screen plot
     51   Output:
     52        goodtiles = boolean 1 or 0 for each tile in decam-tiles.fits
     53
     54To execute the program for a given night:
     55IDL> whichtiles_tonight,'2014-08-15',good,'z',ps='plan_zband_aug15ut'
     56IDL> whichtiles_tonight,'2014-08-15',good,'r',moonlimit=50,ps='plan_rband_aug15ut'
     57IDL> whichtiles_tonight,'2014-08-15',good,'g',moonlimit=100,amlimit=1.8,ps='plan_gband_aug15ut'
     58}}}
     59
     60These will produce encapsulated postscript files that are useful for visualizing the
     61possible fields for tonight.
     62
     63= Official Nightly Strategy =
     64'''Update 4/9/2015'''
     65Python is now available to the decals user. Do the following to update the current NMSL scripts at any time.
     66
     67        - login to the home directory of ??
     68        - cd observing
     69        - python2.7 py/nightlystrategy.py -t obstatus/mosaic-tiles_obstatus.fits -d 2015-04-08 -p 1 -pass 1 --moon-sep-limit 40 --start-date 2015-04-09 --start-time 02:00:00 -seez 1.15 -sbz 18.45 --dir /home/observer/exec/<dir_name>
     70
     71Assuming that uptiles is running in an IDL window on ??, this will always use the most up-to-date version of the mosaic-tiles_obstatus.fits file. Once this finishes running (usually a couple of minutes), cd to <dir_name>:
     72
     73        > ./mosaic_<UTdate>_plan.sh
     74
     75= Instructions and details for nightlystrategy.py =
     76'''written by A. Patej''' 
     77
     78nightlystrategy.py is a Python script that can generate a nightly observing plan. It requires several Python modules:
     79    - numpy
     80    - pylab (Matplotlib)
     81    - ephem (Pyephem)
     82    - pyfits
     83
     84=== Selection of Pass 1, 2, or 3 ===
     85
     86It is '''very important''' to adhere to the strategy of when to observe pass 1, 2, or 3 tiles,
     87in particular that pass 1 tiles are always in photometric good-seeing conditions.
     88The overall strategy is outlined at [[wiki:MayallZbandLegacy/ObservingStrategy]]].
     89
     90The strategy is as follows:
     91 * **Pass 1:** Photometric and seeing < 1.3 arc sec
     92 * **Pass 2:** Photometric or seeing < 1.3 arc sec, or all Pass 1 tiles completed
     93 * **Pass 3:** Unphotometric and seeing > 1.3 arc sec, or all Pass 1 and Pass 2 tiles completed
     94These need not be observed in any particular order, e.g. pass 3 observations can certainly
     95occur before pass 1.
     96
     97If conditions change, then you should definitely change to a different pass.
     98For example, if clouds begin to roll in, you should stop any pass 1 observations right away!
     99
     100=== Running the script ===
     101
     102At a minimum, the nightlystrategy.py script can be run with these inputs:
     103
     104    -t *name of file with tile centers* [[BR]]
     105    -d *UT date at ''start'' of night in format yyyy-mm-dd* [[BR]]
     106    -p *portion of night (1.0, 0.5 (first half), -0.5 (second half))* [[BR]]
     107    -pass *desired pass - input 1, 2, or 3* [[BR]]
     108    --dir *name of the dir where the output scripts are located*
     109For instance, to generate a pass 3 plan for the entire night of August 14, 2014, I could run:
     110{{{
     111python ./nightlystrategy.py -t moasic-tiles_obstatus.fits -d 2014-08-14 -p 1.0 -pass 3 --dir /home/observer/exec/mzls-utdate/
     112}}}
     113   
     114Additional optional arguments:
     1151. Observing conditions: [[BR]]
     116   -sb(f) *sky brightness in filter f; replace (f) = g, r, or z* [[BR]]
     117   -see(f) *seeing in filter f; replace (f) = g, r, or z* [[BR]]
     118   -transparency *value of the transparency* [[BR]]
     119
     1202. Observing constraints: [[BR]]
     121   --airmass-limit *maximum allowed airmass, default is 2.3* [[BR]]
     122   --moon-sep-limit *minimum allowed moon separation, default is 50.0 deg* [[BR]]
     123   --moon-alt-limit *moon altitude required for switching between z and g,r* [[BR]]
     124
     1253. Custom Scheduling: [[BR]]
     126  It's possible to create a plan for a specific block of time. To do so, use the following options:[[BR]]
     127  --start-date *Date of start of observations (UTC) in format yyyy-mm-dd; overrides the default start of night, which is calculated using --date and --portion. Requires --start-time to also be set* [[BR]]
     128  --start-time *Time of start of observations (UTC) in format hh:mm:ss; overrides the default start of night, which is calculated using --date and --portion. Requires --start-date to also be set*[[BR]]
     129  --end-date *Date of end of observations (UTC) in format yyyy-mm-dd; overrides the default end of night, which is calculated using --date and --portion. Requires --end-time to also be set*[[BR]]
     130  --end-time *Time of end of observations (UTC) in format hh:mm:ss; overrides the default end of night, which is calculated using --date and --portion. Requires --end-date to also be set*[[BR]]
     131
     132
     133More complicated example using these options: [[BR]]
     134Assuming 18.2 as z-band sky brightness, 1.2" seeing in z and 1.0" seeing in r, photometric conditions (pass 1) and allowing a moon separation of 40 deg and including DESI tiles:
     135{{{
     136python ./nightlystrategy.py -t mosaic-tiles_obstatus.fits -d 2015-03-24 -p 1.0 -pass 1 -sbz 18.2 -seer 1.0 -seez 1.2 --moon-sep-limit 40.0 --expand
     137}}}
     138
     139Example using custom scheduling: [[BR]]
     140To generate a plan for just two hours on the night that starts on 2015-04-06 between 05:00 and 07:00 UTC:
     141{{{
     142python ./nightlystrategy.py -t mosaic-tiles_obstatus.fits -d 2015-04-06 -p 1.0 -pass 1 --start-date 2015-04-07 --start-time 05:00:00 --end-date 2015-04-07 --end-time 07:00:00 --moon-sep-limit 40.0
     143}}}
     144
     145=== Outputs ===
     146
     147This script will yield 3 output data files:
     148
     149    1. text file called "strategy_mm-dd.txt", with information about all the pointings for the night (exp time, filter, approximately when they should be run, airmass, etc). If there's a late start or gap in observing due weather, etc you can look in this file and find the tile corresponding to your revised start time and remove all the ones prior to it in the Exposure Queue. It is a good idea to check this file before accepting the plan.
     150   
     151    2. JSON script called "decals_mm-dd_plan.json" for the night corresponding to the plan in this text file as well as some plots of what has been currently observed on previous nights and what you will be observing given the plan for the night, which are saved as a pdf, 'plot_plan_mm-dd.pdf' (gray = z, red = r, green = g)
     152
     153   3. A FITS file called "decam-tiles_obstatus_update_yyyy-mm-dd.fits" that is a temporary updated decam obstatus file that assumes all planned observations were completed. This should not be used during the run; instead use the updated tiles file obtained from running the idl program, uptiles (see section on "Creating the Updated Observing Status File" below).
     154
     155
     156= Updating the "observed tiles" file =
     157
     158The FITS file listing which tiles have been completed should be updated throughout the night.
     159This file is '''$DECALS_OBS/obstatus/decam-tiles_obstatus.fits'''.  The following IDL command
     160will monitor exposures as they are taken throughout the night, automatically updating this file:
     161{{{
     162   IDL> uptiles
     163}}}
     164
     165At the end of the night, you should check the updated tile file into the svn repository:
     166{{{
     167   cd $DECALS_OBS/obstatus
     168   svn commit obstatus/decam-tiles_obstatus.fits --username <YOUR-NAME>
     169}}}
     170
     171= Use of Steve Kent's tools for monitoring observing =
     172
     173During observing, please check frames as they read out. To use kenttools remotely, you must be
     174logged in as ''DECamObserver'' rather than as ''declsp''. To load kenttools log onto observer2 and
     175type "observer" at the unix shell prompt. This will load up an environment in which you can run the
     176kenttools commands.
     177
     178prompt>
     179
     180The following commands from kenttools are
     181very useful:
     182       center - find the RA and DEC offsets[[BR]]
     183       seeingall - measures the seeing[[BR]]
     184       psc - provides a heap of useful data[[BR]]
     185       bigload - display the last image[[BR]]
     186       load - display a single CCD from the last image[[BR]]
     187       inv - show an inventory of all the fits files taken during the night[[BR]]
     188
     189More details about kenttools can be found here:  https://cdcvs.fnal.gov/redmine/projects/desops/wiki/Introduction_to_kentools
     190
     191In addition to kenttools, there is an even more useful version of inv in godb called "qcInv". To use
     192this instead, log onto ?? as ?? " and type "godb" and then "qcInv" at the
     193''pgtcl>'' prompt.
     194
     195
     196= Checking the Sky Brightness, Seeing and Transparency  =
     197
     198The observing strategy files take as input these environmental conditions for
     199setting the exposure times to achieve the required MzLS survey depth.
     200
     201From an IDL prompt, use the DECSTAT routine to analyze the latest image on disk:
     202{{{
     203   IDL> decstat
     204}}}
     205There are keyword options that allow you to choose different exposure numbers or CCDs
     206within that exposure.  For example, to analyze chip 'S4' of the exposure number 123456, type:
     207{{{
     208   IDL> decstat, 123456, ext='S4'
     209}}}
     210The full documentation can be seen with:
     211{{{
     212   IDL> doc_library,'decstat'
     213}}}
     214
     215If the telescope pointing has gone off by more than about 30 arcsec (which happens!), then
     216this routine will likely fail to match stars.  In that case, the kenttools routine '''center''' described above
     217should be used to find the telescope offset.  Stop observing and ask the telescope operator to apply
     218a pointing offset.
     219
     220One can also check the observing progress using the almanac command:
     221  IDL> almanac, 10001, /noprint
     222will print out a summary of all the frames from 10001 to the present in a nice tabular form (widen the window).
     223This is useful for checking how the seeing and sky brightness have varied since frame 10001, and whether
     224one should create and upload a new JSON observing script. The /noprint just prevents the decstat output
     225for every frame; if you want to see that, then don't use the /noprint keyword.
     226
     227= Creating an almanac file with the observations for the night =
     228
     229At the end of the night, an almanac file should be generated for the night and checked into svn.
     230{{{
     231cd $??_OBS/observing/logs
     232idl
     233   almanac, <START-EXPOSURE>, <END-EXPOSURE>
     234   exit
     235svn add Almanac*
     236svn commit Almanac*
     237}}}
     238For example, for the night of March 26/27, 2015, this is done with:
     239{{{
     240cd $DECALS_OBS/observing/logs
     241idl
     242   almanac, 424978, 425143
     243   exit
     244svn add Almanac_2015-03-26.*
     245svn commit Almanac_2015-03-26.*
     246}}}
     247
     248There are actually two versions of this file, one that is an ASCII file (with .txt extension)
     249and one that is a FITS file (with .fits extension).
     250
     251= Writing the human logs =
     252
     253Please write about what happened during your night: weather conditions, which pass you observed,
     254and telescope problems.  Follow the example on the pages at [wiki:DecamLegacy/ObservingLogs].
     255
     256Catastrophically bad frames (such as saturated frames, or where the telescope moved) are recorded
     257and svn-checked-in to  '''observing/logs/bad_expid.txt'''.
     258
     259Historically, we also made some files in $DECALS_OBS/logs/logfile-$DATE.txt that are
     260output from the kenttools "inv" command.  These are probably not really needed any longer.
     261
     262= In case of technical difficulties =
     263
     264We have in the past encountered technical difficulties that have restricted where we can observe to a specific range in RA/Dec. For instance, in April 2015, we had a night during which the windscreen was stuck, requiring us to stick to dec < -5 deg tiles.
     265
     266If this happens during your run, you have several options:[[BR]]
     2671. First, try running nightlystrategy.py with an appropriate --airmass-limit and/or --moon-sep-limit to try to keep to the required range of tiles. [[BR]]
     2682. If you run out of tiles with these options, add the --expand option, which allows the selection of DESI tiles in addition to SDSS tiles, in addition to any airmass-limit you need.
     2693. '''Shorten''' your observing period (using --start-date,--start-time and --end-date,--end-time)  such that it's scheduling fewer tiles.
     2704. Increase the assumed seeing such that it schedules longer exposures.
     271
     272If these options don't work, you will have to modify our observing footprint, which is encoded in decam-tiles_obstatus.fits. This file has, among other things, three columns named 'IN_SDSS', 'IN_DESI', and 'IN_DES'. For each tile the value in these columns is either 1 or 0.
     273
     274We define our fiducial footprint as 'IN_SDSS' = 1 & 'IN_DES' = 0. If you allow the selection of DESI tiles (using --expand), then the footprint is defined by ( 'IN_SDSS' = 1 & 'IN_DES' = 0 ) or ( 'IN_DESI' = 1 & 'IN_DES' = 0). If you have no tiles to observe that are within the region defined this way, you need to modify the tiles file.
     275
     276In this case, please do the following:
     2771. Make a copy of decam-tiles_obstatus.fits (call it something like temp_decam-tiles_yyyy-mm-dd.fits)
     2782. Open temp_decam-tiles_yyyy-mm-dd.fits using your favorite fits file editor (python/pyfits, idl, etc) and modify the file to set 'IN_SDSS' = 0 & 'IN_DESI' = 0 for all tiles that are outside the range allowed by the telescope that night. Then set 'IN_SDSS' = 1 & 'IN_DESI' = 1 for tiles that satisfy your allowed RA/dec range and also some possible quality constraints. For instance, in April 2015, David suggested adding the following tiles to satisfy dec < -5:
     279{{{
     280a) IN_DESI = 0
     281b) EBV_MED < 0.1
     282c) 120 < RA < 270
     283d) DEC > -19
     284}}}
     2853. Use the modified temp_decam-tiles_yyyy-mm-dd.fits as your -t argument in nightlystrategy. For instance,
     286{{{
     287python ./nightlystrategy.py -t temp_decam-tiles_yyyy-mm-dd.fits -d yyyy-mm-dd -p 1.0 -pass 3 --expand
     288}}}
     289
     2904. Set two versions of uptiles running, one to update the official "decam-tiles_obstatus.fits" file, so that we have an official record of the tiles being observed, the other to update 'temp_decam-tiles_yyyy-mm-dd.fits,' which you can use to recalculate the JSONs if conditions change. You can run uptiles as follows:
     291{{{
     292uptiles
     293uptiles, tfile='temp_decam-tiles_yyyy-mm-dd.fits'
     294}}}
     295
     2965. At the end of the night, make sure check in decam-tiles_obstatus.fits to svn; you can leave 'temp_decam-tiles_yyyy-mm-dd.fits' on observer2, or place it in a temp folder on svn.
     297
     298
     299= Example run-through for a given night =
     300
     301Log into the declsp account on the observer2 machine.
     302{{{
     303user@anyshell>ssh declsp@observer2
     304}}}
     305
     306=== Update everything ===
     307
     308Update the code, log files and most importantly the tile file:
     309{{{
     310cd ~/observing
     311svn update
     312}}}
     313
     314=== Create nightly plan ===
     315
     316Create the nightly plan from the available tiles.  This will read the tile file to see which ones are already completed.
     317{{{
     318cd ~/observing
     319python2.7 py/nightlystrategy.py -t obstatus/decam-tiles_obstatus.fits -d *UT date at ''start'' of night* -p *portion of night* -pass *pass number*
     320}}}
     321
     322The output JSON file is then loaded into SISPI. The DECaLS JSONS that will be loaded into SISPI should be placed in observer2.ctio.noao.edu:/usr/remote/user/DECamObserver/ExposureScripts/User_scripts/BigProjects/DECaLS/
     323
     324In the observer console, select the tab "Exposure Control" and press "Load Exposure Script." Select your JSON and press "submit." The exposures will then be appended to the bottom of the Exposure Queue.
     325
     326You can manually modify the exposure queue. Make sure the padlock icon is unlocked if you wish to make changes. You can select a queued exposure by clicking on it; you can press "delete" to delete it, or use your cursor to click and drag it to a new position. To select a range of exposures, click on the first one, then shift+click on the last one.
     327
     328=== Start the automated script for updating the tile file ===
     329
     330From a terminal in the declsp account, start this running:
     331{{{
     332idl
     333   uptiles
     334}}}
     335
     336From another terminal in the declsp account, start this running:
     337{{{
     338idl
     339   decstat_continuous
     340}}}
     341This will run decstat on each frame as it shows up and display the results on the screen.
     342
     343=== Start a window for running kenttools ===
     344
     345Kenttools can only be run as the "DECamObserver", and not from our "declsp" account.  (It was possible to do directly from
     346our account before March 2015, so something changed.)
     347
     348Open a new window logged in as ''DECamObserver'' on observer2:
     349{{{
     350observer> observer
     351prompt> inv
     352}}}
     353
     354=== Create the Almanac and Almanac plot files  ===
     355
     356At the end of the night, create the Almanac files and check them into svn.
     357{{{
     358- cd observing/logs
     359- idl
     360- almanac,<first exp num>
     361- plotalmanac,'Almanac_date.fits',ps='plot_Almanac_date'
     362- exit
     363- svn add *Almanac_date*
     364- svn commit
     365}}}
     366
     367=== Create a log file ===
     368{{{
     369- cd logs/
     370- observer (kent tootls on observer1)
     371- inv
     372- cut and paste the output from the first exposure number to the bottom
     373  into a file log_date.txt (on observer2)
     374- use this file to determine the number of g, r, and z images for the
     375  summary table on the wiki: grep " g " log_date.txt | wc
     376}}}
     377
     378=== Generating a Coverage Map ===
     379
     380The code pro/coverage_plot.pro will generate coverage maps for a given date range using the info in decam-tiles_obstatus.fits.  To run it, login as declsp@observer 2 and start IDL:
     381{{{
     382IDL>.com coverage_plot
     383}}}
     384To produce the plot for a single night use, for example:
     385{{{
     386IDL> coverage_plot, datemin='2015-04-07', datemax='2015-04-07'
     387}}}
     388To produce a plot for a range of nights use:
     389{{{
     390IDL> coverage_plot, datemin='date-start', datemax='date-end'
     391}}}
     392To produce a plot for all nights to date use:
     393{{{
     394IDL> coverage_plot
     395}}}
     396All plots will be put in $DECALS_OBS/obstatus/Plots.  The default is to output a PDF but there are flags to output other formats. 
     397
     398The code pro/coverage_plot_alldates.pro will produce a set of cumulative coverage plots (one per day) over a date range.  Within IDL when logged in as declsp@observer2 you enter:
     399{{{
     400IDL> .com coverage_plot_alldates
     401IDL> coverage_plot_alldates, datemin='date-start', datemax='date-end'
     402}}}
     403
     404All plots, consecutively numbered, will be put in $DECALS_OBS/obstatus/Plots/PDFs and can be combined into a movie, e.g with the free graphicconverter [http://www.lemkesoft.de/en/image-editing-slideshow-browser-batch-conversion-metadata-and-more-on-your-mac/] program on Macs. 
     405
     406Ben Weaver would prefer that we do not upload any plots to SVN but rather just the code.  So feel free to mail plots around but there is no need to check them in.
     407
     408[[BackLinks]]