text:
## atmo2mags README / Tutorial

Sections:
- [Prerequisites and Installation](#prerequisites-and-installation)
- [Background Science and Equations](#background-science-and-equations)
- [The Basics: Initialize AtmoBuilder](#the-basics-initialize-atmobuilder)
- [The Basics: Atmo Object](#the-basics-atmo-class)
- [The Basics: SED Types](#the-basics-sed-types)
- [The Basics: Simple Operations](#the-basics-simple-operations)
- [Regressions: Two Parameters](#regressions-two-parameters)

### Prerequisites and Installation

If you are viewing this notebook through notebookviewer online and wish to install and use AtmoBuilder then please clone the [github repository](#https://github.com/moeyensj/atmo2mags) to get started.

AtmoBuilder requires the following to installed and appropriately sourced (including all pre-requisite software):
    - LSST Software Stack
        - sims_photUtils
        - sims_sed_library
    - AstroML

AtmoBuilder's wavelength gridding is limited by the availabe MODTRAN data. As a result this requires the PhysicalParameters.py in sims_photUtils to be altered as follows:

Stack Default:
    - minwavelen = 300
    - maxwavelen = 1150.1
    - wavelenstep = 0.1

Required by AtmoBuilder:
    - minwavelen = 300
    - maxwavelen = 1100
    - wavelenstep = 0.5

In the future this step may not be necessary, keep an eye out on updates to the github repository!

### Background Science and Equations

Atmospheric extinction can be modeled by 5 individual components: molecular (Rayleigh) scattering,
aerosol (Mie) scattering, molecular absorption by ozone (O$_3$), water vapor and combined O$_2$ trace species (see Section 5.2 in LSST document LSE-180):

$$S^{atm}(\lambda) = \Pi_{k=1}^5 \, {\rm e}^{- t_k \, \tau_k^{std}(\lambda, X)}
                           =  {\rm e}^{-\sum_{k=1}^5  t_k \, \tau_k^{std}(\lambda, X)}$$

Here $X$ is airmass, $t_k$ is the ratio of the column density (or optical depth) of the $k$-th
component and its value for the standard atmosphere, and $\tau_k^{std}(\lambda, X)$ is the
wavelength-dependent optical depth of the $k$-th component for the standard
atmosphere (with $t_k=1$) viewed at airmass $X$.

Aerosol (Mie) scattering data is not provided with MODTRAN data and has been modeled with a power-law relationship:

$ \tau_{aerosol}(\lambda, X, \alpha) = 0.1 \, X \, \left({550 \, {\rm nm} \over \lambda} \right)^\alpha $

The power-law exponent ($\alpha$) is chosen to be the 6th free parameter when modeling atmospheres. In summation, we can define a single parameter array of $t_k$ values for each of the 5 extincton components and 1 for the power-law exponent:

$ [t_{H_2O}, t_{O_2}, t_{O_3}, t_{Rayleigh}, t_{Aerosol}, t_{\alpha}] $

The standard atmosphere is defined by the following parameter array and airmass:

    - P: [1.0,1.0,1.0,1.0,1.0,1.7]
    - X: 1.2

In order to create an atmosphere for use with AtmoBuilder, a parameter array and airmass like the one above must be given. Details on the specific procedure can be found in the following sections.

### The Basics: Initialize AtmoBuilder

Importing the AtmoBuilder class:

```python
from atmo2mags import AtmoBuilder

% matplotlib inline
```

Initializing the class:

```python
ab = AtmoBuilder()
```

    Found 16 MODTRAN files:
    Pachon_MODTRAN.10.7sc
    Pachon_MODTRAN.11.7sc
    Pachon_MODTRAN.12.7sc
    Pachon_MODTRAN.13.7sc
    Pachon_MODTRAN.14.7sc
    Pachon_MODTRAN.15.7sc
    Pachon_MODTRAN.16.7sc
    Pachon_MODTRAN.17.7sc
    Pachon_MODTRAN.18.7sc
    Pachon_MODTRAN.19.7sc
    Pachon_MODTRAN.20.7sc
    Pachon_MODTRAN.21.7sc
    Pachon_MODTRAN.22.7sc
    Pachon_MODTRAN.23.7sc
    Pachon_MODTRAN.24.7sc
    Pachon_MODTRAN.25.7sc
    MODTRAN files have been read.

    Read filter data from LSST software stack.
    Filters: ['u', 'g', 'r', 'i', 'z', 'y4']
    Read hardware data from LSST software stack.

When initialized AtmoBuilder will output the code above to notify you that it has found and read MODTRAN data, and that it has found filter and hardware data from the LSST software stack.

Retrieving MODTRAN data:

```python
# List of read airmasses
ab.airmasses
```

    ['1.000',
     '1.100',
     '1.200',
     '1.300',
     '1.400',
     '1.500',
     '1.600',
     '1.700',
     '1.800',
     '1.900',
     '2.000',
     '2.100',
     '2.200',
     '2.300',
     '2.400',
     '2.500']

```python
# Standard transmission profile keyed to airmass and component
ab.transDict[1.2]['Rayleigh']
```

    array([ 0.    ,  0.3524,  0.3551, ...,  0.9949,  0.9949,  0.9949])

Plotting the filter and hardware response curves (hardware includes filters):

```python
ab.filterPlot()
```

![png](README/output_18_0.png)

```python
ab.hardwarePlot()
```

![png](README/output_19_0.png)

### The Basics: Atmo Class

AtmoBuilder utilizes an independent atmo object which keeps track of several useful elements. Let's start by creating two atmospheres:

```python
atmo = ab.buildAtmo([1.0,1.0,1.0,2.2,1.4,1.7],1.4)
atmo_std = ab.buildAtmo([1.0,1.0,1.0,1.0,1.0,1.7],1.2)
```

The line of code above has two important keyword parameters:
    - P: parameter array containing 6 values, one for each of the atmospheric extinction components
    - X: airmass

Retrieving atmo attributes:

```python
# Parameters and airmass
atmo.P, atmo.X
```

    ([1.0, 1.0, 1.0, 2.2, 1.4, 1.7], 1.4)

```python
# Total transmission [array]
atmo.sb
```

    array([  0.00000000e+00,   5.62775604e-04,   7.80424731e-04, ...,
             7.95777857e-01,   7.87900709e-01,   7.91135642e-01])

```python
# Individual component transmission profiles [component-keyed dictionary]
atmo.sbDict
```

    {'Aerosol': array([ 0.54288017,  0.54343224,  0.54398304, ...,  0.84640984,
             0.84647403,  0.84653816]),
     'H2O': array([ 0.    ,  1.    ,  1.    , ...,  0.9525,  0.943 ,  0.9468]),
     'O2': array([ 0.,  1.,  1., ...,  1.,  1.,  1.]),
     'O3': array([ 0.    ,  0.015 ,  0.0204, ...,  1.    ,  1.    ,  1.    ]),
     'Rayleigh': array([ 0.        ,  0.06903965,  0.07032593, ...,  0.98706593,
             0.98706593,  0.98706593])}

AtmoBuilder has a lot of various plotting functions including one for atmospheres. The following function will take an atmo object and plot its transmission profile:

```python
ab.transPlot(atmo)
```

![png](README/output_29_0.png)

AtmoBuilder can also plot the individual components:

```python
ab.transPlot(atmo, includeComponents=True)
```

![png](README/output_31_0.png)

Want to compare the atmosphere to another atmosphere?

```python
ab.transPlot(atmo, atmo2=atmo_std)
```

![png](README/output_33_0.png)

Of course, keeping track of a standard atmosphere like the one we created can become laborious. To avoid this, internally in AtmoBuilder there are class constants which define the parameters and airmass for a standard atmosphere. For all major functionality you need not worry about keeping track of the the standard atmosphere. For example:

```python
ab.transPlot(atmo,includeStdAtmo=True)
```

![png](README/output_35_0.png)

### The Basics: SED Types

In order to run regressions and to use many of the basic operations and functions in AtmoBuilder we need SED data to be read in. This is not done when the class is initialized because it can take a fair amount of time depending on how many SEDs you want to read in.

By default AtmoBuilder uses six SED types:
    - Kurucz Main Sequence Stars (read from LSST's SED library) ['mss']
    - White Dwarf Stars (read from LSST's SED library) ['wds']
    - Galaxies (generated at different redshifts from LSST's SED library) ['gals']
    - MLT Dwarf Stars (read from LSST's SED library) ['mlts']
    - Quasars (generated at different redshifts from AtmoBuilder repository) ['qsos']
    - Supernovae (generated at different redshifts from AtmoBuilder repository) ['sns']

Reading in Kurucz MS stars:

```python
ab.readMSs()
```

    # Read 988 MS stars from /Users/joachim/lsst/DarwinX86/sims_sed_library/2014.10.06/starSED/kurucz/

You can call similar functions for each of the six SED types to read them. If you want to use all of the available SED types (or a large subset) you can call the following (this will take a little bit of time):

```python
ab.readAll()
```

    # Read 988 MS stars from /Users/joachim/lsst/DarwinX86/sims_sed_library/2014.10.06/starSED/kurucz/
    # Read 849 white dwarfs from /Users/joachim/lsst/DarwinX86/sims_sed_library/2014.10.06/starSED/wDs/
    # Read 74 mlt stars from /Users/joachim/lsst/DarwinX86/sims_sed_library/2014.10.06/starSED/mlt/
    # Generated 2520 galaxies at redshifts between 0.000000 and 3.000000
    # Generated 76 quasars at redshifts between 0.000000 and 7.500000
    # Generated 39 sn's at redshifts between 0.000000 and 1.200000 on days ['0', '20', '40']

If you want to run some simple operations it may be helpful to retrieve the SED data you read in. With AtmoBuilder it is remarkably easy to do so as it is all stored as class attributes. Lets retrieve some quasar data:

```python
qso = ab.qsos
qso_z = ab.qsoRedshifts
```

We can see what the SED attributes are set when SED data is read in two ways:

```python
ab?
```

... or we can look at each of the individual SED read functions:

```python
ab.readMSs?
```

### The Basics: Simple Operations

Once you have some SED data read in you can use them to calculate magnitudes, delta magnitudes, and so on...

Lets combine hardware data and an atmosphere object to get the combined throughput:

```python
throughput = ab.combineThroughputs(atmo)
throughput_std = ab.combineThroughputs(atmo_std)
```

We can then also plot the combined throughput:

```python
ab.throughputPlot(throughput)
```

![png](README/output_53_0.png)

Like transPlot, we can plot two throughputs or include the standard throughput:

```python
ab.throughputPlot(throughput, bpDict2=throughput_std)
ab.throughputPlot(throughput, includeStdAtmo=True)
```

![png](README/output_55_0.png)

![png](README/output_55_1.png)

A characteristic function we care about is the normalized bandpass response function for a given throughput. The phi function can be retrieved from a filter-keyed bandpass dictionary as follows (example for u filter):

```python
throughput['u'].phi
```

    array([  0.00000000e+00,   2.41980424e-10,   6.86163658e-10, ...,
             4.21530335e-10,   3.53349898e-10,   5.46307213e-19])

Because these throughputs are bandpass objects, you can also access the wavelength range and the overall throughput:

```python
throughput['u'].sb
```

    array([  0.00000000e+00,   1.06043522e-09,   3.01199080e-09, ...,
             6.75594271e-09,   5.66577908e-09,   8.76373126e-18])

```python
throughput['u'].wavelen
```

    array([  300. ,   300.5,   301. , ...,  1099. ,  1099.5,  1100. ])

AtmoBuilder can also plot phi functions:

```python
ab.phiPlot(throughput)
```

![png](README/output_62_0.png)

Of course it might be handy to compare one phi function to another:

```python
ab.phiPlot(throughput,throughput_std)
```

![png](README/output_64_0.png)

AtmoBuilder can also plot the change in normalized bandpass response function:

```python
ab.dphiPlot(throughput, throughput_std)
```

![png](README/output_66_0.png)

We might want to compare one dphi to another:

```python
throughput_temp = ab.combineThroughputs(ab.buildAtmo([2.3,2.1,1.2,0.9,1.3,1.8],1.4))
ab.dphiPlot(throughput, throughput_std, throughput_temp)
```

![png](README/output_68_0.png)

Sometimes its hard to really see the difference between two phi functions as is often the case when plotting regression data. We can use the ddphiPlot to plot the difference between to dphis in the form of a subtraction between them:

```python
ab.ddphiPlot(throughput,throughput_temp,throughput_std)
```

![png](README/output_70_0.png)

Using the throughput we can calculate the magnitudes of stars we read in (defaults to using Kurucz MS SEDs)

```python
mags = ab.mags(throughput)
mags_std = ab.mags(throughput_std)
```

Or we can calculate the magnitudes and change in magnitudes of other SEDs:

```python
qso_mags = ab.mags(throughput, seds=qso, sedkeylist=qso_z)
qso_mags_std = ab.mags(throughput_std, seds=qso, sedkeylist=qso_z)
```

    AtmoBuilder.py:884: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
      if sedkeylist == None:

```python
dmags = ab.dmags(mags, mags_std)
qso_dmags = ab.dmags(qso_mags, qso_mags_std)
```

Both mags and dmags are returned as filter-keyed dictionaries of magnitudes:

```python
mags['u']
dmags['u']
```

    array([ -60.23624135,  -60.40850702,  -60.56826619,  -60.74566544,
            -60.91177112,  -61.08369099,  -61.25698358,  -61.99937469,
            -62.66635849,  -63.32696276,  -64.00057694,  -64.66445761,
            -65.33650774,  -66.00255451,  -66.66112885,  -67.33962434,
            -68.01727869,  -68.68508883,  -69.3486042 ,  -69.68886445,
            -69.91999707,  -70.15160589,  -70.3832493 ,  -70.60231546,
            -70.83213889,  -71.05492605,  -71.28677986,  -71.51070901,
            -71.73450645,  -71.95922916,  -72.18802748,  -72.41771595,
            -72.53058869,  -72.72820371,  -72.93014927,  -73.132368  ,
            -73.33655565,  -73.53354453,  -73.73531967,  -73.94081379,
            -74.13836494,  -74.34397373,  -74.53915895,  -74.73827928,
            -74.9433136 ,  -75.04396874,  -59.52402349,  -59.69855054,
            -59.87310733,  -60.0551013 ,  -60.22616858,  -64.55743204,
            -65.23532682,  -65.9216536 ,  -66.59582775,  -67.27782341,
            -67.96125851,  -68.64347645,  -69.32404503,  -69.66348194,
            -69.90049712,  -70.14033457,  -70.36996138,  -70.60783434,
            -70.84684351,  -71.07597787,  -71.32100036,  -71.55846612,
            -71.78867348,  -72.02556848,  -72.25842021,  -72.49352107,
            -72.61787325,  -72.82266811,  -73.02214165,  -73.2315028 ,
            -81.27689532,  -81.62754728,  -81.97118041,  -82.31789381,
            -76.01767967,  -75.39459305,  -74.79016611,  -74.19762842,
            -73.61790584,  -73.05243811,  -72.49593438,  -77.06009157,
            -77.34977956,  -77.63712864,  -77.92769151,  -53.13487875,
            -53.17204579,  -53.20372047,  -53.23868547,  -74.52555866,
            -74.44455135,  -74.36559598,  -60.61545957,  -74.3316647 ,
            -74.32737852,  -74.32483912,  -74.32443684,  -74.32503356,
            -74.33166749,  -74.35387338,  -74.3688597 ,  -74.39606558,
            -74.4169389 ,  -74.44510294,  -74.48307664,  -74.51990728,
            -58.16282678,  -57.91452287,  -57.68063794,  -57.45445311,
            -57.21993644,  -57.00045331,  -56.7810099 ,  -56.57767205,
            -56.35062053,  -56.15995865,  -55.95081383,  -55.75049548,
            -55.56084755,  -74.54147212,  -74.62642796,  -74.70444065,
            -74.7865556 ,  -74.87225916,  -74.96549384,  -75.05287665,
            -75.14097372,  -75.23394256,  -75.31929274,  -75.41676617,
            -75.50843317,  -75.60408753,  -55.4626833 ,  -55.2990263 ,
            -55.14843755,  -54.99466203,  -54.84151896,  -54.69055569,
            -54.54452003,  -54.40485222,  -54.2622259 ,  -54.12204818,
            -53.98483925,  -53.71759728,  -75.65001982,  -75.8503057 ,
            -76.0455661 ,  -76.24235527,  -76.44127804,  -76.63895707,
            -76.83761866,  -77.03730666,  -77.23602519,  -77.43618269,
            -77.63486273,  -77.83232918,  -78.03556837,  -53.64882934,
            -53.51646906,  -53.38853758,  -53.25523235,  -53.12632906,
            -53.00275709,  -52.87204056,  -52.75043919,  -52.62236111,
            -52.49420722,  -78.13389795,  -78.44596891,  -78.75953864,
            -79.07167419,  -79.38301796,  -79.69936356,  -80.00943957,
            -80.31960105,  -80.63038525,  -80.94461882,  -81.25315381,
            -81.56445003,  -81.88067133,  -51.48921194,  -51.4156024 ,
            -51.34699472,  -82.03337031,  -82.3956664 ,  -82.74751966,
            -83.11960392,  -83.4760254 ,  -76.64269017,  -76.43570475,
            -76.23346998,  -76.04249687,  -75.8254595 ,  -75.63051196,
            -75.43058508,  -75.22554744,  -75.03250423,  -74.82962963,
            -74.63609879,  -74.15640921,  -74.1500809 ,  -74.15745049,
            -74.15213616,  -74.16100426,  -74.15392265,  -74.15901407,
            -74.15574484,  -74.16134754,  -74.16677407,  -74.16903447,
            -74.16777365,  -74.17282006,  -54.26554062,  -53.97204235,
            -53.67362206,  -53.38425277,  -52.80573001,  -74.1729936 ,
            -74.378248  ,  -74.57585198,  -74.77799222,  -74.97951527,
            -75.18448016,  -75.38693033,  -75.5853645 ,  -75.78650837,
            -75.98913024,  -76.18580718,  -76.39013381,  -76.59072937,
            -52.66275721,  -52.44724008,  -52.24001703,  -52.02110629,
            -51.81826069,  -51.60413008,  -51.39482373,  -51.18693049,
            -50.97949997,  -50.77277202,  -50.56368064,  -50.3590797 ,
            -50.1522377 ,  -76.69096985,  -77.03416777,  -77.3766119 ,
            -77.71767727,  -78.06402224,  -78.40386794,  -78.74529612,
            -79.08706858,  -79.42860879,  -79.77297255,  -80.10596699,
            -80.4438102 ,  -80.78460329,  -50.05312819,  -49.9736761 ,
            -49.89522255,  -49.81931451,  -49.74024005,  -49.66420725,
            -49.58869353,  -49.51797908,  -49.44146371,  -49.36437778,
            -49.29258898,  -49.21790087,  -49.14344944,  -80.95289563,
            -81.33350045,  -81.71989   ,  -82.10091639,  -82.49489692,
            -82.875586  ,  -83.255307  ,  -49.11316924,  -49.14567356,
            -49.19047843,  -49.23730199,  -49.27729172,  -49.31620662,
            -49.35664158,  -49.39249513,  -49.45027481,  -49.48395335,
            -49.52011389,  -49.56812697,  -73.91716046,  -74.14587426,
            -74.37676676,  -74.60787844,  -74.83258527,  -75.06090161,
            -75.29023098,  -49.94183416,  -49.74481108,  -49.54772904,
            -49.3560214 ,  -49.1599496 ,  -48.96577795,  -48.77231837,
            -48.5806793 ,  -48.38479851,  -75.40659146,  -75.76467891,
            -76.12691081,  -76.48583002,  -76.8416848 ,  -77.20192808,
            -77.55720095,  -77.91652991,  -78.27368369,  -78.62264732,
            -78.99328377,  -79.33325018,  -79.69626575,  -48.29330832,
            -48.23973737,  -48.1884778 ,  -48.13905835,  -48.09008041,
            -48.0413517 ,  -47.99203793,  -47.94394768,  -47.896292  ,
            -47.84964398,  -47.801565  ,  -47.75500522,  -47.70889452,
            -79.88064301,  -80.27521475,  -80.67229624,  -81.08532529,
            -81.48158099,  -81.88294344,  -82.29249778,  -82.68589332,
            -47.6765522 ,  -47.74127043,  -47.79915311,  -47.86402462,
            -47.91470523,  -47.97477663,  -48.02661995,  -48.08196115,
            -48.13537526,  -48.19268223,  -48.24830803,  -48.32173465,
            -94.61236108,  -95.97552566,  -48.95535512,  -49.07186926,
            -49.219737  ,  -49.36751334,  -49.49811506,  -49.64848341,
            -49.77024546,  -49.91501155,  -50.0637811 ,  -50.12878758,
            -50.29936941,  -50.49163195,  -50.68223429,  -50.85628441,
            -71.28272945,  -71.30989179,  -71.55544158,  -71.80454168,
            -72.05557059,  -72.305308  ,  -72.55436808,  -72.80061197,
            -73.05116048,  -73.29858276,  -73.54632854,  -73.79565656,
            -74.04125747,  -74.29007229,  -74.41253938,  -74.7804466 ,
            -75.14883982,  -75.51346074,  -75.87788381,  -76.24440045,
            -76.60627633,  -76.96566361,  -77.34006217,  -77.69323531,
            -78.05961786,  -78.42312211,  -78.77363576,  -46.90649116,
            -46.87957869,  -46.8539378 ,  -46.82723429,  -46.80231829,
            -46.77448331,  -78.95871421,  -79.36352024,  -79.79365441,
            -80.20199797,  -80.6205534 ,  -81.021797  ,  -81.43633807,
            -81.86203814,  -82.25915057,  -46.76542244,  -46.81536593,
            -46.88001155,  -46.94871999,  -47.02169495,  -47.06966611,
            -47.12369617,  -47.20888888,  -47.27800027,  -47.33780205,
            -47.39915977,  -47.45714633,  -47.52185678,  -96.7272796 ,
            -98.11162544,  -99.4809028 , -100.86011999,  -47.55823051,
            -47.69091453,  -47.84353897,  -47.97209662,  -48.12800943,
            -48.27526702,  -48.40286147,  -48.54546014,  -48.69646312,
            -48.82314174,  -48.97385388,  -49.1111279 ,  -49.25660228,
            -49.33621703,  -49.53078762,  -49.7030987 ,  -49.90157738,
            -50.09830605,  -50.29226342,  -69.62490838,  -69.68838243,
            -69.7628741 ,  -69.82435337,  -69.89386727,  -69.95641348,
            -70.02993371,  -70.09553254,  -70.16462503,  -70.23220915,
            -70.30250557,  -70.34033848,  -70.596495  ,  -70.85212951,
            -71.10926683,  -71.36123578,  -71.61946058,  -71.87363352,
            -72.13455658,  -72.38667427,  -72.63780861,  -72.89641277,
            -73.14669998,  -73.40469246,  -73.53007707,  -73.904201  ,
            -74.27294589,  -74.64388462,  -75.0177044 ,  -75.38857563,
            -75.75817567,  -76.12606884,  -76.4966294 ,  -76.86379591,
            -77.23031805,  -77.58939197,  -77.96675591,  -46.15759892,
            -46.13622108,  -46.11706323,  -46.09591372,  -46.07798317,
            -78.15990188,  -78.59069898,  -79.02642436,  -79.4661429 ,
            -79.89963929,  -80.33073715,  -80.76760655,  -81.1979908 ,
            -81.63141691,  -46.06383624,  -46.13773356,  -46.19740472,
            -46.2705788 ,  -46.33959804,  -46.40563024,  -46.46652156,
            -46.55212721,  -46.62090774,  -46.68786244,  -46.74382056,
            -46.8144954 ,  -46.89165134,  -46.92917658,  -47.06696677,
            -47.22834551,  -47.38136189,  -47.51424422,  -47.6651414 ,
            -47.81799677,  -47.95487684,  -48.11872478,  -48.26344531,
            -48.40898249,  -48.56138103,  -48.70004618,  -99.98683805,
           -101.4460491 ,  -48.77859978,  -48.97609087,  -49.17694905,
            -49.3767663 ,  -49.56825322,  -49.78079311,  -68.92943602,
            -69.00212525,  -69.07877384,  -69.14908472,  -69.22716122,
            -69.30237598,  -69.37726837,  -69.44669906,  -69.52439285,
            -69.56329759,  -69.81383937,  -70.06983576,  -70.31950362,
            -70.57317728,  -70.82480081,  -71.07510068,  -71.32798194,
            -71.57483943,  -71.82591559,  -72.07557205,  -72.32439819,
            -72.57786817,  -72.6982858 ,  -73.09219346,  -73.48874615,
            -73.88297617,  -74.2741372 ,  -74.66855895,  -75.06072269,
            -75.45242935,  -75.8469124 ,  -76.22535387,  -76.61905114,
            -77.00764092,  -77.39879926,  -45.69510196,  -45.68415201,
            -45.66272484,  -77.59356899,  -78.02679475,  -78.47353394,
            -78.90448184,  -79.33830329,  -79.77477653,  -80.20900137,
            -80.64476739,  -81.08413845,  -81.51101035,  -45.65794563,
            -45.73431549,  -45.81222844,  -45.88976122,  -45.95860974,
            -46.03862282,  -46.11320229,  -46.18694297,  -46.25827172,
            -46.33683983,  -46.41731943,  -46.49337685,  -46.56956824,
            -46.61210264,  -46.76088765,  -46.92121721,  -47.04787288,
            -47.22431698,  -47.36670126,  -47.52240068,  -47.66897465,
            -47.8236443 ,  -47.98354779,  -48.12804979,  -48.29744772,
            -48.43609552,  -99.79664333, -101.06750075, -102.33222161,
           -103.58747483,  -48.51750619,  -48.71960351,  -48.91566976,
            -49.11157813,  -49.32747985,  -49.53101082,  -68.41014301,
            -68.4990069 ,  -68.58116383,  -68.66454597,  -68.7505224 ,
            -68.8341587 ,  -68.91805281,  -69.00131356,  -69.04502461,
            -69.3163815 ,  -69.58677886,  -69.85455201,  -70.12858571,
            -70.39658177,  -70.66759735,  -70.93452155,  -71.20135835,
            -71.47236795,  -71.73711429,  -72.00577401,  -72.26739217,
            -72.4059273 ,  -72.79751405,  -73.18604892,  -73.57567576,
            -73.96561916,  -74.35521945,  -74.74775173,  -75.12583949,
            -75.50927883,  -75.90532877,  -76.2880743 ,  -76.67100833,
            -77.04646767,  -77.24562136,  -77.70375988,  -78.15053581,
            -78.59708452,  -79.05373178,  -79.49493685,  -79.95217412,
            -80.39579995,  -80.84563792,  -81.29723321,  -45.6169505 ,
            -45.70252952,  -45.78160795,  -45.87384054,  -45.96057154,
            -46.04219094,  -46.13010183,  -46.21548754,  -46.29691175,
            -46.37631936,  -46.46528451,  -46.49960335,  -46.6671565 ,
            -46.82818256,  -46.959673  ,  -47.11565469,  -47.2808072 ,
            -47.43688866,  -47.58420357,  -47.74137153,  -47.90745094,
            -48.05486281,  -48.20261459,  -48.36692556, -102.53220335,
           -104.00580061,  -48.44166174,  -48.6400586 ,  -48.85001235,
            -49.06724558,  -49.27675139,  -49.46812866,  -49.68367022,
           -129.41061696,  -68.195978  ,  -68.29016758,  -68.38118748,
            -68.47388568,  -68.56285886,  -68.65439673,  -68.74806107,
            -68.79413805,  -69.07040386,  -69.34517232,  -69.62150829,
            -69.89482857,  -70.16962406,  -70.4438721 ,  -70.71404078,
            -70.98665941,  -71.26170807,  -71.53279695,  -71.80726856,
            -72.07544159,  -72.21221651,  -72.60724671,  -73.00073077,
            -73.39392013,  -73.78762312,  -74.17968153,  -74.57159471,
            -74.95384399,  -75.35491996,  -75.73831841,  -76.12884345,
            -76.51340536,  -76.90014724,  -77.09663142,  -77.53584375,
            -78.00000924,  -78.4452303 ,  -78.90364584,  -79.34496273,
            -79.79469108,  -80.24096199,  -80.68330963,  -81.12183998,
            -45.87014559,  -45.94578364,  -46.02459358,  -46.10932411,
            -46.18029746,  -46.25490098,  -46.34505423,  -46.4275746 ,
            -46.49696488,  -46.54073965,  -46.69141327,  -46.85891635,
            -46.99617613,  -47.16293236,  -47.31592339,  -47.48119207,
            -47.61706328,  -47.7819168 ,  -47.9264062 ,  -48.09022897,
            -48.2342557 ,  -48.3914402 , -103.87315895,  -48.46416521,
            -48.6702458 ,  -49.08536775,  -49.27446553,  -49.68564785,
           -129.79755795,  -68.1754787 ,  -68.26596138,  -68.36250164,
            -68.45940016,  -68.55533645,  -68.65079636,  -68.69903653,
            -68.97446184,  -69.2519229 ,  -69.53033549,  -69.807889  ,
            -70.085873  ,  -70.36089194,  -70.63763876,  -70.91171555,
            -71.18633597,  -71.46085686,  -71.73116001,  -72.00703944,
            -72.14351923,  -72.54479316,  -72.94695039,  -73.34713041,
            -73.74868486,  -74.1452312 ,  -74.54730469,  -74.93647818,
            -75.33559855,  -75.74136033,  -76.13243224,  -76.51450814,
            -76.92401687,  -77.11331811,  -77.57134053,  -78.0259911 ,
            -78.48711573,  -78.94169344,  -79.39814683,  -79.84481853,
            -80.29931078,  -80.75678578,  -81.20618763,  -45.97342402,
            -46.04511335,  -46.12425942,  -46.21487364,  -46.28846347,
            -46.36853761,  -46.46027481,  -46.54299678,  -46.58667202,
            -46.73476493,  -46.87632102,  -47.0342778 ,  -47.19724339,
            -47.36084606,  -47.49549633,  -47.65429149,  -47.81156536,
            -47.96377786,  -48.11695048,  -48.25787757,  -48.41027367,
           -103.94097576, -105.40200598, -106.86094067, -108.31144278,
            -48.49461597,  -48.69270438,  -48.8928376 ,  -49.0950278 ,
            -49.30695855,  -49.51055829,  -49.70397607, -109.03462707,
           -109.67799879, -130.00191786, -129.63563436, -129.44810534,
           -129.27029705, -129.08643713, -128.90523984,  -61.36021931,
            -61.51988041,  -61.60521744,  -62.2384942 ,  -62.87225518,
            -63.50888666,  -64.14878937,  -64.79049044,  -65.44131841,
            -66.07611353,  -66.71699826,  -67.35776927,  -67.99896874,
            -68.6518172 ,  -69.2952062 ,  -69.61474588,  -69.82537088,
            -70.04131052,  -70.2477687 ,  -70.46049099,  -70.68116784,
            -70.89089848,  -71.09763131,  -71.31353123,  -71.51928242,
            -71.73552853,  -71.94893336,  -72.16215246,  -72.2621171 ,
            -72.45134071,  -72.64032937,  -72.83916589,  -73.02590817,
            -73.21706587,  -73.40337755,  -73.59773279,  -73.78738454,
            -73.97213881,  -74.16417223,  -74.3624843 ,  -74.5527421 ,
            -74.65236621,  -74.79150736,  -74.94040124,  -75.09432419,
            -75.23740113,  -75.38957005,  -72.24743646,  -72.43518364,
            -72.61211043,  -72.80195091,  -72.99076052,  -73.17740898,
            -73.37324751,  -73.55428047,  -73.74336879,  -73.92925578,
            -74.11320106,  -74.30246831,  -74.3913525 ,  -74.54372105,
            -74.68685065,  -74.83443658,  -74.98921607,  -75.13049815,
            -75.27848711,  -75.42524826,  -75.57431955,  -73.28947256,
            -73.47001051,  -73.65820331,  -73.83836146,  -74.02536237,
            -74.117932  ,  -74.25303296,  -74.40042473,  -74.54558563,
            -74.68868334,  -74.8278027 ,  -74.9713895 ,  -75.11261732,
            -75.25924289,  -75.39935994,  -75.54117478,  -75.68303489,
            -75.83309809,  -75.89985858,  -73.97876937,  -74.11533093,
            -74.25464507,  -74.39092125,  -74.5323158 ,  -74.66907296,
            -74.81229009,  -74.95221131,  -75.09408213,  -75.16389834,
            -75.25208406,  -75.3443716 ,  -75.43006959,  -75.51997562,
            -75.60592133,  -75.70305266,  -75.79312316,  -75.88508035,
            -77.02070042,  -77.0119938 ,  -76.99029197,  -76.96617623,
            -76.95171587,  -72.80601591,  -72.90458517,  -72.99909662,
            -74.72528163,  -74.74175145,  -74.74969756,  -74.75230399,
            -74.77152343,  -74.77677517,  -74.8116063 ,  -74.8166487 ,
            -74.81812062,  -74.84723709,  -74.84956201,  -74.81141376,
            -74.77552669,  -74.72827258,  -74.68341388,  -74.65758997,
            -74.61992286,  -74.57277144,  -74.54359607,  -74.50598477,
            -74.47106899,  -74.43022037,  -74.39798119,  -74.38531938])

Suppose we want to see the change in magnitudes between two atmospheres for a single SED type, we can use the following function:

```python
ab.dmagPlot(throughput,throughput_std,'qsos')
```

![png](README/output_79_0.png)

Or another SED type example:

```python
ab.dmagPlot(throughput,throughput_std,'gals')
```

![png](README/output_81_0.png)

### Regressions: Two Parameters

Regressions (currently limited to two varying parameters) are the most integral part of AtmoBuilder and are run using a single function.

```python
ab.computeAtmoFit?
```

Making use of the atmospheres we created at the beginning of this tutorial, lets run some regressions. Note that we only changed two parameters relative to the standard atmosphere when we created the atmosphere. These were the parameters for the Rayleigh and Aerosol components of atmospheric extinction, so let us regress those two components. (I have added the pickleString keyword argument which saves the pickle dump files and plots with an additional string component in its file name)

```python
ab.computeAtmoFit('Rayleigh', 'Aerosol', atmo, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 1.94 2.14
    r 2.35 1.22
    i 2.14 1.43
    z 2.14 1.43
    y4 2.14 1.43

    /Users/joachim/lsst/DarwinX86/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/text.py:52: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
      if rotation in ('horizontal', None):
    /Users/joachim/lsst/DarwinX86/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/text.py:54: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
      elif rotation == 'vertical':

![png](README/output_86_2.png)

![png](README/output_86_3.png)

![png](README/output_86_4.png)

Sometimes the contour plots do not adequately show the log-likelihood matrix, we can directly plot the logL matrix instead of the regression contours using 'useLogL':

```python
ab.computeAtmoFit('Rayleigh', 'Aerosol', atmo, useLogL=True, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 1.94 2.14
    r 2.35 1.22
    i 2.14 1.43
    z 2.14 1.43
    y4 2.14 1.43

![png](README/output_88_1.png)

![png](README/output_88_2.png)

![png](README/output_88_3.png)

It is also possible to plot both the contours and the log-likelihood matrix on the same plot:

```python
ab.computeAtmoFit('Rayleigh','Aerosol',atmo, plotBoth=True, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 1.94 2.14
    r 2.35 1.22
    i 2.14 1.43
    z 2.14 1.43
    y4 2.14 1.43

![png](README/output_90_1.png)

![png](README/output_90_2.png)

![png](README/output_90_3.png)

A colorbar for the log-likelihood column might be handy and can be included using a keyword argument. Unfortunately, it does resize the middle column slightly.

```python
ab.computeAtmoFit('Rayleigh', 'Aerosol', atmo, useLogL=True, includeColorBar=True, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_mss_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 1.94 2.14
    r 2.35 1.22
    i 2.14 1.43
    z 2.14 1.43
    y4 2.14 1.43

![png](README/output_92_1.png)

![png](README/output_92_2.png)

![png](README/output_92_3.png)

By default regressions will run using the Kurucz main sequence star SED data. However, we can also specify a different regression SED: (I have also set generate Dphi to False to condense the notebook a little)

```python
ab.computeAtmoFit('Rayleigh', 'Aerosol', atmo, regressionSed='qsos', generateDphi=False, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 2.04 1.84
    r 2.35 1.22
    i 2.14 1.43
    z 2.14 1.43
    y4 2.14 1.43

![png](README/output_94_1.png)

Like the regression SEDs, we can also set which comparison SEDs to use. By default, computeAtmoFit will always use the remaining SEDs (all of them except the original regression SED).

```python
ab.computeAtmoFit('Rayleigh', 'Aerosol', atmo, regressionSed='qsos', comparisonSeds=['gals','sns'], generateDphi=False, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E5_qsos_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 2.04 1.84
    r 2.35 1.22
    i 2.14 1.43
    z 2.14 1.43
    y4 2.14 1.43

![png](README/output_96_1.png)

The default percent error value for dmags in mmags is set to be 0.5%, however we can also set it to other values. For example, we can set it to be 5%:

```python
ab.computeAtmoFit('Rayleigh', 'Aerosol', atmo, err=0.05, generateDphi=False, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E50_mss_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E50_mss_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E50_mss_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E50_mss_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E50_mss_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG0_E50_mss_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 1.94 2.14
    r 2.35 1.22
    i 2.14 1.43
    z 2.14 1.43
    y4 2.14 1.43

![png](README/output_98_1.png)

One additional feature of interest is the deltaGrey keyword parameter. It is essentially an additional extinction factor implemented to add some offset representative of cloudy and potentially grey skies.

It works in the following way:
    - deltaGrey = 0.0 : default, no effect
    - deltaGrey >= 0.0 : subtract deltaGrey value from dmags (dG should be in mmags, for example: 20)
    - deltaGrey < 0.0 : subtract median dmag value from dmags

```python
ab.computeAtmoFit('Rayleigh', 'Aerosol', atmo, deltaGrey=20, generateDphi=False, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG200_E5_mss_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG200_E5_mss_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG200_E5_mss_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG200_E5_mss_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG200_E5_mss_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG200_E5_mss_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 1.94 2.14
    r 2.35 1.22
    i 2.14 1.43
    z 2.14 1.43
    y4 2.14 1.43

![png](README/output_100_1.png)

```python
ab.computeAtmoFit('Rayleigh', 'Aerosol', atmo, deltaGrey=-1, generateDphi=False, pickleString='Tutorial')
```

    Computing nonlinear regression for Rayleigh and Aerosol.
    Observed atmosphere parameters: [1.0, 1.0, 1.0, 2.2, 1.4, 1.7]
    Observed atmosphere airmass:    1.4
    Standard atmosphere parameters: [1.0, 1.0, 1.0, 1.0, 1.0, 1.7]
    Standard atmosphere airmass:    1.2
    Observed atmosphere parameter for Rayleigh: 2.2
    Observed atmosphere parameter for Aerosol: 1.4

    Calculating best parameters for u filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG-10_E5_mss_u_50b_Tutorial.pkl'
    Saved LogL for u filter.
    Calculating best parameters for g filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG-10_E5_mss_g_50b_Tutorial.pkl'
    Saved LogL for g filter.
    Calculating best parameters for r filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG-10_E5_mss_r_50b_Tutorial.pkl'
    Saved LogL for r filter.
    Calculating best parameters for i filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG-10_E5_mss_i_50b_Tutorial.pkl'
    Saved LogL for i filter.
    Calculating best parameters for z filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG-10_E5_mss_z_50b_Tutorial.pkl'
    Saved LogL for z filter.
    Calculating best parameters for y4 filter...
    @pickle_results: using precomputed results from 'pickles/X14_P101010221417_Rayleigh_Aerosol_XSTD12_DG-10_E5_mss_y4_50b_Tutorial.pkl'
    Saved LogL for y4 filter.

    Best fit parameters (Filter, Rayleigh, Aerosol):
    u 2.24 1.12
    g 2.04 1.84
    r 2.35 1.22
    i 3.06 0.82
    z 2.14 1.43
    y4 2.14 1.43

![png](README/output_101_1.png)

```python

```

gha_language: Gnuplot


text:
Novacek
==============

About
--------------

This is a toolset around OpenStack Nova and Neutron.
The tool can create overviews in various different ways and email owners of vm's (based on the email in the description field of the tenant)
On hypervisors this tool can also inspect libvirt for running instances and check Openvswitch / vlans.

Running novacek
--------------
Novacek can run anywhere where the appropriate libraries are installed (see requirements.txt)
Credentials will be pulled from the environment like other OpenStack tools:
OS_REGION_NAME
OS_PASSWORD
OS_AUTH_URL
OS_USERNAME
OS_TENANT_NAME
As an alternative to environment variables the tool will also look at the neutron.conf and try to use credentials specified there.

Commandline options:

| Option             | Description |
| -----------------|-------------|
| -l                  | list instances of the server you are currently logged into |
| -l -p               | also ping the instances |
| -l -H $hypervisor   | list instances on hypervisor $hypervisor |
| -l -Z $zone         | list all instances in zone $zone, ALL will return all instances |
| -f                  | choose formatting of result, noborder or table |
| -c                  | choose which fields to return: Host,Zone,Name,ID,Tenant,IP,VLAN,Flavor,Virsh_ID,PING ... |
| -m $message -H $hypervisor | mail the users of hypervisor X their machines with a $message REQUIRES EMAIL TO BE SET IN DESCRIPTION OF TENANT|

* Example 1: Reset the state off all instances on a hypervisor and hard reboot them:
for x in $(python novacek.py -c ID -l -f noborder -H $hvname); do nova reset-state --active $x; nova reboot --hard $x; done

* Example 2: mail all tenants on a hypervisor:
python novacek.py -m "Things gonna break" -H $hvname

Running test_hypervisor
--------------
test_hypervisor will check libvirt and openvswitch VLAN settings.
Note that these checks are very environment specific, if you run anything else then neutron/ML2/ovs it will probably not work.
Feel free to extend these checks.

Additional requirements
--------------
* The python_libvirt library is needed if you want to check the libvirt status of an instance on a hypervisor
* To do a check if the vlan's are properly set you need the easyOVS library.
  This toolset can be found here: https://github.com/yeasy/easyOVS

Sample output Hypervisor
--------------
|  Host|  Zone | Name      |  ID | Tenant |     IP      |  VLAN  |   Flavor   | Virsh_ID |  PING   |
|------|-------|-----------|-----|--------|-------------|--------|------------|----------|---------|
| hv1  | zone4 | instance1 | XXX | team_a | <IP_ADDRESS>  |  53    |  m1.small  |    -1    | ['DOWN']|
| hv1  | zone4 | instance2 | XXX | team_b | <IP_ADDRESS>  |  54    |  m1.small  |    1     |  ['UP'] |
| hv1  | zone4 | instance3 | XXX | team_c | <IP_ADDRESS> |  52    | m1.medium  |    2     |  ['UP'] |
| hv1  | zone4 | instance4 | XXX | team_c | <IP_ADDRESS> |  52    | m1.medium  |    3     |  ['UP'] |

Contributing
--------------
The tool was specifically build for Spilgames internal setup and is not tested on other setups.
We are running Openstack Icehouse from RDO on SL6 with Neutron and ML2.
If you want to extend functionality please do a merge request.
As long as it does not break anything we are open for changes.

repository: spilgames/novacek

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: spilgames/novacek


text:
# postgresstats
A haskell program for dumping useful statistics about a database in PostgresSQL. Basic usage:

```sh
runhaskell stats.hs --ip=<IP_ADDRESS> --db=mydb --user=postgres --password=postgres
```
Note you should provide user credentails which have admin permissions in the given databse.

The result will be a dump which checks the following:
+   top tables by size,
+   tables that are most access in the database,
+   tables with worst buffer hit average,
+   tables where index scans are less than 80%,
+   tables where most writes occur,
+   least accessed indexes in the database,
+   transactions that are running suspiciously long,
+   longest running transactions,
+   longest running queries,
+   tables that have been not vacuumed or analysed for longer than 14 days.

### TODO
Tested only on PostgreSQL 9.2

license: MIT

repository: hotlib/postgresstats

repo_name: hotlib/postgresstats


text:
---
layout: post
title: How to set up a headless Raspberry PI Headlessly
---

Just found a nice trick when setting up a Headless Raspberry PI to avoid scrambling around for an old keyboard, mouse, and HDMI cable, just to run raspi-config and enable ssh...

Just noticed on the [Raspberry PI ssh page](https://www.raspberrypi.org/documentation/remote-access/ssh/) that there's a better way to do this, by simply placing a file named ssh in the boot folder of your SD Card.

I'm on a Mac, so my general workflow for RPI setup is:

* Download latest Raspbian image from the [Raspbian Download Page](https://www.raspberrypi.org/downloads/raspbian/).
* I'm on a Mac, so I write this to an SD Card using [Apple PI Baker](https://www.tweaking4all.com/software/macosx-software/macosx-apple-pi-baker/) - _You'll need to scroll down a bit to find the download link_
* Once the write's done, the SD Card is normally automatically unmounted, so unplug and re-plug it...
* It should show up as a 'boot' device in Finder
* Open a terminal and:

```
$ cd /Volumes/boot
$ touch ssh
```

Then eject the SD Card and fire up the RPI. I normally use a wired connection the first time, and set up wifi over ssh later if needed.

To find the IP address of the RPI, I usually use [Fing](https://play.google.com/store/apps/details?id=com.overlook.android.fing&hl=en), or a bit of nmap magic (you'll need to update your address range depending on how your DHCP is set up):

```
$ sudo nmap -sn <IP_ADDRESS>/24
```


text:
[![Netlify Status](https://api.netlify.com/api/v1/badges/4d7e7cea-4aa7-4aea-847e-6afaaa87d953/deploy-status)](https://app.netlify.com/sites/agdesign/deploys)

# Jade Digital Static Site Generator using npm scripts

A skeleton and collection of packages for building websites.

* [List of packages used](#list-of-packages-used)
* [Using in your project](#using-in-your-project)
* [List of available tasks](#list-of-available-tasks)
* [Need help?](#need-help)

## List of packages used
[autoprefixer](https://github.com/postcss/autoprefixer), [browser-sync](https://github.com/Browsersync/browser-sync), [standard](https://github.com/feross/standard), [imagemin-cli](https://github.com/imagemin/imagemin-cli), [node-sass](https://github.com/sass/node-sass), [onchange](https://github.com/Qard/onchange), [npm-run-all](https://github.com/mysticatea/npm-run-all), [postcss-cli](https://github.com/code42day/postcss-cli), [svgo](https://github.com/svg/svgo), [svg-sprite-generator](https://github.com/frexy/svg-sprite-generator), [uglify-js](https://github.com/mishoo/UglifyJS2).

## Setup
* First, ensure that node.js & npm are both installed. If not, choose your OS and installation method from [this page](https://nodejs.org/en/download/package-manager/) and follow the instructions.
* Next, use your command line to enter your project directory.
  * If this a new project, start by cloning this repository `git clone git@github.com:jadedigital/jade-digital-boilerplate.git && rm -rf .git`. Update your `package.json` details file to suit your project.
  * If this is an existing project, copy the contents of `"devDependencies"` and `"scripts"` into your `package.json`.
* Run `npm install` to install all of the dependencies into your project.
* Copy or set up your files in the src folder.

You're ready to go! Run any task by typing `npm run task` (where "task" is the name of the task in the `"scripts"` object). The most useful task for rapid development is `watch:all`. It will start a new server, open up a browser and watch for any SCSS or JS changes in the `src` directory; once it compiles those changes, the browser will automatically inject the changed file(s)!

* Run `npm run build:all && npm run watch:all` if it's your first run. Run `npm run watch:all` for subsequent runs.
* Run `npm run build:all` to package your files for production.

## List of available tasks
### `clean`
  `rm -f dist/{css/*,js/*,images/*}`

  Delete existing dist files

### `autoprefixer`
  `postcss -u autoprefixer -r dist/css/*`

  Add vendor prefixes to your CSS automatically

### `scss`
  `node-sass --output-style compressed -o dist/css src/scss`

  Compile Scss to CSS

### `lint`
  `standard src/js`

  "Lint" your JavaScript to enforce a uniform style and find errors using the standard style

### `uglify`
  `mkdir -p dist/js && uglifyjs src/js/*.js -m -o dist/js/app.js && uglifyjs src/js/*.js -m -c -o dist/js/app.min.js`

  Uglify (minify) a production ready bundle of JavaScript

### `imagemin`
  `imagemin src/images/* -o dist/images`

  Compress all types of images

### `icons`
  `svgo -f src/images/icons && mkdir -p dist/images && svg-sprite-generate -d src/images/icons -o dist/images/icons.svg`

  Compress separate SVG files and combine them into one SVG "sprite"

### `serve`
  `browser-sync start --server --files 'dist/css/*.css, dist/js/*.js, **/*.html, !node_modules/**/*.html'`

  Start a new server and watch for CSS & JS file changes in the `dist` folder

### `build:css`
  `npm run scss && npm run autoprefixer`

  Alias to run the `scss` and `autoprefixer` tasks. Compiles Scss to CSS & add vendor prefixes

### `build:js`
  `npm run lint && npm run concat && npm run uglify`

  Alias to run the `lint`, `concat` and `uglify` tasks. Lints JS, combines `src` JS files & uglifies the output

### `build:images`
  `npm run imagemin && npm run icons`

  Alias to run the `imagemin` and `icons` tasks. Compresses images, generates an SVG sprite from a folder of separate SVGs

### `build:all`
  `npm run build:css && npm run build:js && npm run build:images`

  Alias to run all of the `build` commands

### `watch:css`
  `onchange 'src/**/*.scss' -- npm run build:css`

  Watches for any .scss file in `src` to change, then runs the `build:css` task

### `watch:js`
  `onchange 'src/**/*.js' -- npm run build:js`

  Watches for any .js file in `src` to change, then runs the `build:js` task

### `watch:images`
  `onchange 'src/images/**/*' -- npm run build:images`

  Watches for any images in `src` to change, then runs the `build:images` task

### `watch:all`
  `npm-run-all -p serve watch:css watch:js`

  Run the following tasks simultaneously: `serve`, `watch:css` & `watch:js`. When a .scss or .js file changes in `src`, the task will compile the changes to `dist`, and the server will be notified of the change. Any browser connected to the server will then inject the new file from `dist`

repository: jadedigital/agdesign

gha_language: SCSS

gha_license_id: MIT

repo_name: jadedigital/agdesign


text:
# stash_test
A [stash](https://github.com/ivoleitao/stash) test support package

[![Pub Package](https://img.shields.io/pub/v/stash_test.svg?style=flat-square)](https://pub.dartlang.org/packages/stash_test)
[![Coverage Status](https://codecov.io/gh/ivoleitao/stash/graph/badge.svg?flag=stash_test)](https://codecov.io/gh/ivoleitao/stash_test)
[![Package Documentation](https://img.shields.io/badge/doc-stash_test-blue.svg)](https://www.dartdocs.org/documentation/stash_test/latest)
[![GitHub License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Overview

Provides testing support [stash](https://pub.dartlang.org/packages/stash) storage and cache implementations

## Getting Started

Add this to your `pubspec.yaml` (or create it) on the `dev_dependencies` section replacing x.x.x with the latest version of stash_test:

```dart
dev_dependencies:
    stash_test: ^x.x.x
```

Run the following command to install dependencies:

```dart
dart pub get
```

Finally, to start developing import the library:

```dart
import 'package:stash_test/stash_test.dart';
```
## Usage

The `stash_test` library provides a way to easily import the set of standard tests for [CacheStore](https://github.com/ivoleitao/stash/blob/develop/packages/stash/lib/src/api/cache_store.dart) and [Cache](https://github.com/ivoleitao/stash/blob/develop/packages/stash/lib/src/api/cache.dart) allowing to reuse them to test custom implementations provided by external parties but also to test the storage and cache implementations provided in the package ecossistem of `stash`. The main objective is to guarantee that all storage implementations perform the full suite of type tests but also the standart `stash` tests.

For example let's consider that a third party developer creates a custom store, `CustomStore`, and wishes to test it against the same set of tests that are used on `stash_file`, `stash_hive` and similar packages. On the `test/custom` folder of the package the following file `custom_store_test.dart` can be created:

```dart
import 'package:stash_custom/stash_custom.dart';
import 'package:stash_test/stash_test.dart';

class DefaultContext extends TestContext<CustomStore> {
  DefaultContext(ValueGenerator generator,
      {dynamic Function(Map<String, dynamic>)? fromEncodable})
      : super(generator, fromEncodable: generator.fromEncodable);

  @override
  Future<FileStore> newStore() {
    return Future.value(CustomStore(..., fromEncodable: fromEncodable));
  }
}

void main() async {
  testStore((generator) => DefaultContext(generator));
  testCache((generator) => DefaultContext(generator));
}
```

Notice that in order to leverage the same set of tests a class extending `TextContext` needs to created and used on the calls to the two provided functions:
* `testStore`: which runs all the store tests
* `testCache`: which runs all the cache tests

Please take a look at the examples provided on one of the storage implementations, for example [stash_file](https://github.com/ivoleitao/stash/tree/develop/packages/stash_file) or [stash_sqlite](https://github.com/ivoleitao/stash/tree/develop/packages/stash_sqlite).

## Features and Bugs

Please file feature requests and bugs at the [issue tracker][tracker].

[tracker]: https://github.com/ivoleitao/stash/issues/new

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/ivoleitao/stash/blob/develop/packages/stash_test/LICENSE) file for details

repository: AshleyAlexJacob/stash

repo_name: AshleyAlexJacob/stash


text:
---
title: "4.7 Service"
excerpt: ""
permalink: /docs/en/4.7/
redirect_from:
  - /theme-setup/
toc: false
toc_sticky: false
sidebar:
  nav: "en"
---

---
You can connect Cluster Ip, Node Port, and Loadbalancer ports to the created workload and add ingress configuration.

### a \) Left Main Menu → Service → Select Service Map → Service.
![]({{ site.baseurl }}/assets/EN/{{ site.version }}/4.7_1.png)
![]({{ site.baseurl }}/assets/EN/{{ site.version }}/4.7_2.png)

gha_language: JavaScript


text:
# Threaded Loading

This demo demonstrates how to use ResourceLoader for background loading.

Language: GDScript

Renderer: Mobile

Check out this demo on the asset library: *Coming soon*

## Screenshots

![Screenshot](screenshots/paintings.png)

repository: godotengine/godot-demo-projects

gha_language: GDScript

repo_name: godotengine/godot-demo-projects


text:
---
layout: post
title: "Late Start to 2017"
author<EMAIL_ADDRESS>comments: true
categories: []
tags: []
---

## Starting off quickly!

My 2017 started off pretty well, with re-award of my Microsoft MVP status in Cloud and Datacenter Management.

![MVP 2017 - Cloud and Datacenter Management]({{site.baseurl}}/talks/DevOps-Images/mvp_2017.jpg)

That was followed up by a week in Seattle with a few hundred of my fellow Chef employees for our year kick off meeting.

## More Habitat and Rust

I've been working mostly on our [Habitat project](https://github.com/habitat-sh/habitat) since mid-August.  Habitat is mostly written in Rust and has been a great experience.

## Chef 13 is Coming

For Chef Client, we're moving to a yearly cadence for major releases (with continued minor version bumps every month).  This April will be the release of Chef 13, [which is really exciting times](https://blog.chef.io/2017/01/30/preparing-for-chef-13/)!

## Conferences and Travel

I've got a few conferences and events locked in for this year, and a few that I hope to be at.  The locked in events for this spring are:

#### PowerShell and DevOps Summit - April 9-12 - Bellevue, WA

[This year at the PowerShell Summit](https://eventloom.com/event/home/summit2017), we'll have two rooms where you can get expert feedback or help.

Kirk Munro will be hosting a "Function Lab" and I will be hosting a "DSC Lab".  If you are planning to demo something for the Community Lightning Demos, these labs will be a great resource if you have some last minute questions or want a bit of peer review.

#### ChefConf - May 22-24 - Austin TX

[I'll be running a workshop on Monday, May 22nd on "Making Windows Work For You"](https://chefconf.chef.io/2017/agenda/).

I do have to leave ChefConf early for...

#### IT Transformation / DevIntersection - May 21-24

I'll be speaking [about Continuous Delivery of Infrastructure with Chef and DSC, as well as Application Automation with Habitat](https://devintersection.com/#!/Sharepoint-Office365-Conference/sessions) there.

You can use the discount code "MURAWSKI" and get $50 off registration.

repository: rishimittal/blog

extension: markdown

repo_name: rishimittal/blog


text:
---
title: Fairfax Media Style Guide
layout: doc
info: 🔍 Use browser search to quickly find what you're after.
---

# Foreword

Fairfax Media produces hundreds of publications, be they digital, newspapers or magazines.

As with its predecessors, this 2015 version of the _Fairfax Media Stylebook_ is designed to help create consistency in the way we communicate with our audiences regardless of the platform they choose.

Our journalism needs to be clear, accurate and concise, and there are many entries in this guide to help achieve those ends.

Grammar, punctuation and spelling are covered, and the stylebook is also a handy reference tool for many of the facts that crop up regularly in our work. It will also help writers and editors avoid many common pitfalls.

The English language is constantly evolving: meanings change, nouns become verbs and new words appear. There will be times when it makes sense to break or bend the rules, but do so with care.

We use the _Oxford Dictionary_ as our reference for words not found in this guide and _The Times Atlas_ for foreign place names. _The Australian Oxford Dictionary_ can be found on the Fairfax intranet. For more up-to-date general references go to [oxforddictionaries.com](https://oxforddictionaries.com).

Thanks go to all those who have given of their time and expertise in producing this update.

**January 2015**

# Styles

{% assign style-general = site.docs | where: 'type', 'style-general' | sort: 'url' %}
{% assign style-business = site.docs | where: 'type', 'style-business' | sort: 'url' %}
{% assign style-internet-and-it = site.docs | where: 'type', 'style-internet-and-it' | sort: 'url' %}
{% assign style-all = style-general | concat: style-business | concat: style-internet-and-it | sort: 'title' %}
{% for doc in style-all %}

## {{ doc.title }}
{{ doc.content }}

{% endfor %}

# Guides

{% assign guides = site.docs | where: 'type', 'guides' | sort: 'url' %}
{% for guide in guides %}
## {{ guide.title }}
{{ guide.content }}

{% endfor %}

repository: bengrubb-sudo/ffx-style-guide

repo_name: bengrubb-sudo/ffx-style-guide


text:
# pepperModules-GeTaModules

A module for the [Pepper](http://corpus-tools.org/pepper/) conversion framework
for linguistic data.

The module provides an importer for the custom JSON data written by the GeTa
annotation tool as used in the [TraCES](https://www.traces.uni-hamburg.de/)
research project.

It can be used to import GeTa data and subsequently manipulate it and export it
to a different format with Pepper.

*GeTaModules* is also provided in a custom GUI for conversion into the ANNIS
format: [Pepper Grinder](https://github.com/sdruskat/pepper-grinder).

## Requirements

- Java >= 1.7
- Pepper ([download](http://corpus-tools.org/pepper/#download),
[documentation](http://corpus-tools.org/pepper/#documentation)) (module has
been tested with Pepper v3.1.0)

## Install module

1. Start Pepper (Windows: `pepperStart.bat`, Linux: `bash pepperStart.sh`)
1. `pepper> update de.uni-hamburg::pepperModules-GeTaModules::http://central.maven.org/maven2/`

You can also download the module executable from
[Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22de.uni-hamburg.traces%22%20AND%20a%3A%22pepperModules-GeTaModules%22) and add the path to the JAR file to the configuration
file `conf/pepper.properties`:

`pepper.dropin.paths=/path/to/the/module/jar`

Pepper will then pick it up automatically.

## Usage

To use the module, either use the conversion wizard in Pepper (started by
the `convert`/`c` sommand without parameters), or create a
[Pepper workflow file](http://corpus-tools.org/pepper/userGuide.html#workflow_file).

In the workflow:

### Identify the module by name

```xml
<importer name="GeTaImporter" path="PATH_TO_CORPUS"/>
```

### Properties

`GeTaModules` does not provide any custom properties.

## Contribute

The project is happy to receive issue reports and pull requests. Please [open a
new issue with your idea or
report](https://github.com/sdruskat/pepperModules-GeTaModules/issues/new).
Many thanks.

## Build

To build locally, run `mvn clean install`.

## Deploy

Run

1. `mvn license:format`
1. `mvn site:site`
1. `mvn release:prepare`
1. `mvn release:perform`

## License

```
Copyright 2016ff. Stephan Druskat
All exploitation rights belong exclusively to Universität Hamburg.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

repository: sdruskat/pepperModules-GeTaModules

branch_name: refs/heads/develop

gha_language: Java

repo_name: sdruskat/pepperModules-GeTaModules


text:
---
layout: code
title: Justified Grid
description: A grid that's easy to implement and just works.
date: 2016-02-20
category: codes
---

This is a simple grid that harnesses the powers of justified paragraphs, for natural space between elements (gutters).

When element widths add up to less than 100%, blank space naturally fills between them for equal distribution across the entire line/row. When elements add up to more than 100%, they automatically wrap to the next line, like words at the end of a paragraph. No messy margin mischief. No extra mark up. Grid 'cells' don't have to be wrapped in container 'rows'. The rows create themselves through natural flow.

You also keep the markup clean, and free of circumstantial grid classes, like "grid-4-of-12", which is really 6-of-12 at a certain breakpoint, but 12-of-12 at another... but who's counting?? Justified grids can be managed entirely with mixins, and kept in the CSS where they belong.

The only downside, if there is any, is blank space in the mark up of inline elements throws off the justification. But setting the font size of the grid's parent to zero solves this. Some people have a problem with that, but I don't. rem units makes it a non-issue.

My version is tailored for how I work, but more details and a neat grid builder can be found at [justifygrid.com](http://justifygrid.com/)

See the Pen Justified Grid - SCSS by Chase (@chasebank) on CodePen.

Usage example:

See the Pen Justified Grid Example by Chase (@chasebank) on CodePen.


text:
# SSD300
Single Shot MultiBox Detector implemented with TensorFlow
## Dependencies ##
python3.6.1
* numpy
* pickle
* skimage
* TensorFlow
* matplotlib

## Usage ##
1. Import required modules
```
import tensorboard as tf
import numpy as np

from util.util import *
from model.SSD300 import *
```

2. Load test-image
```
img = load_image('./test.jpg')
img = img.reshape((300, 300, 3))
```

3. Prepare TensorFlow placeholder (input images)
```
input = tf.placeholder(shape=[None, 300, 300, 3], dtype=tf.float32)
```

4. Start Session
you must just call ssd.eval() !
```
with tf.Session() as sess:
        ssd = SSD300(sess)
        sess.run(tf.global_variables_initializer())
        for ep in range(EPOCH):
            BATCH_LOSSES = []
            for ba in range(BATCH):
                minibatch, actual_data = next_batch(is_training=True)
                _, _, batch_loc, batch_conf, batch_loss = ssd.eval(minibatch, actual_data, True)
```

## Test Training ##
you have to extract data-set from zip files.
decompress all zip files in datasets/ and move to VOC2007/ dir.
```
$ ls VOC2007/ | wc -l    #  => 4954
$ ./setup.sh
$ python train.py
```

## Present Circumstances ##
I just implemented ssd300, so its not already done learning-test.

If I have overlooked something, please tell me.

## Welcome PullRequest or E-mail ##


text:
---
title: Kyverno Policies
description: Learn how Kyverno policies and rules work.
weight: 45
---

A Kyverno policy is a collection of rules. Each rule consists of a [`match`](/docs/writing-policies/match-exclude/) clause, an optional [`exclude`](/docs/writing-policies/match-exclude/) clause, and one of a [`validate`](/docs/writing-policies/validate/), [`mutate`](/docs/writing-policies/mutate/), or [`generate`](/docs/writing-policies/generate) clause. A rule definition can contain only a single `validate`, `mutate`, or `generate` child node.

Policies can be defined as cluster-wide resources (using the kind `ClusterPolicy`) or namespaced resources (using the kind `Policy`.) As expected, namespaced policies will only apply to resources within the namespace in which they are defined while cluster-wide policies are applied to matching resources across all namespaces. Otherwise, there is no difference between the two types.

repository: yashvardhan-kukreja/website

branch_name: refs/heads/main

repo_name: yashvardhan-kukreja/website


text:
---
layout: default
---

# 1997-11-24 - Re: Further costs of war

## Header Data

From<EMAIL_ADDRESS>(Anonymous)

To<EMAIL_ADDRESS>Message Hash: 3f83d9541cbedecbf83de7c133c603439d14827ffb89c2b753370a4216f6c5b4

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-11-24 19:42:40 UTC

Raw Date: Tue, 25 Nov 1997 03:42:40 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Anonymous)
Date: Tue, 25 Nov 1997 03:42:40 +0800
To<EMAIL_ADDRESS>Subject: Re: Further costs of war
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

Robert Hettinga wrote:
>Of course, all the pseudoconstitutionalist claptrap about the 16th
>being unconstitutional is, of course, that. The constitution's what
>the Supreme Court says it is, unfortunately.

Personally, I do not believe in the infallibility of the Supreme
Court.  The people on the Court are just people.  They can make
mistakes.  They can have ulterior motives.  They can be corrupt.

The Constitution is understood by many people to be something like a
charter in which the people of the United States granted the
government certain powers, reserving all others to themselves.

The Constitution has meaning.  The Supreme Court may not amend this
meaning, it may only interpret it.  When the Court makes a decision
which is obviously not consistent with the meaning of the Constitution
it is reasonable to say that the Court is in error.  In an extreme
situation many people would say that it is reasonable for the people
of the United States to revoke the Charter granted to this government.

Consider this scenario: Chief Justice Rehnquist appears in Court
wearing a tutu.  He declares that the Court has just decided that in
emergency situations it is proper and Constitutional for the Supreme
Court to take control of the government to protect democracy.

Would it be reasonable to say that the Constitution had changed or
would it be reasonable to put the Chief Justice in the loony bin?

Let's take an example from history.  The United States decides to
enter World War I.  People who are opposed to this war and to the
draft make speeches opposing both policies.  A law is passed
forbidding this activity.  The Chief Justice declares that speech may
be controlled if it is akin to "yelling 'Fire!' in a crowded movie
house."  Following this logic, the government jails people who speak
against the War and the draft.  One of these people, Eugene Debs,
campaigns from jail for the Presidency and gets about a million votes.

Would it be proper to conclude that speaking against the War may be
punished Constitutionally or that the Court had failed to carry out
its duties?

Monty Cantsin
Editor in Chief
Smile Magazine
http://www.neoism.org/squares/smile_index.html
http://www.neoism.org/squares/cantsin_10.htm

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQEVAwUBNHm/SZaWtjSmRH/5AQEifgf/U1n6bFaEy66IyuezGhSG0AbDPCKBfwWd
iMuqhy5ZoHqJR/v0RHw2Wupp3ACuYe/CgUrrftN0bzr8WaWThMr8H2kxsnxNoHX4
0cowJfnRxnJkSNoFKYa+t3y/otjYW+YRWBfoyKktvwiK30r7H2jisKPAoOCir8NP
W5P10QhzKAvCp/16sCEpqYbzbXDnaiY9D55E6Ew7mLEECeGm+raATUvayksA+BT/
RNhZXQTYMYk7AfeqKxp7fuikQegTRbwC8d4G0jT6kduFOWvI4YaQIKam+eR8Dec9
jzDO5ckcPLaB80p6jQEc0nob4ltBz4mbDqqnc2YBfsAvTSKBIGKKCQ==
=IzrC
-----END PGP SIGNATURE-----

{% endraw %}
```

## Thread

+ Return to [November 1997](/archive/1997/11)

+ Return to<EMAIL_ADDRESS>(Anonymous)](/authors/nobody_at_replay_com_anonymous_)"

+ 1997-11-24 (Tue, 25 Nov 1997 03:42:40 +0800) - Re: Further costs of war -<EMAIL_ADDRESS>(Anonymous)_


text:
# AgarOpenAIGym

Openai Gym environment to play a local version of agar.io
This project referenced javascript impelmentation of agar https://github.com/m-byte918/MultiOgar-Edited but rewritten and heavily modified to python

# Progress

Everything is almost done. Gameplay is smooth. Need to make bots smarter.

# Environment

The environment is defined in Env.py. This is a multiagent environment and you can specify any number of players. See HumanControl.py for sample use. The state space for each agent is [mouse.x, mouse.y, Split/Feed/No-op]. You are allowed to control multiple agents by passing a [N, 3] 2D array.

# Play with mouse and keyboard

Run python HumanControl.py to play!

repository: ZiyiLiubird/PettingZoo

repo_name: ZiyiLiubird/PettingZoo


text:
---

title: 'Six Post Styles Sheet'
date: 2020-8-06 07:09:00
author: 'Kc Pele'
image: ../../images/css.jpg
tags:
- Bootstrap
- Semantic ui
- Material ui
---
Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first web sites.

Bootstrap is completely free to download and use!
What is Bootstrap?
Bootstrap is a free front-end framework for faster and easier web development
Bootstrap includes HTML and CSS based design templates for typography, forms, buttons, tables, navigation, modals, image carousels and many other, as well as optional JavaScript plugins
Bootstrap also gives you the ability to easily create responsive designs
Note	What is Responsive Web Design?

Responsive web design is about creating web sites which automatically adjust themselves to look good on all devices, from small phones to large desktops.
Bootstrap History
Bootstrap was developed by Mark Otto and Jacob Thornton at Twitter, and released as an open source product in August 2011 on GitHub.

In June 2014 Bootstrap was the No.1 project on GitHub!

Why Use Bootstrap?
Advantages of Bootstrap:

Easy to use: Anybody with just basic knowledge of HTML and CSS can start using Bootstrap
Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets, and desktops
Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the core framework
Browser compatibility: Bootstrap is compatible with all modern browsers (Chrome, Firefox, Internet Explorer, Safari, and Opera)
Where to Get Bootstrap?
There are two ways to start using Bootstrap on your own web site.

You can:

Download Bootstrap from getbootstrap.com
Include Bootstrap from a CDN
Downloading Bootstrap
If you want to download and host Bootstrap yourself, go to getbootstrap.com, and follow the instructions there.

Bootstrap CDN
If you don't want to download and host Bootstrap yourself, you can include it from a CDN (Content Delivery Network).

MaxCDN provide CDN support for Bootstrap's CSS and JavaScript. Also include jQuery:

repository: KcPele/codeBlog

repo_name: KcPele/codeBlog


text:
# Ship log data from Log Service to OSS

You can use Log Service to collect log data and ship the log data to Object Storage Service \(OSS\) for storage and analysis. This topic describes how to ship log data from Log Service to OSS.

-   A project and a Logstore are created. For more information, see [Create a project and a Logstore](/intl.en-US/.md).
-   Log data is collected. For more information, see [Log collection methods](/intl.en-US/Data Collection/Log collection methods.md).
-   OSS is activated. A bucket is created in the region where the Log Service project resides. For more information, see [Activate OSS](/intl.en-US/Console User Guide/Sign up for OSS.md).
-   Log Service is authorized to access OSS resources. You can authorize Log Service on the [Cloud Resource Access Authorization](https://ram.console.aliyun.com/#/role/authorize?request=%7B%22Requests%22%3A%20%7B%22request1%22%3A%20%7B%22RoleName%22%3A%20%22AliyunLogDefaultRole%22%2C%20%22TemplateId%22%3A%20%22DefaultRole%22%7D%7D%2C%20%22ReturnUrl%22%3A%20%22https%3A//sls.console.aliyun.com/%22%2C%20%22Service%22%3A%20%22Log%22%7D) page.

    To ship log data across Alibaba Cloud accounts or by using a RAM user, see [Authorization in the RAM console](/intl.en-US/Log consumption and shipping/Data shipping/Ship logs to OSS/Authorization in the RAM console.md).

    ![Cloud Resource Access Authorization page](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/8257549951/p112344.png)

Log Service supports automatic shipping of log data from a Logstore to an OSS bucket.

-   You can set a custom retention period for the log data in the OSS bucket. Permanent retention is supported.
-   You can use data processing platforms such as E-MapReduce and Data Lake Analytics \(DLA\) or use custom programs to consume log data from the OSS bucket.

## Ship log data

1.  Log on to the [Log Service console](https://sls.console.aliyun.com).

2.  In the Projects section, click the name of the project.

3.  On the **Log Storage** \> **Logstores** tab, click the **\>** icon of the Logstore. Then, choose **Data Transformation** \> **Export** \> **Object Storage Service \(OSS\)**.

4.  On the OSS Shipper page, click **Enable**.

5.  In the Shipping Notes dialog box, click **Ship**.

6.  Configure a rule in the OSS LogShipper panel to ship log data to an OSS bucket.

    The following table describes the required parameters.

    |Parameter|Description|
    |:--------|:----------|
    |OSS Shipper Name|The name of the shipping rule. The name can contain only lowercase letters, digits, hyphens \(-\), and underscores \(\_\). The name must start and end with a lowercase letter or digit and must be 2 to 128 characters in length. |
    |OSS Bucket|The name of the OSS bucket to which you want to ship log data. **Note:** You must specify the name of an existing OSS bucket. The specified OSS bucket must reside in the same region as the Log Service project. |
    |OSS Prefix|The directory to which log data is shipped in the OSS bucket.|
    |Shard Format|The partition format of the directory for a shipping task. The directory is generated based on the time when the shipping task is created. The default format is %Y/%m/%d/%H/%M. The value of this parameter cannot start with a forward slash \(/\). For information about partition format examples, see [Partition format](#section_gzu_5la_tzu). For information about the parameters of partition formats, see [strptime API](http://man7.org/linux/man-pages/man3/strptime.3.html).|
    |RAM Role|The Alibaba Cloud Resource Name \(ARN\) of the RAM role. The RAM role is the identity that the OSS bucket owner creates for access control. Example: acs:ram::45643:role/aliyunlogdefaultrole. For more information, see [Obtain the ARN of a RAM role](#section_6y4_v2h_1n4).|
    |Shipping Size|The maximum size of raw log data that can be shipped to the OSS bucket in a shipping task. Valid values: 5 to 256. Unit: MB. If the size of shipped data exceeds the specified value, a new shipping task is created. |
    |Storage Format|The storage format of log data in OSS. Data shipped to OSS can be in the JSON, CSV, or Parquet format. For more information, see [CSV-formatted data](/intl.en-US/Log consumption and shipping/Data shipping/Ship logs to OSS/CSV-formatted data.md).|
    |Compress|Specifies whether to compress log data that is shipped to OSS. Valid values:     -   No Compress: Log data that is shipped to OSS is not compressed.
    -   Compress \(snappy\): The [Snappy](https://google.github.io/snappy/) utility is used to compress the log data that is shipped to OSS. This releases more storage space of the OSS bucket. |
    |Ship Tags|Specifies whether to ship log tags.|
    |Shipping Time|The time period during which a shipping task runs. Valid values: 300 to 900. Default value: 300. Unit: seconds. If the specified time is reached, another shipping task is created. |

7.  Click **OK**.

    **Note:**

    -   After you configure a shipping rule, multiple shipping tasks can concurrently run. If the size of data shipped from a shard reaches the specified threshold or the specified shipping time is reached, another task is created.
    -   After you create a shipping task, you can check whether the shipping rule satisfies your business requirements based on the task status and the data shipped to OSS.

## View OSS data

After log data is shipped to OSS, you can view the log data in the OSS console, or by using the OSS API, an SDK, or another method. For more information, see [Manage objects](/intl.en-US/Console User Guide/Upload, download, and manage objects/Overview.md).

The following script shows a sample OSS directory:

```
oss://OSS-BUCKET/OSS-PREFIX/PARTITION-FORMAT_RANDOM-ID
```

OSS-BUCKET is the name of the destination OSS bucket. OSS-PREFIX is the prefix of the directory in the destination OSS bucket. PARTITION-FORMAT is the partition format of the directory for a shipping task. The partition format is calculated based on the time when the shipping task is created. For more information, see [strptime API](http://man7.org/linux/man-pages/man3/strptime.3.html). RANDOM-ID is the unique identifier of a shipping task.

**Note:** A directory in an OSS bucket is created based on the time when a shipping task is created. For example, a shipping task is created at 00:00:00 on June 23, 2016 to ship data to OSS. The data is written to Log Service after 23:55:00 on June 22, 2016. The shipping interval is 5 minutes. To retrieve all logs shipped on June 22, 2016, you must check all the objects in the 2016/06/22 directory. You must also check the 2016/06/23/00/ directory for the objects that are generated in the first 10 minutes of June 23, 2020.

## Partition format

For each shipping task, log data is written to a directory of an OSS bucket. The directory is in the oss://OSS-BUCKET/OSS-PREFIX/PARTITION-FORMAT\_RANDOM-ID format. A partition format is obtained by formatting the time when a shipping task is created. The following table describes the partition formats and directories that are obtained when a shipping task is created at 19:50:43 on January 20, 2017.

|OSS Bucket|OSS Prefix|Partition format|OSS directory|
|:---------|:---------|:---------------|:------------|
|test-bucket|test-table|%Y/%m/%d/%H/%M|oss://test-bucket/test-table/2017/01/20/19/50\_1484913043351525351\_2850008|
|test-bucket|log\_ship\_oss\_example|year=%Y/mon=%m/day=%d/log\_%H%M%s|oss://test-bucket/log\_ship\_oss\_example/year=2017/mon=01/day=20/log\_195043\_1484913043351525351\_2850008.parquet|
|test-bucket|log\_ship\_oss\_example|ds=%Y%m%d/%H|oss://test-bucket/log\_ship\_oss\_example/ds=20170120/19\_1484913043351525351\_2850008.snappy|
|test-bucket|log\_ship\_oss\_example|%Y%m%d/|oss://test-bucket/log\_ship\_oss\_example/20170120/\_1484913043351525351\_2850008**Note:** This format may prevent platforms such as Hive from parsing related log data in the OSS bucket. We recommend that you do not use this format. |
|test-bucket|log\_ship\_oss\_example|%Y%m%d%H|oss://test-bucket/log\_ship\_oss\_example/2017012019\_1484913043351525351\_2850008|

You can use Hive, MaxCompute, or Data Lake Analytics \(DLA\) to analyze OSS data. In this case, if you want to use partition information, you can set PARTITION-FORMAT in the key=value format. For example, you can set the partition format to oss://test-bucket/log\_ship\_oss\_example/year=2017/mon=01/day=20/log\_195043\_1484913043351525351\_2850008.parquet. In this example, year, mon, and day are specified as three partition keys.

## Related operations

After shipping tasks are created based on a shipping rule, you can modify the shipping rule. You can also disable the data shipping feature, view the statuses and error messages of the tasks, and retry failed tasks on the OSS Shipper page of a Logstore.

-   Modify the shipping rule

    Click **Settings** to modify the shipping rule. For information about parameters, see [Ship log data](#section_gz3_etl_ezq).

-   Disable data shipping

    Click **Disable**. The data in the Logstore is not shipped to OSS.

-   View the statuses of tasks and error messages

    You can view the statuses of log shipping tasks within the last two days.

    -   Statuses of a shipping task

        |State|Description|
        |:----|:----------|
        |Succeeded|The shipping task succeeded.|
        |Running|The shipping task is running. Check whether the task succeeds later.|
        |Failed|The shipping task failed. If the task cannot be restarted due to external causes, troubleshoot the failure based on the error message and retry the task.|

    -   Error message

        If a shipping task fails, an error message is returned for the task.

        |Error message|Description|Method|
        |:------------|:----------|:-----|
        |UnAuthorized|The error message returned because the AliyunLogDefaultRole role does not have the required permissions.|To troubleshoot the error, check the following configurations:         -   Check whether the AliyunLogDefaultRole role is created by the OSS bucket owner.
        -   Check whether the Alibaba Cloud account ID configured in the permission policy is valid.
        -   Check whether the AliyunLogDefaultRole role is granted write permissions on the destination OSS bucket.
        -   Check whether the ARN of the AliyunLogDefaultRole role that you entered in the RAM Role field is valid. |
        |ConfigNotExist|The error message returned because the task does not exist.|Check whether the data shipping feature is disabled. Enable the data shipping feature, configure a shipping rule for the task, and then retry the task.|
        |InvalidOssBucket|The error message returned because the destination OSS bucket does not exist.|To troubleshoot the error, check the following configurations:         -   Check whether the destination OSS bucket resides in the same region as the source project.
        -   Check whether the specified bucket name is valid. |
        |InternalServerError|The error message returned because an internal error has occurred in Log Service.|Retry the failed task.|

    -   Retry a task

        By default, if a task fails, Log Service retries the task based on the retry policy. You can also manually retry the task. By default, Log Service retries all tasks of the last two days. The minimum interval between two consecutive retries is 15 minutes. If a task fails for the first time, Log Service retries the task 15 minutes later. If the task fails for the second time, Log Service retries the task 30 minutes later. If the task fails for the third time, Log Service retries the task 60 minutes later. A similar method is used for subsequent attempts.

        To immediately retry a failed task, you can click **Retry All Failed Tasks** or **Retry** on the right of the task. You can also use an API or SDK to retry a task.

## FAQ

How do I obtain the ARN of a RAM role?

1.  To obtain the ARN of a RAM role, log on to the [RAM console](https://ram.console.aliyun.com/).

2.  In the left-side navigation pane, click RAM Roles.

3.  In the RAM Role Name column, click the role named AliyunLogDefaultRole.

4.  On the page that appears, obtain the ARN of the role in the Basic Information section.

    ![Obtain the ARN of a RAM role](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/7332719161/p113301.png)

url: https://raw.githubusercontent.com/Freebird2014/sls/2a82d9f84cef19fec29d3561180ec4397de842b4/intl.en-US/Log consumption and shipping/Data shipping/Ship logs to OSS/Ship log data from Log Service to OSS.md


text:
# Git Basics

## Set up your information
```
git config --global user.name "John Doe"
git config --global user.email<EMAIL_ADDRESS>
git config --global github.user jdoe
```

## Clone a repository
```
git clone https://github.com/ktbyers/pynet_ons
```

## Add file to a repository
```
git add my_file.py
git commit -m "Adding my_file.py"
```

## Remove a file
```
git rm ex1_strings.py
git commit -m "Removin ex1_strings.py
```

## Push changes to remote repository
```
git push origin master

where 'origin' is defined in 'git remote -v'
where 'master' branch is the src branch; dest branch is same as src branch
```

## Pull changes from remote repository
```
git pull origin master

where 'origin' is defined in 'git remote -v'
where 'master' branch is the src branch; dest branch is same as src branch
```

## Branches
```
git branch                          # Look at branches
git branch dev                      # Create a 'dev' branch
git checkout dev                    # Switch to 'dev' branch
git checkout master                 # Switch back to 'master' branch
git push origin dev                 # Push changes up to GitHub for 'dev' branch jj
git merge dev                       # merge 'dev' into master (switch to 'master' branch first)
git branch -d dev                   # delete this branch
```

## Misc
```
git status                          # View the status of the repository
git log                             # View the commit log
git log -p -1                       # Show the changes in the last commit
```

gha_language: Python


text:
### Related Issue
<!---
Please refer to the Issue(s) this Pull Request addresses. This should be an Issue that is ready for implementation.
For example: #89-Create-a-pull-request-template
-->

### Those responsible
<!--
Please refer to the people that were responsible for the work that is being merged.
For example: @jwaa, @thaije
-->

### Description
<!--
A brief description of what was done to implement the issue.
For example: "Added method to the WorldBuild that easily creates walls and doors to shape a room."
-->

### Release notes
<!-- Please describe in a single line what the implementation does in user-friendly wording. If the work is not deemed important enough to be included in the Release Notes, you can write “N/A” here.
Examples:
- Fixed a bug that allowed agents to drop intraversable objects on each other.
- MATRX now allows you to easily create new rooms in your world.
-->

repository: matrx-software/matrx

repo_name: matrx-software/matrx